* Support LDAP authentication.

* Factor out the common parts of the PAM config files.

svn path=/nixos/trunk/; revision=7694
This commit is contained in:
Eelco Dolstra 2007-01-16 13:30:59 +00:00
parent 554ae9908b
commit 07506308d6
10 changed files with 32 additions and 19 deletions

View File

@ -75,7 +75,7 @@ import ../helpers/make-etc.nix {
(program:
{ source = pkgs.substituteAll {
src = ./etc/pam.d + ("/" + program);
inherit (pkgs) pam_unix2;
inherit (pkgs) pam_unix2 pam_ldap;
};
target = "pam.d/" + program;
}
@ -88,6 +88,10 @@ import ../helpers/make-etc.nix {
"shadow"
"sshd"
"useradd"
"common-auth"
"common-account"
"common-password"
"common-session"
]
);
}

View File

@ -0,0 +1,2 @@
account optional @pam_ldap@/lib/security/pam_ldap.so
account required @pam_unix2@/lib/security/pam_unix2.so

View File

@ -0,0 +1,3 @@
auth sufficient @pam_ldap@/lib/security/pam_ldap.so
auth sufficient @pam_unix2@/lib/security/pam_unix2.so
auth required pam_deny.so

View File

@ -0,0 +1,2 @@
password sufficient @pam_ldap@/lib/security/pam_ldap.so
password sufficient @pam_unix2@/lib/security/pam_unix2.so nullok

View File

@ -0,0 +1,2 @@
auth optional @pam_ldap@/lib/security/pam_ldap.so
session required @pam_unix2@/lib/security/pam_unix2.so

View File

@ -1,4 +1,4 @@
auth required @pam_unix2@/lib/security/pam_unix2.so nullok
account required @pam_unix2@/lib/security/pam_unix2.so
password required @pam_unix2@/lib/security/pam_unix2.so nullok
session required @pam_unix2@/lib/security/pam_unix2.so
auth include common-auth
account include common-account
password include common-password
session include common-session

View File

@ -1,4 +1,4 @@
auth required @pam_unix2@/lib/security/pam_unix2.so
account required @pam_unix2@/lib/security/pam_unix2.so
password required @pam_unix2@/lib/security/pam_unix2.so nullok
session required @pam_unix2@/lib/security/pam_unix2.so
auth include common-auth
account include common-account
password include common-password
session include common-session

View File

@ -1,4 +1,4 @@
auth required @pam_unix2@/lib/security/pam_unix2.so
account required @pam_unix2@/lib/security/pam_unix2.so
password required @pam_unix2@/lib/security/pam_unix2.so nullok
session required @pam_unix2@/lib/security/pam_unix2.so
auth include common-auth
account include common-account
password include common-password
session include common-session

View File

@ -1,5 +1,5 @@
auth sufficient pam_rootok.so
auth required @pam_unix2@/lib/security/pam_unix2.so nullok
account required @pam_unix2@/lib/security/pam_unix2.so
password required @pam_unix2@/lib/security/pam_unix2.so nullok
session required @pam_unix2@/lib/security/pam_unix2.so
auth include common-auth
account include common-account
password include common-password
session include common-session

View File

@ -17,8 +17,8 @@ fi
# Set up the per-user profile.
NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/$USER
mkdir -m 0755 -p $NIX_USER_PROFILE_DIR
if test "$(stat --printf '%U' $NIX_USER_PROFILE_DIR)" != "$USER"; then
echo "WARNING: bad ownership on $_NIX_PROFILE_DIR" >&2
if test "$(stat --printf '%u' $NIX_USER_PROFILE_DIR)" != "$(id -u)"; then
echo "WARNING: bad ownership on $NIX_USER_PROFILE_DIR" >&2
fi
if ! test -L $HOME/.nix-profile; then