]> granicus.if.org Git - shadow/commitdiff
* libmisc/limits.c: Fix the format to match the unsigned long
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 7 Sep 2009 19:50:00 +0000 (19:50 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 7 Sep 2009 19:50:00 +0000 (19:50 +0000)
variable in argument.
* libmisc/utmp.c: Fix tests. tmptty is a variable stack. ut_host
is an array of the ut structure. None of them can be NULL.

ChangeLog
libmisc/limits.c
libmisc/utmp.c

index befe7550463e09b0688f4cae5487fb7ac68fc308..bee9c2c9c605302cd1a43b6eb424d5c7d9e4b689 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-07  Steve Grubb  <sgrubb@redhat.com>
+
+       * libmisc/limits.c: Fix the format to match the unsigned long
+       variable in argument.
+       * libmisc/utmp.c: Fix tests. tmptty is a variable stack. ut_host
+       is an array of the ut structure. None of them can be NULL.
+
 2009-09-07  Nicolas François  <nicolas.francois@centraliens.net>
 
        * lib/shadowmem.c: Only copy the required fields of the struct
index 0eb2c4946d10bf9675df779bfdb57fff0dabbbd4..bfcce52e198a5ced51599951fa3aa2c8e3cfa664 100644 (file)
@@ -167,8 +167,9 @@ static int check_logins (const char *name, const char *maxlogins)
         * includes the user who is currently trying to log in.
         */
        if (count > limit) {
-               SYSLOG ((LOG_WARN, "Too many logins (max %d) for %s\n",
-                        limit, name));
+               SYSLOG ((LOG_WARN,
+                        "Too many logins (max %lu) for %s\n",
+                        limit, name));
                return LOGIN_ERROR_LOGIN;
        }
        return 0;
index 976396d607df0dd80431a34de7dbabbdd08d4d8a..271aaa44b9d08a05cb3f269d46258308d763b43c 100644 (file)
@@ -71,7 +71,7 @@ static bool is_my_tty (const char *tty)
                }
        }
 
-       if (NULL == tmptty) {
+       if ('\0' == tmptty[0]) {
                (void) puts (_("Unable to determine your tty name."));
                exit (EXIT_FAILURE);
        } else if (strncmp (tty, tmptty, sizeof (tmptty)) != 0) {
@@ -200,7 +200,6 @@ static void updwtmpx (const char *filename, const struct utmpx *utx)
                strcpy (hostname, host);
 #ifdef HAVE_STRUCT_UTMP_UT_HOST
        } else if (   (NULL != ut)
-                  && (NULL != ut->ut_host)
                   && ('\0' != ut->ut_host[0])) {
                hostname = (char *) xmalloc (sizeof (ut->ut_host) + 1);
                strncpy (hostname, ut->ut_host, sizeof (ut->ut_host));