]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Don't redefine errno(3)
authorAlejandro Colomar <alx@kernel.org>
Wed, 21 Dec 2022 18:02:25 +0000 (19:02 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Thu, 22 Dec 2022 10:43:29 +0000 (11:43 +0100)
It is Undefined Behavior to declare errno (see NOTES in its manual page).
Instead of using the errno dummy declaration, use one that doesn't need
a comment.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
24 files changed:
lib/gshadow.c
lib/lockpw.c
lib/nscd.c
lib/pwauth.c
lib/selinux.c
lib/semanage.c
lib/sgetspent.c
lib/sgroupio.c
lib/shadow.c
lib/sssd.c
lib/subordinateio.c
lib/utent.c
libmisc/addgrps.c
libmisc/audit_help.c
libmisc/find_new_sub_gids.c
libmisc/find_new_sub_uids.c
libmisc/limits.c
libmisc/obscure.c
libmisc/pam_pass.c
libmisc/pam_pass_non_interactive.c
libmisc/pwd2spwd.c
libmisc/pwdcheck.c
libmisc/tz.c
src/login_nopam.c

index 2e1292302ca55833bf9a19caf1e056fb0d7ec8d1..cff8cb5828b70ca2702888f5c4b5167e93e055c8 100644 (file)
@@ -502,5 +502,5 @@ int putsgent (const struct sgrp *sgrp, FILE * fp)
        return 0;
 }
 #else
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /*} SHADOWGRP */
index aaa317fdf41b262c24e1dac9e047be539ba31079..15e7c8f411d7d639013c44742ff7426c68ede49f 100644 (file)
@@ -81,5 +81,5 @@ int ulckpwdf (void)
        return (pw_unlock () && spw_unlock ())? 0 : -1;
 }
 #else
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif
index 2c2251afa14e52ec29552418a08c4120a06bd061..451a5a3602968dc4e6b5659e731c680d9ef46420 100644 (file)
@@ -53,6 +53,6 @@ int nscd_flush_cache (const char *service)
        return 0;
 }
 #else                          /* USE_NSCD */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* USE_NSCD */
 
index 62de4723561e85b64a15c5a3f1ae8ea946f7690b..df67b04e13be454ad42e38e0308fa8009b7555ed 100644 (file)
@@ -207,5 +207,5 @@ int pw_auth (const char *cipher,
        return retval;
 }
 #else                          /* !USE_PAM */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !USE_PAM */
index ad639bd33baebfe26da759a0c960dd6c1798326d..5e3ef1a36920fa22aec980657999a902703e55a4 100644 (file)
@@ -206,5 +206,5 @@ int check_selinux_permit (const char *perm_name)
 }
 
 #else                          /* !WITH_SELINUX */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !WITH_SELINUX */
index 082a6e8eeadc73b1e6d2dd5200f40bf5ea11264d..3f21b3eeb88f446c1a4ad488266ff04d00bce29b 100644 (file)
@@ -357,5 +357,5 @@ done:
        return ret;
 }
 #else                          /* !WITH_SELINUX */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !WITH_SELINUX */
index f1d4b20172de8cce5c835adb4c753e87d8dbecf6..0bdc21f15a0a7ede51d4de67ff91070b5e6591b9 100644 (file)
@@ -182,6 +182,6 @@ struct spwd *sgetspent (const char *string)
        return (&spwd);
 }
 #else
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif
 
index 871749bda76d35580091681574ca19973f53b72f..aa95e116fd6b075437d1535cdbf96ac241aac789 100644 (file)
@@ -302,5 +302,5 @@ int sgr_sort ()
        return commonio_sort_wrt (&gshadow_db, __gr_get_db ());
 }
 #else
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif
index b628b65733026cea7c041a37b03bf3ddcfe134d9..6a89a3f6123e1f8959b1f34087f19fd411a7aaa7 100644 (file)
@@ -525,6 +525,6 @@ struct spwd *getspnam (const char *name)
        return (sp);
 }
 #else
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif
 
index 786ccd6072fd8df25db1822cfcd7a5bd95f87371..3727c8fdc5c1e5e71d5951dc7d814422fe784fcc 100644 (file)
@@ -70,6 +70,6 @@ int sssd_flush_cache (int dbflags)
        return 0;
 }
 #else                          /* USE_SSSD */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* USE_SSSD */
 
index bd1af26b45285078bfaa636181a08b3cd334723e..980cd2456cfbe4339c216ae92352927cfa341391 100644 (file)
@@ -1097,6 +1097,6 @@ bool release_subid_range(struct subordinate_range *range, enum subid_type id_typ
 }
 
 #else                          /* !ENABLE_SUBIDS */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !ENABLE_SUBIDS */
 
index d5e6daea1206d2861c7ad259deacf131e35661e9..988201b282f92a6b9e980ac0df8e9a3300895014 100644 (file)
@@ -66,5 +66,5 @@ struct utmp *getutent (void)
        return &utmp_buf;
 }
 #else
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif
index 845d383bb7b1d26faaba5a9c9d08b6906ab2a40f..63008a67cc84ba33f301a27a115b790236154a58 100644 (file)
@@ -109,6 +109,6 @@ int add_groups (const char *list)
        return 0;
 }
 #else                          /* HAVE_SETGROUPS && !USE_PAM */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* HAVE_SETGROUPS && !USE_PAM */
 
index e6c2006bd7d33d316bf8b2725172e5aab0159169..e9ce05517196ede9e0a99386588e41b9a07c931a 100644 (file)
@@ -82,6 +82,6 @@ void audit_logger_message (const char *message, shadow_audit_result result)
 }
 
 #else                          /* WITH_AUDIT */
-extern int errno;      /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* WITH_AUDIT */
 
index bbd4570b19e6dabb36e574e8c1190971898f9bbf..74c9d8f599132872dc2506c219af9ae04523f2fa 100644 (file)
@@ -59,6 +59,6 @@ int find_new_sub_gids (gid_t *range_start, unsigned long *range_count)
        return 0;
 }
 #else                          /* !ENABLE_SUBIDS */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !ENABLE_SUBIDS */
 
index a86b311aad175cfd04a4bae4477f4227bd0d035a..cc4b0cf45220bb7bd0f122fddba4d41583f65246 100644 (file)
@@ -59,6 +59,6 @@ int find_new_sub_uids (uid_t *range_start, unsigned long *range_count)
        return 0;
 }
 #else                          /* !ENABLE_SUBIDS */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !ENABLE_SUBIDS */
 
index cf0e30aed6d7989f6a58a4b3b3eafcf75d81981d..ea95a20691aff0fa5e26c01fc0238b0ef379ecb8 100644 (file)
@@ -550,6 +550,6 @@ void setup_limits (const struct passwd *info)
 }
 
 #else                          /* !USE_PAM */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !USE_PAM */
 
index 3daaa9587675d76cce491385eb3d9bff81ade11c..f3b7096d926d923f4a09ec9c2c4ea0c052de9262 100644 (file)
@@ -302,5 +302,5 @@ bool obscure (const char *old, const char *new, const struct passwd *pwdp)
 }
 
 #else                          /* !USE_PAM */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !USE_PAM */
index 166a42efad7753bf9fd0877a751d02c9e13202fa..ff491739574b0b193cf1b3ec23752656e15efbb2 100644 (file)
@@ -55,5 +55,5 @@ void do_pam_passwd (const char *user, bool silent, bool change_expired)
        (void) pam_end (pamh, PAM_SUCCESS);
 }
 #else                          /* !USE_PAM */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !USE_PAM */
index 34cdc1f23c64eaaedbf95c870aca99f62313949a..eeaa3c80f76d8c54c3fbf9b06f21212b5a7a9b84 100644 (file)
@@ -141,5 +141,5 @@ int do_pam_passwd_non_interactive (const char *pam_service,
        return ((PAM_SUCCESS == ret) ? 0 : 1);
 }
 #else                          /* !USE_PAM */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !USE_PAM */
index 139a0240c08ea57a267742c6553bae4ef81627cf..636d81f2a4d165c7072fa315285fccd245a315ae 100644 (file)
@@ -62,6 +62,6 @@ struct spwd *pwd_to_spwd (const struct passwd *pw)
        return &sp;
 }
 #else                          /* USE_PAM */
-extern int errno;      /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !USE_PAM */
 
index 15fc3a33221b487d3439a73d18f59112f418f16c..e72920e8c1dbd2160d8953692bb3c6dc25f60ffe 100644 (file)
@@ -34,5 +34,5 @@ void passwd_check (const char *user, const char *passwd, unused const char *prog
        }
 }
 #else                  /* USE_PAM */
-extern int errno;      /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                 /* USE_PAM */
index 16d92ade6655664ccff10c935bf5ea7afe5c2bc2..f3f5733e3810c50f7858ae3ca046a01c13eb384c 100644 (file)
@@ -52,6 +52,6 @@
        return tzbuf;
 }
 #else                          /* !USE_PAM */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !USE_PAM */
 
index 0ebe3bfc255f48d48d1fa3ec985927c319426254..c6a6b41e52a96a25130d7e01ab113ef58d0f2032 100644 (file)
@@ -335,5 +335,5 @@ static bool string_match (const char *tok, const char *string)
 }
 
 #else                          /* !USE_PAM */
-extern int errno;              /* warning: ANSI C forbids an empty source file */
+extern int ISO_C_forbids_an_empty_translation_unit;
 #endif                         /* !USE_PAM */