]> git.pld-linux.org Git - packages/util-linux.git/blob - util-linux-pam.patch
fix for pam and logbtmp()
[packages/util-linux.git] / util-linux-pam.patch
1 diff -urN util-linux-2.11b.org/login-utils/login.c util-linux-2.11b/login-utils/login.c
2 --- util-linux-2.11b.org/login-utils/login.c    Wed May  2 19:09:39 2001
3 +++ util-linux-2.11b/login-utils/login.c        Wed May  2 19:06:08 2001
4 @@ -312,6 +312,9 @@
5  
6         memset(&ut, 0, sizeof(ut));
7  
8 +       if (!username)
9 +           username = "unknown";
10 +
11         strncpy(ut.ut_user, username, sizeof(ut.ut_user));
12  
13         strncpy(ut.ut_id, line + 3, sizeof(ut.ut_id));
14 @@ -576,6 +579,12 @@
15  
16      if(passwd_req == 1) {
17         int failcount=0;
18 +       
19 +       /* if we didn't get a user on the command line,
20 +          set it to NULL */
21 +       pam_get_item(pamh, PAM_USER, (const void **) &username);
22 +       if (!username || username[0] == '\0')
23 +           pam_set_item(pamh, PAM_USER, NULL);   
24  
25         /* there may be better ways to deal with some of these
26            conditions, but at least this way I don't think we'll
This page took 0.081047 seconds and 4 git commands to generate.