Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pam_rssh: init at unstable-2023-01-09 #209962

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions pkgs/os-specific/linux/pam_rssh/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
lib,
fetchFromGitHub,
rustPlatform,
openssl,
pam,
pkg-config,
}:
rustPlatform.buildRustPackage rec {
pname = "pam_rssh";
version = "unstable-2023-01-12";

src = fetchFromGitHub {
owner = "z4yx";
repo = pname;
rev = "773823b9a8605436e5bcfabd1c3ff8deb8503f43";
hash = "sha512-rAr4ugo+IaxOKXtfEq9stK4edodork2uz10trHDv9MN4Oc296uDQjLh8Sle04Z4mbW56rWlT8eHrW6YpqGHFpw==";
JamieMagee marked this conversation as resolved.
Show resolved Hide resolved
fetchSubmodules = true;
JamieMagee marked this conversation as resolved.
Show resolved Hide resolved
};

cargoHash = "sha512-gSZ2EAhFJ1XqYmrVqJm3QP0l433XQxvkstkvyDAFZXB6KXiGzN0EoFxYoTdD0q2fE3tr5EBlmm4iC/Jo3wi4sg==";

nativeBuildInputs = [
pkg-config
];

buildInputs = [
openssl
pam
];

doCheck = false;
# How do disable specific tests?
# checkFlags = [
# # Expects $USER and $SSH_AUTH_SOCK
# "--skip=lib::tests::sshagent_list_identities"
# "--skip=lib::tests::sshagent_auth"
# "--skip=lib::tests::sshagent_more_auth"
# "--skip=lib::tests::parse_user_authorized_keys"
# ];
Comment on lines +32 to +40
Copy link
Member

@SuperSandro2000 SuperSandro2000 Mar 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
doCheck = false;
# How do disable specific tests?
# checkFlags = [
# # Expects $USER and $SSH_AUTH_SOCK
# "--skip=lib::tests::sshagent_list_identities"
# "--skip=lib::tests::sshagent_auth"
# "--skip=lib::tests::sshagent_more_auth"
# "--skip=lib::tests::parse_user_authorized_keys"
# ];
checkFlags = [
# Expects $USER and $SSH_AUTH_SOCK
"--skip=test_sshagent_list_identities"
"--skip=test_sshagent_auth"
"--skip=test_sshagent_more_auth"
"--skip=test_parse_user_authorized_keys"
];

that does not work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I get the following error:

Details
error: environment variable `SSH_AUTH_SOCK` not defined
   --> src/lib.rs:198:42
    |
198 |         let mut agent = AgentClient::new(env!("SSH_AUTH_SOCK"));
    |                                          ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `SSH_AUTH_SOCK` not defined
   --> src/lib.rs:213:42
    |
213 |         let mut agent = AgentClient::new(env!("SSH_AUTH_SOCK"));
    |                                          ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `SSH_AUTH_SOCK` not defined
   --> src/lib.rs:235:42
    |
235 |         let mut agent = AgentClient::new(env!("SSH_AUTH_SOCK"));
    |                                          ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: environment variable `USER` not defined
   --> src/lib.rs:252:24
    |
252 |         let username = env!("USER");
    |                        ^^^^^^^^^^^^
    |
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you prefixing the tests with test_?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same error message ☹️


meta = with lib; {
description = "Remote sudo authenticated via ssh-agent";
homepage = "https://github.com/z4yx/pam_rssh";
license = licenses.mit;
maintainers = with maintainers; [jamiemagee];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27019,6 +27019,8 @@ with pkgs;

pam_pgsql = callPackage ../os-specific/linux/pam_pgsql { };

pam_rssh = callPackage ../os-specific/linux/pam_rssh { };

pam_ssh_agent_auth = callPackage ../os-specific/linux/pam_ssh_agent_auth { };

pam_tmpdir = callPackage ../os-specific/linux/pam_tmpdir { };
Expand Down