]> granicus.if.org Git - shadow/commitdiff
* libmisc/console.c, libmisc/hushed.c, libmisc/yesno.c,
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 13 Jun 2008 18:11:09 +0000 (18:11 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 13 Jun 2008 18:11:09 +0000 (18:11 +0000)
libmisc/loginprompt.c, libmisc/ttytype.c, libmisc/tz.c,
src/login_nopam.c, src/chpasswd.c, src/chgpasswd.c, lib/port.c:
The size argument of fgets is an int, not a size_t.
* libmisc/loginprompt.c: Ignore the return value from signal()
when the signal handlers are restored.
* src/chpasswd.c: Cast the return value of time() to a long
integer.
* src/chpasswd.c: Use the SCALE macro instead of (24L * 3600L)
for the values to be set in /etc/shadow.

lib/port.c
libmisc/console.c
libmisc/hushed.c
libmisc/loginprompt.c
libmisc/ttytype.c
libmisc/tz.c
libmisc/yesno.c
src/chgpasswd.c
src/chpasswd.c
src/login_nopam.c

index 07737d3e19670ee6137d9aab373d38a9fc5c6410..438879c18f204f15e0dd029478bdbdf0b5a99c2d 100644 (file)
@@ -157,7 +157,7 @@ static struct port *getportent (void)
         * is a '\n'.  Lines which begin with '#' are all ignored.
         */
 
-       if (fgets (buf, sizeof buf, ports) == 0) {
+       if (fgets (buf, (int) sizeof buf, ports) == 0) {
                errno = saveerr;
                return 0;
        }
index ec482406dc904a0b4d8d6a78a2d7bc3dfe5fa1dc..23970d79b45826201fe329145b61f78f6765aba4 100644 (file)
@@ -93,7 +93,7 @@ static bool is_listed (const char *cfgin, const char *tty, bool def)
         * See if this tty is listed in the console file.
         */
 
-       while (fgets (buf, sizeof (buf), fp) != NULL) {
+       while (fgets (buf, (int) sizeof (buf), fp) != NULL) {
                buf[strlen (buf) - 1] = '\0';
                if (strcmp (buf, tty) == 0) {
                        (void) fclose (fp);
index cff93811b65b5baad0a86591fa334511dd5f895b..0af41ab0e228ae9f88a20621a833c4df0b9ec296 100644 (file)
@@ -83,7 +83,7 @@ bool hushed (const struct passwd *pw)
        if (NULL == fp) {
                return false;
        }
-       for (found = false; !found && (fgets (buf, sizeof buf, fp) == buf);) {
+       for (found = false; !found && (fgets (buf, (int) sizeof buf, fp) == buf);) {
                buf[strlen (buf) - 1] = '\0';
                found = (strcmp (buf, pw->pw_shell) == 0) ||
                        (strcmp (buf, pw->pw_name) == 0);
index 449da680c51eb79b7c5bc8d5fc6c460aa3cd188a..778475d1a3e90b5bb8f1aaad8d44fc7ca46eddab 100644 (file)
@@ -109,7 +109,7 @@ void login_prompt (const char *prompt, char *name, int namesize)
         */
 
        memzero (buf, sizeof buf);
-       if (fgets (buf, sizeof buf, stdin) != buf) {
+       if (fgets (buf, (int) sizeof buf, stdin) != buf) {
                exit (1);
        }
 
@@ -167,9 +167,9 @@ void login_prompt (const char *prompt, char *name, int namesize)
         * Set the SIGQUIT handler back to its original value
         */
 
-       signal (SIGQUIT, sigquit);
+       (void) signal (SIGQUIT, sigquit);
 #ifdef SIGTSTP
-       signal (SIGTSTP, sigtstp);
+       (void) signal (SIGTSTP, sigtstp);
 #endif
 }
 
index b7af55b0595885fdc90bc5afb8562bdadb5f273b..d8ecf0a092365ca66b0646bdbbf41d3fbbd4628e 100644 (file)
@@ -62,7 +62,7 @@ void ttytype (const char *line)
                perror (typefile);
                return;
        }
-       while (fgets (buf, sizeof buf, fp) == buf) {
+       while (fgets (buf, (int) sizeof buf, fp) == buf) {
                if (buf[0] == '#') {
                        continue;
                }
index 66ea50c292a1bc18a164f28a4d31bf5e1cb17795..cc598219981ccca0a11d288f0767489b12358c62 100644 (file)
@@ -53,7 +53,7 @@ char *tz (const char *fname)
        const char *def_tz = "TZ=CST6CDT";
 
        if ((fp = fopen (fname, "r")) == NULL ||
-           fgets (tzbuf, sizeof (tzbuf), fp) == NULL) {
+           fgets (tzbuf, (int) sizeof (tzbuf), fp) == NULL) {
 #ifndef USE_PAM
                if (!(def_tz = getdef_str ("ENV_TZ")) || def_tz[0] == '/')
                        def_tz = "TZ=CST6CDT";
index d65879424daa517dc6736611ea0610456ea2b181..b3e2071228c0654b1467985fc04305a8bde64439 100644 (file)
@@ -70,7 +70,7 @@ bool yes_or_no (bool read_only)
         * Get a line and see what the first character is.
         */
        /* TODO: use gettext */
-       if (fgets (buf, sizeof buf, stdin) == buf) {
+       if (fgets (buf, (int) sizeof buf, stdin) == buf) {
                return buf[0] == 'y' || buf[0] == 'Y';
        }
 
index fc3110e8175a1cbd5a7c9c6c731919c02723588c..409b80d9a3494654a560d2d391f3117ab9d70656 100644 (file)
@@ -356,7 +356,7 @@ int main (int argc, char **argv)
         * group entry for each group will be looked up in the appropriate
         * file (gshadow or group) and the password changed.
         */
-       while (fgets (buf, sizeof buf, stdin) != (char *) 0) {
+       while (fgets (buf, (int) sizeof buf, stdin) != (char *) 0) {
                line++;
                cp = strrchr (buf, '\n');
                if (NULL != cp) {
index 1691a6050a6d3a2a01359f44f89719ee35cc1e73..b6cb0a2a5961cd24fac642c7c87f9be2805b9881 100644 (file)
@@ -324,7 +324,7 @@ int main (int argc, char **argv)
        struct passwd newpw;
        int errors = 0;
        int line = 0;
-       long now = time ((time_t *)NULL) / (24L * 3600L);
+       long now = (long) time ((time_t *)NULL) / SCALE;
        int ok;
 
        Prog = Basename (argv[0]);
@@ -349,7 +349,7 @@ int main (int argc, char **argv)
         * last change date is set in the age only if aging information is
         * present.
         */
-       while (fgets (buf, sizeof buf, stdin) != (char *) 0) {
+       while (fgets (buf, (int) sizeof buf, stdin) != (char *) 0) {
                line++;
                cp = strrchr (buf, '\n');
                if (NULL != cp) {
index 2f8a01b8ed9864369c2bd400d5737dcfd22345c0..0a954534e00203febcc85c2d2acb6b1e53ca07cd 100644 (file)
@@ -93,7 +93,8 @@ int login_access (const char *user, const char *from)
         */
        fp = fopen (TABLE, "r");
        if (NULL != fp) {
-               while (!match && (fgets (line, sizeof (line), fp) == line)) {
+               while (   !match
+                      && (fgets (line, (int) sizeof (line), fp) == line)) {
                        lineno++;
                        end = (int) strlen (line) - 1;
                        if (line[end] != '\n') {