~ubuntu-branches/ubuntu/breezy/pam/breezy

« back to all changes in this revision

Viewing changes to debian/patches-applied/011_pam_access

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2004-06-28 14:28:08 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040628142808-adikk7vtfg3pzcjw
Tags: 0.76-22
* Add uploaders
* Document location of repository
* Fix options containing arguments in pam_unix, Closes: #254904

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: Linux-PAM/modules/pam_access/access.conf
 
2
===================================================================
 
3
RCS file: /afs/sipb/project/debian/cvs/pam/Linux-PAM/modules/pam_access/access.conf,v
 
4
retrieving revision 1.3
 
5
diff -u -r1.3 access.conf
 
6
--- Linux-PAM/modules/pam_access/access.conf    15 Sep 2002 20:17:59 -0000      1.3
 
7
+++ Linux-PAM/modules/pam_access/access.conf    15 Sep 2002 21:33:32 -0000
 
8
@@ -40,8 +40,15 @@
 
9
 # logged-in user. Both the user's primary group is matched, as well as
 
10
 # groups in which users are explicitly listed.
 
11
 #
 
12
+# TTY NAMES: Must be in the form returned by ttyname(3) less the initial
 
13
+# "/dev/" (e.g. tty1 or vc/1)
 
14
+#
 
15
 ##############################################################################
 
16
-# 
 
17
+#
 
18
+# Disallow non-root logins on tty1
 
19
+#
 
20
+#-:ALL EXCEPT root:tty1
 
21
+#
 
22
 # Disallow console logins to all but a few accounts.
 
23
 #
 
24
 #-:ALL EXCEPT wheel shutdown sync:LOCAL
 
25
Index: Linux-PAM/modules/pam_access/pam_access.c
 
26
===================================================================
 
27
RCS file: /afs/sipb/project/debian/cvs/pam/Linux-PAM/modules/pam_access/pam_access.c,v
 
28
retrieving revision 1.4
 
29
diff -u -r1.4 pam_access.c
 
30
--- Linux-PAM/modules/pam_access/pam_access.c   15 Sep 2002 20:17:59 -0000      1.4
 
31
+++ Linux-PAM/modules/pam_access/pam_access.c   15 Sep 2002 21:34:39 -0000
 
32
@@ -193,10 +193,10 @@
 
33
            line[end] = 0;                      /* strip trailing whitespace */
 
34
            if (line[0] == 0)                   /* skip blank lines */
 
35
                continue;
 
36
-           if (!(perm = strtok(line, fs))
 
37
+           /* Allow trailing : in last field for froms */
 
38
+                   if (!(perm = strtok(line, fs))
 
39
                || !(users = strtok((char *) 0, fs))
 
40
-               || !(froms = strtok((char *) 0, fs))
 
41
-               || strtok((char *) 0, fs)) {
 
42
+               || !(froms = strtok((char *) 0, fs))) {
 
43
                _log_err("%s: line %d: bad field count",
 
44
                         item->config_file, lineno);
 
45
                continue;
 
46
@@ -262,16 +262,11 @@
 
47
 
 
48
 static int netgroup_match(char *group, char *machine, char *user)
 
49
 {
 
50
-#ifdef NIS
 
51
     static char *mydomain = 0;
 
52
 
 
53
     if (mydomain == 0)
 
54
        yp_get_default_domain(&mydomain);
 
55
     return (innetgr(group, machine, user, mydomain));
 
56
-#else
 
57
-    _log_err("NIS netgroup support not configured");
 
58
-    return (NO);
 
59
-#endif
 
60
 }
 
61
 
 
62
 /* user_match - match a username against one token */
 
63
@@ -447,10 +442,11 @@
 
64
                return PAM_ABORT;
 
65
             }
 
66
         }
 
67
-        if (strncmp("/dev/",from,5) == 0) {          /* strip leading /dev/ */
 
68
-           from += 5;
 
69
-        }
 
70
-
 
71
+       if (from[0] == '/') { /* full path */
 
72
+           from++;
 
73
+           from = strchr(from, '/');
 
74
+           from++;
 
75
+       }
 
76
     }
 
77
 
 
78
     if ((user_pw=getpwnam(user))==NULL) return (PAM_USER_UNKNOWN);