diff options
author | Sebastien Tricaud <toady@gscore.org> | 2004-11-16 14:27:40 +0000 |
---|---|---|
committer | Sebastien Tricaud <toady@gscore.org> | 2004-11-16 14:27:40 +0000 |
commit | 6d6eebcafec81d696b621d8453b13d55a1f9be1d (patch) | |
tree | 441c3d1fc820ffa2d83b3e1cd592715a3724d0ed /modules/pam_access | |
parent | f135e2b8bca4998e100d412690e493dfff90dbbd (diff) | |
download | pam-6d6eebcafec81d696b621d8453b13d55a1f9be1d.tar.gz pam-6d6eebcafec81d696b621d8453b13d55a1f9be1d.tar.bz2 pam-6d6eebcafec81d696b621d8453b13d55a1f9be1d.zip |
Applied debian patches
Diffstat (limited to 'modules/pam_access')
-rw-r--r-- | modules/pam_access/access.conf | 7 | ||||
-rw-r--r-- | modules/pam_access/pam_access.c | 13 |
2 files changed, 15 insertions, 5 deletions
diff --git a/modules/pam_access/access.conf b/modules/pam_access/access.conf index dbaadf67..cec2be0c 100644 --- a/modules/pam_access/access.conf +++ b/modules/pam_access/access.conf @@ -40,8 +40,15 @@ # logged-in user. Both the user's primary group is matched, as well as # groups in which users are explicitly listed. # +# TTY NAMES: Must be in the form returned by ttyname(3) less the initial +# "/dev" (e.g. tty1 or vc/1) +# ############################################################################## # +# Disallow non-root logins on tty1 +# +#-:ALL EXCEPT root:tty1 +# # Disallow console logins to all but a few accounts. # #-:ALL EXCEPT wheel shutdown sync:LOCAL diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c index 42e03527..4f6cf574 100644 --- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -194,10 +194,11 @@ login_access (pam_handle_t *pamh, struct login_info *item) line[end] = 0; /* strip trailing whitespace */ if (line[0] == 0) /* skip blank lines */ continue; + + /* Allow trailing: in last field fo froms */ if (!(perm = strtok(line, fs)) || !(users = strtok((char *) 0, fs)) - || !(froms = strtok((char *) 0, fs)) - || strtok((char *) 0, fs)) { + || !(froms = strtok((char *) 0, fs))) { _log_err("%s: line %d: bad field count", item->config_file, lineno); continue; @@ -438,10 +439,12 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh,int flags,int argc return PAM_ABORT; } } - if (strncmp("/dev/",from,5) == 0) { /* strip leading /dev/ */ - from += 5; - } + if (from[0] == '/') { /* full path */ + from++; + from = strchr(from, '/'); + from++; + } } if ((user_pw=_pammodutil_getpwnam(pamh, user))==NULL) return (PAM_USER_UNKNOWN); |