]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/, src/, tests/: #undef NDEBUG before #include <assert.h>
authorAlejandro Colomar <alx@kernel.org>
Fri, 13 Mar 2026 15:57:52 +0000 (16:57 +0100)
committerSerge Hallyn <serge@hallyn.com>
Mon, 16 Mar 2026 03:46:43 +0000 (22:46 -0500)
Otherwise, assert(3) might do nothing, which would be unsafe.

The goal would be to not use assert(3) at all, actually, but as long as
we use it, we should make sure we do actually use it.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
37 files changed:
lib/cleanup.c
lib/cleanup_group.c
lib/cleanup_user.c
lib/commonio.c
lib/copydir.c
lib/env.c
lib/find_new_gid.c
lib/find_new_sub_gids.c
lib/find_new_sub_uids.c
lib/find_new_uid.c
lib/groupio.c
lib/list.c
lib/loginprompt.c
lib/mail.c
lib/pam_pass_non_interactive.c
lib/prefix_flag.c
lib/root_flag.c
lib/salt.c
lib/setupenv.c
lib/user_busy.c
lib/utmp.c
src/faillog.c
src/lastlog.c
src/login.c
src/newgrp.c
src/useradd.c
src/userdel.c
src/usermod.c
tests/common/fopen_failure.c
tests/common/link_failure.c
tests/common/open_RDONLY_failure.c
tests/common/open_RDWR_failure.c
tests/common/rename_failure.c
tests/common/rmdir_failure.c
tests/common/time_past.c
tests/common/unlink_failure.c
tests/common/unlinkat_failure.c

index 93b619fdff5f945cd670825ede435d53c80afdc2..4fc12eae88b920ad36d966ee01e985ec87f16136 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "prototypes.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 89dbc1c36807424086f21e5303fa8f5268bc42b7..4235c1cd3ebe6383eb0e510b4180eb2066271005 100644 (file)
@@ -15,6 +15,7 @@
 #include "prototypes.h"
 #include "shadowlog.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index ba082a1c162061e2aec1ed226d5db3cafd724684..940d8a087bbf1cd032563c2058402581665acd66 100644 (file)
@@ -14,6 +14,7 @@
 #include "prototypes.h"
 #include "shadowlog.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 4aa66fbf6f3b95107dc235f27af17b364cb7f3a2..07927178ad65fc0f0e19e5745dcd49dacbafd842 100644 (file)
@@ -40,6 +40,7 @@
 #include "string/strerrno.h"
 #include "string/strtok/stpsep.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index c86d40901b39ecb1a97736242c004df5076a3956..3976bf8e342983ef83dfb244813bd9a2c9e1dab3 100644 (file)
@@ -35,6 +35,7 @@
 #include "string/strcmp/strprefix.h"
 #include "string/strerrno.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 406e2cd8ba47609cdf20e475dfb44c17852c176f..cdbd87d6260a0b901d90b2105d3e6fd16d6e95f6 100644 (file)
--- a/lib/env.c
+++ b/lib/env.c
@@ -24,6 +24,7 @@
 #include "string/strcmp/strprefix.h"
 #include "string/strdup/strdup.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index bc85128aeafe44be154bbc849962c48e273edfe2..4e458cf0b0a2e136dd5b69e122aca6106a2e82bb 100644 (file)
@@ -20,6 +20,7 @@
 #include "string/strerrno.h"
 
 
+#undef NDEBUG
 #include <assert.h>
 
 
index d616680970e183cbd9c1f847807db543bf1f6efc..beb902ed6fdfab94d75fa53d8eff3b307c005df7 100644 (file)
@@ -16,6 +16,7 @@
 #include "getdef.h"
 #include "shadowlog.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 48cfd5d93e37a1494b8349b1efccf2e8f949e50a..c9c4993d4885ba416f1bacd83d334b5260d07339 100644 (file)
@@ -16,6 +16,7 @@
 #include "getdef.h"
 #include "shadowlog.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 4c2cbedafb9aed5102c09dcfc51c2a90e464612d..9ca6953f09d1e4f318cfe838f146dfc19f9ff4df 100644 (file)
@@ -19,6 +19,7 @@
 #include "shadowlog.h"
 #include "string/strerrno.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index d98888f745093fb59cdac7cc41dcf8ed7805e60e..119afa33dfa9e90b277968f6e997a4e5f24db7bc 100644 (file)
@@ -24,6 +24,7 @@
 #include "string/sprintf/aprintf.h"
 #include "string/strcmp/streq.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 5e2cb983570f4ddbbefacd3a5cc10bf8ba84eed1..8fa0e085acdd563a0f1fc88d6b218b48ad628650 100644 (file)
@@ -16,6 +16,7 @@
 #include "string/strdup/strdup.h"
 #include "string/strtok/strsep2ls.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index c841f32a5f7d779e459d107c34224629399c5d85..0b496ca8cb8fd8c31d7f50203b866e4754255768 100644 (file)
@@ -22,6 +22,7 @@
 #include "string/strspn/stpspn.h"
 #include "string/strtok/stpsep.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 1ded0b0d8278f1ac0246b498ea59ec16f32779a2..a33fd36dbc175cace5195499ce0a19a64d52106f 100644 (file)
@@ -18,6 +18,7 @@
 #include "getdef.h"
 #include "string/sprintf/aprintf.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 45c1ef1522268169066d57fc87ded26463d29148..6a8dcd78cf9bcd1c77f65fc4f61e720333bc270b 100644 (file)
@@ -20,6 +20,7 @@
 #include "shadowlog.h"
 #include "string/memset/memzero.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index f9b63f1e67f8a756ea1e7373c998a1d1a12171da..da3ce01b8c62877dfac0473ee6669e444b5b1c11 100644 (file)
@@ -32,6 +32,7 @@
 #include "string/strcmp/strprefix.h"
 #include "string/strerrno.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 74ee98dd3b1be08cda9a46d5133c5ea827ab551e..1649ad1071831fbdb31f516ecb1a88c943d84ee3 100644 (file)
@@ -20,6 +20,7 @@
 #include "string/strcmp/strprefix.h"
 #include "string/strerrno.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 9782af065b2fbcd776cbf977a4962bda4213f57c..e662e03c17497edae0343331c9d495805c6db069 100644 (file)
@@ -25,6 +25,7 @@
 #include "shadowlog.h"
 #include "string/strcmp/streq.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index fe9a0bc254cafc598495341eaed7861b7b0a4a26..81cca2ac2348e47d5208afdfed6ef0edb107a7c5 100644 (file)
@@ -31,6 +31,7 @@
 #include "string/strspn/stpspn.h"
 #include "string/strtok/stpsep.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 8cf1e55053ad38a310c7c86deb6f096bccad0a88..97fa1427b8ea8628f54ea0f3a1d49fecc70ae434 100644 (file)
@@ -30,6 +30,7 @@
 #include "string/strcmp/strneq.h"
 #include "string/strcmp/strprefix.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index ec6b72a40b76d90787ac62c7b09024a7b9df23da..dc9870a7cff703e949d66e8cc2343af8b3a06c49 100644 (file)
@@ -39,6 +39,7 @@
 #include "string/strdup/strdup.h"
 #include "string/strdup/strndup.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 7cf6f6085d5ae50f2f96e705270b18ba7ac489d8..28cf7f58e1e4ea981798d5aad57e31eb9f830cdf 100644 (file)
@@ -29,6 +29,7 @@
 #include "string/strerrno.h"
 #include "string/strftime.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 7dd51a7e41b4d1cb0fe890d51c9aa0e8c34a3392..ae172a0b6a94975b1df4f14c19ecbfb5cd7df303 100644 (file)
@@ -35,6 +35,7 @@
 #include "string/strerrno.h"
 #include "string/strftime.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 92f3bcba9c36355b7adbedcb61ca42fc700a6bd1..1da71b104693988aa1458760cb593934d24f00e9 100644 (file)
@@ -53,6 +53,7 @@
 # include "pam_defs.h"
 #endif
 
+#undef NDEBUG
 #include <assert.h>
 
 
index d1ae7f2b28ea6de8210f91175e0dcc760a677fc5..d081cf2b5b54a907a3700b804abc9507931cac06 100644 (file)
@@ -38,6 +38,7 @@
 #include "string/strdup/strdup.h"
 #include "string/strerrno.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index ffaea232751dccbeccde371da79d341ff719efb8..93373e96a95516e75cfb9939c5fc4d8cee335a1d 100644 (file)
@@ -71,6 +71,7 @@
 #include "string/strtok/stpsep.h"
 #include "sysconf.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 29bd00fe44ba89252215dfefeeaa42898e1b8439..c1629e8fc9e13c17b46f9a4875523c23ed11eff0 100644 (file)
@@ -53,6 +53,7 @@
 #include "string/strdup/strdup.h"
 #include "string/strerrno.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index fb1cd7ce73a5da04fd3dbe6fa24177dfd44eeaae..5be0cf9906d2c80e125986aff912a772c38f8cbb 100644 (file)
@@ -69,6 +69,7 @@
 #include "time/day_to_str.h"
 #include "typetraits.h"
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 2ea06ee80eb64b6e95f1c62a1ea242415c013008..200c709bfccb4c5a22382aed89642357004e5bd8 100644 (file)
@@ -10,6 +10,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 06cdc9aaa91e4cccc11ceeae1ca0788ac7e396fe..3c596bbd7738d00ee3e37f7ae1c4b7965b40284d 100644 (file)
@@ -16,6 +16,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 1b7b9751f8f555fa3ff1d3668540eb55bdfa46b8..eeef923a62082cfe775c0e141ce9163bcd21cefa 100644 (file)
@@ -15,6 +15,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 14ae2aa780073d1dd61f089c747226bc91056f8b..c776cfaaecc54dfd8ef536cb3be1758d300d6506 100644 (file)
@@ -15,6 +15,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 25fa5ec7ffb24495930c9d592286cb6245a8cb7f..ac8e62a8aa6ffd8b7a37d34325c15f969d901a24 100644 (file)
@@ -15,6 +15,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 74ba8f27ea5d55826eeb6572387e4516c5d3fccb..6e4ad64d837d3e56f9d9c4cc3a367bf55aea1ebe 100644 (file)
@@ -16,6 +16,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
+#undef NDEBUG
 #include <assert.h>
 
 
index 92c1276f93de44aa203f6a4a3da6c8a653705800..85091e7c86765b890374569f506154ac9c6a6f1a 100644 (file)
@@ -15,6 +15,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#undef NDEBUG
 #include <assert.h>
 
 
index af734fac624eb2a1b5124e28dcfd005a8340377e..20e85ea9f8db70c7ace957baa301694351a885f7 100644 (file)
@@ -16,6 +16,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
+#undef NDEBUG
 #include <assert.h>
 
 
index c138b4ea8bd2ca80c8ca9e660fe5928150c69baa..5c981078a0da60d5c57bc0fc500c674b93f9e41d 100644 (file)
@@ -16,6 +16,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
+#undef NDEBUG
 #include <assert.h>