Initialize Tizen 2.3
[external/shadow-utils.git] / packaging / shadow-4.1.4.2-fixes.patch
1 diff -up shadow-4.1.4.2/lib/commonio.c.fixes shadow-4.1.4.2/lib/commonio.c
2 --- shadow-4.1.4.2/lib/commonio.c.fixes 2009-09-07 15:51:28.312139467 +0200
3 +++ shadow-4.1.4.2/lib/commonio.c       2009-09-07 15:52:00.788140456 +0200
4 @@ -710,7 +710,7 @@ commonio_sort (struct commonio_db *db, i
5         db->tail->prev = entries[n - 1];
6         db->tail->next = NULL;
7  
8 -       for (i = 1; i < n; i++) {
9 +       for (i = 1; i < (n-1); i++) {
10                 entries[i]->prev = entries[i - 1];
11                 entries[i]->next = entries[i + 1];
12         }
13 diff -up shadow-4.1.4.2/libmisc/cleanup.c.fixes shadow-4.1.4.2/libmisc/cleanup.c
14 --- shadow-4.1.4.2/libmisc/cleanup.c.fixes      2009-09-07 15:52:22.449035388 +0200
15 +++ shadow-4.1.4.2/libmisc/cleanup.c    2009-09-07 15:55:06.632033653 +0200
16 @@ -107,7 +107,7 @@ void del_cleanup (cleanup_function pcf)
17         assert (i<CLEANUP_FUNCTIONS);
18  
19         /* Move the rest of the cleanup functions */
20 -       for (; i<CLEANUP_FUNCTIONS; i++) {
21 +       for (; i<(CLEANUP_FUNCTIONS - 1); i++) {
22                 /* Make sure the cleanup function was specified only once */
23                 assert (cleanup_functions[i+1] != pcf);
24  
25 diff -up shadow-4.1.4.2/libmisc/limits.c.fixes shadow-4.1.4.2/libmisc/limits.c
26 --- shadow-4.1.4.2/libmisc/limits.c.fixes       2009-09-07 15:55:38.734034494 +0200
27 +++ shadow-4.1.4.2/libmisc/limits.c     2009-09-07 15:56:10.545044166 +0200
28 @@ -167,7 +167,7 @@ static int check_logins (const char *nam
29          * includes the user who is currently trying to log in.
30          */
31         if (count > limit) {
32 -               SYSLOG ((LOG_WARN, "Too many logins (max %d) for %s\n",
33 +               SYSLOG ((LOG_WARN, "Too many logins (max %lu) for %s\n",
34                          limit, name));
35                 return LOGIN_ERROR_LOGIN;
36         }
37 diff -up shadow-4.1.4.2/libmisc/utmp.c.fixes shadow-4.1.4.2/libmisc/utmp.c
38 --- shadow-4.1.4.2/libmisc/utmp.c.fixes 2009-09-07 15:56:30.534033865 +0200
39 +++ shadow-4.1.4.2/libmisc/utmp.c       2009-09-07 16:11:23.049069289 +0200
40 @@ -56,7 +56,7 @@ static bool is_my_tty (const char *tty)
41         /* full_tty shall be at least sizeof utmp.ut_line + 5 */
42         char full_tty[200];
43         /* tmptty shall be bigger than full_tty */
44 -       static char tmptty[sizeof (full_tty)+1];
45 +       static char tmptty[sizeof (full_tty)+1] = "";
46  
47         if ('/' != *tty) {
48                 (void) snprintf (full_tty, sizeof full_tty, "/dev/%s", tty);
49 @@ -71,7 +71,7 @@ static bool is_my_tty (const char *tty)
50                 }
51         }
52  
53 -       if (NULL == tmptty) {
54 +       if ('\0' == tmptty[0]) {
55                 (void) puts (_("Unable to determine your tty name."));
56                 exit (EXIT_FAILURE);
57         } else if (strncmp (tty, tmptty, sizeof (tmptty)) != 0) {
58 @@ -200,7 +200,6 @@ static void updwtmpx (const char *filena
59                 strcpy (hostname, host);
60  #ifdef HAVE_STRUCT_UTMP_UT_HOST
61         } else if (   (NULL != ut)
62 -                  && (NULL != ut->ut_host)
63                    && ('\0' != ut->ut_host[0])) {
64                 hostname = (char *) xmalloc (sizeof (ut->ut_host) + 1);
65                 strncpy (hostname, ut->ut_host, sizeof (ut->ut_host));