]>
git.ipfire.org Git - thirdparty/shadow.git/log
Alejandro Colomar [Sun, 20 Jul 2025 14:51:30 +0000 (16:51 +0200)]
lib/string/strcmp/: strneq(), STRNEQ(): Add APIs
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 5 Oct 2025 08:09:04 +0000 (10:09 +0200)]
lib/attr.h: ATTR_NONSTRING: Add attribute [[gnu::nonstring]]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 7 Aug 2025 12:24:13 +0000 (14:24 +0200)]
lib/attr.h: __has_c_attribute(): Define fallback
This allows using __has_c_attribute() in compilers that don't have it.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 4 Jul 2024 16:47:58 +0000 (18:47 +0200)]
lib/, src/: Use strncmp(3) instead of explicit byte comparisons
This is simpler to read, IMO.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sat, 9 Aug 2025 18:38:24 +0000 (20:38 +0200)]
lib/commonio.[ch]: struct commonio_ops: Add prefix 'cio_' to structure members
This structure has members that are named like libc APIs.
libc is allowed to provide any functions as macros (7.1.4p1 in C23).
This means that libc is allowed to provide a free(3) macro, which could
look like
#define free(p) __free(p)
And that would be expanded by the preprocessor in our code, turning our
structure members into some code that won't work (or even worse, it
might misbehave).
So, fix this undefined behavior.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Serge Hallyn [Sat, 18 Oct 2025 16:48:09 +0000 (11:48 -0500)]
Merge pull request #1258 from ikerexxe/useradd-chroot
src/useradd.c: chroot or prefix SELinux file context
Alejandro Colomar [Wed, 15 Oct 2025 16:01:14 +0000 (18:01 +0200)]
src/usermod.c: Remove optimizations
These optimizations checked if the old value is the same as the new
value, and skip such changes. This was unnecessary, and added
complexity to the source code.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Wed, 15 Oct 2025 16:01:14 +0000 (18:01 +0200)]
src/usermod.c: Remove 'no changes' informative output
No news is good news.
Debian needs to parse this message to ignore it, or alternatively check
if the call will be a no-op (which we already do) and skip the call.
If we remove this output, we're allowing Debian to remove that
complexity in their wrapper.
We don't expect this output to be very useful for interactive use
either.
Also, this message was changed from stderr to stdout recently, so we
don't need to worry about old scripts that might break due to this
change. If there were scripts relying on that, they would have been
broken already in the previous change.
Closes: <https://github.com/shadow-maint/shadow/issues/1361>
Reported-by: Marc Haber <githubvisible@zugschlus.de>
Cc: <https://github.com/cachius>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Iker Pedrosa [Fri, 4 Jul 2025 08:03:42 +0000 (10:03 +0200)]
man/: update `--root` flag with no SELinux support
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 12:29:55 +0000 (14:29 +0200)]
src/gpasswd.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 11:09:12 +0000 (13:09 +0200)]
src/pwunconv.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 11:08:10 +0000 (13:08 +0200)]
src/pwunconv.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 11:05:52 +0000 (13:05 +0200)]
src/pwconv.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 11:04:26 +0000 (13:04 +0200)]
src/pwconv.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 10:58:58 +0000 (12:58 +0200)]
src/pwck.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 10:55:35 +0000 (12:55 +0200)]
src/pwck.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 10:48:18 +0000 (12:48 +0200)]
src/passwd.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 10:35:44 +0000 (12:35 +0200)]
src/passwd.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 10:03:30 +0000 (12:03 +0200)]
src/chsh.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 09:59:32 +0000 (11:59 +0200)]
src/chsh.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 09:56:13 +0000 (11:56 +0200)]
src/chpasswd.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 09:52:52 +0000 (11:52 +0200)]
src/chpasswd.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 09:50:06 +0000 (11:50 +0200)]
src/chfn.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 09:45:29 +0000 (11:45 +0200)]
src/chfn.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 09:41:35 +0000 (11:41 +0200)]
src/chage.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 09:34:42 +0000 (11:34 +0200)]
src/chage.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 14:32:27 +0000 (16:32 +0200)]
src/grpunconv.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 14:30:47 +0000 (16:30 +0200)]
src/grpunconv.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 14:28:15 +0000 (16:28 +0200)]
src/grpconv.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 14:26:48 +0000 (16:26 +0200)]
src/grpconv.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 14:23:42 +0000 (16:23 +0200)]
src/grpck.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 14:17:35 +0000 (16:17 +0200)]
src/grpck.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 14:14:08 +0000 (16:14 +0200)]
src/groupmems.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 14:07:24 +0000 (16:07 +0200)]
src/groupmems.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 14:04:07 +0000 (16:04 +0200)]
src/chgpasswd.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 14:01:20 +0000 (16:01 +0200)]
src/chgpasswd.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 10:13:50 +0000 (12:13 +0200)]
src/groupdel.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Thu, 3 Jul 2025 10:10:06 +0000 (12:10 +0200)]
src/groupmod.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 20 May 2025 12:09:12 +0000 (14:09 +0200)]
src/groupadd.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Closes: https://github.com/shadow-maint/shadow/issues/940
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 20 May 2025 12:02:16 +0000 (14:02 +0200)]
lib/: add SELinux control flag in cleanup_unlock_*()
Expand cleanup_unlock_passwd(), cleanup_unlock_shadow(),
cleanup_unlock_group() and cleanup_unlock_gshadow() interfaces to add a
control flag for SELinux file context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 13:55:54 +0000 (15:55 +0200)]
src/newusers.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 13:50:17 +0000 (15:50 +0200)]
src/newusers.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 13:44:55 +0000 (15:44 +0200)]
src/userdel.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 13:37:50 +0000 (15:37 +0200)]
src/userdel.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 13:35:35 +0000 (15:35 +0200)]
src/userdel.c: replace global variable by flags structure
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 13:30:57 +0000 (15:30 +0200)]
src/usermod.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 12:53:13 +0000 (14:53 +0200)]
src/usermod.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 1 Jul 2025 11:23:08 +0000 (13:23 +0200)]
src/useradd.c: SELinux file context for fail_exit()
Do not process SELinux file context when running fail_exit() when chroot
or prefix options are selected.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Tue, 20 May 2025 10:38:16 +0000 (12:38 +0200)]
src/useradd.c: SELinux file context for home and mail
Do not process SELinux file context when creating home and mail folders
when chroot or prefix options are selected.
Closes: https://github.com/shadow-maint/shadow/issues/940
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 14:32:42 +0000 (16:32 +0200)]
src/useradd.c: chroot or prefix SELinux file context
Do not process SELinux file context during file closure when chroot or
prefix options are selected.
Closes: https://github.com/shadow-maint/shadow/issues/940
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 14:12:40 +0000 (16:12 +0200)]
lib/, src/: add SELinux control flag in sub_gid_unlock()
Expand sub_gid_unlock() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 14:10:09 +0000 (16:10 +0200)]
lib/, src/: add SELinux control flag in sub_uid_unlock()
Expand sub_uid_unlock() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 14:06:57 +0000 (16:06 +0200)]
src/vipw.c: add SELinux control flag in unlock
All unlock functions require the SELinux control flag, thus add it as an
argument.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 14:03:58 +0000 (16:03 +0200)]
lib/, src/: add SELinux control flag in sgr_unlock()
Expand sgr_unlock() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 14:00:43 +0000 (16:00 +0200)]
lib/, src/: add SELinux control flag in gr_unlock()
Expand gr_unlock() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 13:57:21 +0000 (15:57 +0200)]
lib/, src/: add SELinux control flag in spw_unlock()
Expand spw_unlock() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 13:53:17 +0000 (15:53 +0200)]
lib/, src/: add SELinux control flag in pw_unlock()
Expand pw_unlock() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 13:44:06 +0000 (15:44 +0200)]
lib/: add SELinux control flag in commonio_unlock()
Expand commonio_unlock() interface to add a control flag for SELinux
file context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 13:38:18 +0000 (15:38 +0200)]
lib/, src/: add SELinux control flag in sub_gid_close()
Expand sub_gid_close() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 13:35:48 +0000 (15:35 +0200)]
lib/, src/: add SELinux control flag in sub_uid_close()
Expand sub_uid_close() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 13:32:05 +0000 (15:32 +0200)]
lib/, src/: add SELinux control flag in sgr_close()
Expand sgr_close() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 13:28:42 +0000 (15:28 +0200)]
lib/, src/: add SELinux control flag in gr_close()
Expand gr_close() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 13:23:11 +0000 (15:23 +0200)]
lib/, src/: add SELinux control flag in spw_close()
Expand spw_close() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 13:19:29 +0000 (15:19 +0200)]
lib/, src/: add SELinux control flag in pw_close()
Expand pw_close() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Fri, 25 Apr 2025 13:13:12 +0000 (15:13 +0200)]
lib/: add SELinux control flag in commonio_close()
Expand commonio_close() interface to add a control flag for SELinux file
context processing.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Alejandro Colomar [Sun, 28 Sep 2025 08:40:09 +0000 (10:40 +0200)]
lib/: Use libc _FILE_SHADOW from <paths.h>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Mon, 24 Feb 2025 22:06:39 +0000 (23:06 +0100)]
lib/shadow/, lib/, po/: sgetspent(): Move to under lib/shadow/shadow/
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 22:31:23 +0000 (23:31 +0100)]
lib/shadow/, lib/, po/: sgetpwent(): Move to under lib/shadow/passwd/
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 22:14:28 +0000 (23:14 +0100)]
lib/shadow/, lib/, po/: sgetgrent(): Move to under lib/shadow/group/
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 22:00:19 +0000 (23:00 +0100)]
lib/: GSHADOW: Remove unused macro
And with it, the file that defines it, which does nothing else.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 18:04:06 +0000 (19:04 +0100)]
lib/shadow/, lib/: getsgent(): Move to separate file
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 17:52:57 +0000 (18:52 +0100)]
lib/shadow/, lib/, src/: getsgnam(): Move to separate file
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 17:44:05 +0000 (18:44 +0100)]
lib/shadow/, lib/: sgetsgent(): Move to separate file
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 17:18:19 +0000 (18:18 +0100)]
lib/shadow/, lib/: fgetsgent(): Move to separate file
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 17:07:59 +0000 (18:07 +0100)]
lib/shadow/, lib/, src/: struct sgrp: Move to separate file
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 16:44:23 +0000 (17:44 +0100)]
lib/shadow/, lib/: setsgent(): Move to separate file
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 16:36:44 +0000 (17:36 +0100)]
lib/shadow/, lib/, src/: Use _PATH_GSHADOW from <paths.h>
This macro is provided by glibc (but not musl) as _PATH_GSHADOW in
<paths.h>. Let's use that macro, and define it only if libc doesn't
provide it.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 15:48:15 +0000 (16:48 +0100)]
lib/shadow/, lib/, src/: endsgent(): Move to separate file
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 15:22:12 +0000 (16:22 +0100)]
lib/shadow/, lib/: gshadow: Move to separate file and rename
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 10 Nov 2024 14:27:43 +0000 (15:27 +0100)]
lib/shadow/, lib/: putsgent(): Move to separate file
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alexey Tikhonov [Fri, 3 Oct 2025 14:52:38 +0000 (16:52 +0200)]
pwck/grpck: only force nscd/sssd caches flush if anything was changed
Alexey Tikhonov [Fri, 3 Oct 2025 14:46:49 +0000 (16:46 +0200)]
Make sure 'sss_cache' can get both 'U' and 'G' args
Fixes: 59e5eef38f89 (2024-07-03; "contrib, lib/, src/, tests/: Use stpcpy(3) instead of its pattern")
Reviewed-by: Alejandro Colomar <alx@kernel.org>
Frans Spiesschaert [Fri, 3 Oct 2025 09:03:20 +0000 (11:03 +0200)]
po/nl.po: Update
Closes: <https://github.com/shadow-maint/shadow/issues/1360>
Signed-off-by: Frans Spiesschaert <Frans.Spiesschaert@yucom.be>
Cc: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Tue, 19 Aug 2025 21:18:57 +0000 (23:18 +0200)]
lib/string/README: Add guidelines for using strings
Suggested-by: Iker Pedrosa <ipedrosa@redhat.com>
Suggested-by: Serge Hallyn <serge@hallyn.com>
Suggested-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Suggested-by: Lukas Slebodnik <lslebodn@fedoraproject.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 4 Jul 2024 17:00:53 +0000 (19:00 +0200)]
lib/, src/: Use consistent style using strchr(3) in conditionals
While the return value is a pointer, it can be interpreted as a boolean
value meaning "found". In general, we use explicit comparisons of
pointers to NULL, but in this specific case, let's use that
interpretation, and make an exception, using an implicit conversion to
boolean.
For negative matches, use
if (!strchr(...))
For positive matches, use
if (strchr(...))
For positive matches, when a variable is also set, use
while (NULL != (p = strchr(...)))
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 31 Aug 2025 11:57:22 +0000 (13:57 +0200)]
configure.ac, lib/: Use _PATH_WTMP from <paths.h>
That's the libc macro for this file.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 31 Aug 2025 11:53:54 +0000 (13:53 +0200)]
configure.ac, lib/, src/: Use _PATH_LASTLOG from <paths.h>
That's the libc macro for this file.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Anders Blomdell [Tue, 2 Sep 2025 09:51:14 +0000 (11:51 +0200)]
When using nss-module, avoid using '/etc/sub[ug]id'
Use 'want_sub[ug]id_file' to short-circuit acess to '/etc/sub[ug]id' when
nss-moduleis active
Anders Blomdell [Tue, 2 Sep 2025 09:45:37 +0000 (11:45 +0200)]
Factor out 'want_sub[ug]ids' and rename to 'want_sub[ug]id_file'
Move 'want_sub[ug]ids' from 'src/newusers.c' to 'lib/subordinateio.[ch]'
and rename them to 'want_sub[ug]id_file' to clearly indicate that it
refers to the '/etc/sub[ug]id' and not to subids in general.
Alejandro Colomar [Tue, 22 Jul 2025 23:21:38 +0000 (01:21 +0200)]
src/su.c: Fix incorrect (non-matching) parentheses
Fixes: 45c6603cc86c (2007-10-07; "[svn-upgrade] Integrating new upstream version, shadow (19990709)")
Closes: <https://github.com/shadow-maint/shadow/issues/1310>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Iker Pedrosa [Mon, 1 Sep 2025 17:02:20 +0000 (19:02 +0200)]
.github/workflows/static-code-analysis.yml: add Python linters
Add flake8, pycodestyle, isort, black and mypy in CI for Python linting.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Mon, 1 Sep 2025 13:12:14 +0000 (15:12 +0200)]
tests/system/tests/: fix Python linter issues
Fix issues reported by flake8, pycodestyle, isort, black and mypy.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Mon, 1 Sep 2025 13:08:53 +0000 (15:08 +0200)]
tests/system/framework/: fix Python linter issues
Fix issues reported by flake8, pycodestyle, isort, black and mypy.
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Iker Pedrosa [Mon, 1 Sep 2025 13:02:17 +0000 (15:02 +0200)]
tests/system/pyproject.toml: add mypy rules
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Georg Pfuetzenreuter [Mon, 25 Aug 2025 18:59:55 +0000 (20:59 +0200)]
man/chsh: deduplicate shells text
Restructure the paragraphs to avoid duplication of text inside multiple
conditions, making maintenance easier and avoiding accidental
duplication in the rendered output.
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Georg Pfuetzenreuter [Sun, 24 Aug 2025 21:20:47 +0000 (23:20 +0200)]
man/chsh: remove duplicate paragraph
The section about the risk of placing a restricted shell was duplicated
in the rendered manual page if the "without_vendordir" condition
matched.
Fixes: a27d5c51f1f3 ("Supporting vendor given -shells- configuration file")
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Alejandro Colomar [Sun, 24 Aug 2025 07:29:33 +0000 (09:29 +0200)]
lib/subordinateio.c: list_owner_ranges(): Fix duplicate range when username matches ID
Fixes: 3ec32f9975f2 (2022-07-20; "subordinateio: also compare the owner ID")
Closes: <https://github.com/shadow-maint/shadow/issues/1339>
Link: <https://github.com/cri-o/cri-o/issues/9416>
Reported-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Iker Pedrosa [Mon, 18 Aug 2025 08:38:33 +0000 (10:38 +0200)]
share/ansible/: fix Debian 13 build
Install `gpg` package as Debian 13 container image stopped installing it
by default, making the CI fail.
Closes: <https://github.com/shadow-maint/shadow/issues/1335>
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Evgeny Grin (Karlson2k) [Mon, 11 Aug 2025 00:50:30 +0000 (02:50 +0200)]
lib/utmp.c: Add explicit include <stdlib.h> for free() and other functions
Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Evgeny Grin (Karlson2k) [Sun, 10 Aug 2025 13:31:01 +0000 (15:31 +0200)]
lib/utmp.c: Add ATTR_MALLOC(free) attribute
Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>