]> granicus.if.org Git - shadow/commitdiff
* src/login.c: Ignore the return value of signal().
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 13 Jun 2008 21:25:15 +0000 (21:25 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 13 Jun 2008 21:25:15 +0000 (21:25 +0000)
* src/login.c: Use a %lu format and cast group and user IDs to
unsigned long integers.
* src/login.c: Ignore return value of setlocale(),
bindtextdomain(), and textdomain().

ChangeLog
src/login.c

index 1cd281e30f45efd25c32b063fdaed972bc6170d2..095d39ea33b693ef2d9b00da9bd457e21c6dfd66 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-06-13  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/login.c: Ignore the return value of signal().
+       * src/login.c: Use a %lu format and cast group and user IDs to
+       unsigned long integers.
+       * src/login.c: Ignore return value of setlocale(),
+       bindtextdomain(), and textdomain().
+
 2008-06-13  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/chage.c: Add the arguments' names in the functions
index 8f8bc28960ec8b8b307e5ddfb93c387233fdada9..90f0ca259742a3e48c07643bdf6c5623f0635bb4 100644 (file)
@@ -615,7 +615,7 @@ int main (int argc, char **argv)
 
              top:
                /* only allow ALARM sec. for login */
-               signal (SIGALRM, alarm_handler);
+               (void) signal (SIGALRM, alarm_handler);
                timeout = getdef_num ("LOGIN_TIMEOUT", ALARM);
                if (timeout > 0) {
                        alarm (timeout);
@@ -754,7 +754,8 @@ int main (int argc, char **argv)
                                        pw = getpwnam (username);
                                        if (NULL != pw) {
                                                snprintf (buf, sizeof (buf),
-                                                 "uid=%d", pw->pw_uid);
+                                                         "uid=%lu",
+                                                   (unsigned long) pw->pw_uid);
                                                audit_log_user_message
                                                    (audit_fd, AUDIT_USER_LOGIN,
                                                     buf, hostname, NULL,
@@ -1053,7 +1054,8 @@ int main (int argc, char **argv)
                char buf[32];
 
                audit_fd = audit_open ();
-               snprintf (buf, sizeof (buf), "uid=%d", pwd->pw_uid);
+               snprintf (buf, sizeof (buf), "uid=%lu",
+                         (unsigned long) pwd->pw_uid);
                audit_log_user_message (audit_fd, AUDIT_USER_LOGIN,
                                        buf, hostname, NULL, tty, 1);
                close (audit_fd);
@@ -1093,7 +1095,7 @@ int main (int argc, char **argv)
         * We must fork before setuid() because we need to call
         * pam_close_session() as root.
         */
-       signal (SIGINT, SIG_IGN);
+       (void) signal (SIGINT, SIG_IGN);
        child = fork ();
        if (child < 0) {
                /* error in fork() */
@@ -1144,9 +1146,9 @@ int main (int argc, char **argv)
        }
 #endif
 
-       setlocale (LC_ALL, "");
-       bindtextdomain (PACKAGE, LOCALEDIR);
-       textdomain (PACKAGE);
+       (void) setlocale (LC_ALL, "");
+       (void) bindtextdomain (PACKAGE, LOCALEDIR);
+       (void) textdomain (PACKAGE);
 
        if (!hushed (&pwent)) {
                addenv ("HUSHLOGIN=FALSE", NULL);
@@ -1205,11 +1207,11 @@ int main (int argc, char **argv)
                ttytype (tty);
        }
 
-       signal (SIGQUIT, SIG_DFL);      /* default quit signal */
-       signal (SIGTERM, SIG_DFL);      /* default terminate signal */
-       signal (SIGALRM, SIG_DFL);      /* default alarm signal */
-       signal (SIGHUP, SIG_DFL);       /* added this.  --marekm */
-       signal (SIGINT, SIG_DFL);       /* default interrupt signal */
+       (void) signal (SIGQUIT, SIG_DFL);       /* default quit signal */
+       (void) signal (SIGTERM, SIG_DFL);       /* default terminate signal */
+       (void) signal (SIGALRM, SIG_DFL);       /* default alarm signal */
+       (void) signal (SIGHUP, SIG_DFL);        /* added this.  --marekm */
+       (void) signal (SIGINT, SIG_DFL);        /* default interrupt signal */
 
        endpwent ();            /* stop access to password file */
        endgrent ();            /* stop access to group file */