]>
git.ipfire.org Git - thirdparty/shadow.git/log
Alejandro Colomar [Tue, 14 Oct 2025 10:49:08 +0000 (12:49 +0200)]
*/: s/SNPRINTF/stprintf_a/
This name better reflects that it handles arrays, and doesn't shout.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Tue, 14 Oct 2025 10:40:46 +0000 (12:40 +0200)]
*/: s/STRNDUP/strndup_a/ s/XSTRNDUP/xstrndup_a/
This name better reflects that it handles arrays, and doesn't shout.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Tue, 14 Oct 2025 10:37:25 +0000 (12:37 +0200)]
*/: s/STRNDUPA/strndupa_a/
This name better reflects that it handles arrays, and doesn't shout.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Tue, 14 Oct 2025 10:35:31 +0000 (12:35 +0200)]
*/: s/SIZEOF_ARRAY/sizeof_a/
This name better reflects that it handles arrays, and doesn't shout.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Tue, 14 Oct 2025 10:32:35 +0000 (12:32 +0200)]
*/: s/READLINKNUL/readlinknul_a/
This name better reflects that it handles arrays, and doesn't shout.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 7 Aug 2025 12:39:28 +0000 (14:39 +0200)]
src/: usage(): Use [[noreturn]]
This silences false-positive diagnostics in Clang.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 7 Aug 2025 12:35:01 +0000 (14:35 +0200)]
lib/attr.h: ATTR_STRING(): Use it also with Clang
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 7 Aug 2025 12:34:14 +0000 (14:34 +0200)]
lib/attr.h: ATTR_ALLOC_SIZE(): Use it also with Clang
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 7 Aug 2025 12:33:40 +0000 (14:33 +0200)]
lib/attr.h: ATTR_ACCESS(): Use it also with Clang
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 7 Aug 2025 12:32:11 +0000 (14:32 +0200)]
lib/attr.h: format_attr(): Use it also with Clang
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 7 Aug 2025 12:29:43 +0000 (14:29 +0200)]
lib/attr.h: NORETURN: Implement with [[noreturn]]
This is a C23 standard attribute with the same semantics.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 7 Aug 2025 12:28:22 +0000 (14:28 +0200)]
lib/attr.h: MAYBE_UNUSED: Implement with [[maybe_unused]]
This is a C23 standard attribute with the same semantics.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Fri, 17 Oct 2025 00:02:56 +0000 (02:02 +0200)]
lib/atoi/, */: Move all str2i() macros together with a2i()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 16 Oct 2025 23:48:58 +0000 (01:48 +0200)]
lib/atoi/, */: Move all a2i() macros to the same file
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 16 Oct 2025 23:36:03 +0000 (01:36 +0200)]
lib/atoi/: a2i(): Re-implement with a statement expression
Synopsis
int a2i(typename T, T *restrict n, QChar *s,
QChar **_Nullable restrict endp, int base,
T min, T max);
Description
This macro converts the initial portion of the string pointed to
by 's' to an integer of base 'base', ensure that the number is
in the range [min, max], and store it in *n.
It is similar to NetBSD's strtoi(3) and strtou(3), which
themselves are similar to strtol(3) and strtoul(3).
Arguments
T
The integer type used for the number.
n
A pointer to an integer. The parsed number will be
stored there.
s
See strtol(3).
endp
See strtol(3). A difference with strtol(3) is that this
macro is const-correct. If 's' has type 'const char *',
then 'endp' must have type 'const char **', whereas if
's' has type 'char *', 'endp' must have type 'char **'.
base
See strtol(3).
min
max
See strtoi(3) and strtou(3).
An important difference with NetBSD's strtou(3) is that
a2i() (with an unsigned type T) doesn't intepret any
negative numbers as if they were large positive numbers.
a2i() respects the limits [min, max] as one would
intuitively expect.
Return value
On success, 0 is returned.
On error, -1 is returned and errno is set to indicate the error.
Errors
See strtoi(3) and strtou(3).
Examples
if (a2i(pid_t, &pid, s, &s, 10, 1, _Maxof(pid_t)) == -1)
goto err;
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 19 Oct 2025 08:10:37 +0000 (10:10 +0200)]
lib/typetraits.h: QChar_of(): Add macro
This macro is useful to implement QChar versions of functions.
See ISO C23 for a description of what QChar is.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
sgakerru [Tue, 11 Nov 2025 20:22:41 +0000 (00:22 +0400)]
useradd: tests for supplements groups
For regular and system user cases
sgakerru [Tue, 11 Nov 2025 20:22:06 +0000 (00:22 +0400)]
useradd: fix test `69_useradd_default_GROUPS_name`
Missing files have been added for the test to work: `gshadow`, `passwd`, `shadow`.
Without them, the foo user was created with a different UID and thus the test failed.
And other minor improvements, such as removing extra spaces and adding empty lines.
sgakerru [Tue, 11 Nov 2025 15:52:11 +0000 (19:52 +0400)]
src/useradd.c: Do not automatically add supplements groups for system users
sgakerru [Tue, 17 Dec 2024 15:18:38 +0000 (19:18 +0400)]
src/useradd.c: Use free_list() to free user groups list
sgakerru [Tue, 17 Dec 2024 15:10:13 +0000 (19:10 +0400)]
lib/list.c: free_list(): Add function
akshay [Mon, 17 Nov 2025 16:04:53 +0000 (21:34 +0530)]
groupadd: clarify -U option help text
Align wording with groupmod to reduce ambiguity in -U option description.
Alejandro Colomar [Tue, 4 Nov 2025 12:37:26 +0000 (13:37 +0100)]
tests/unit/test_exit_if_null.c: Test through XMALLOC() instead of xaprintf()
Both are indirect tests for exit_if_null(), but through XMALLOC() we
can test it more robustly, as we don't need to wrap vasprintf(3) to
make it fail. It's trivial to make MALLOC(3) fail: pass a huge size.
The tests with xaprintf() were failing on Nix. I suspect the compiler
was inlining aggressively, and as a result, the interposition of
vasprintf(3) in cmocka wasn't actually working. The approach with
XMALLOC() seems to work on Nix, as we don't need to interpose malloc(3).
We still need to interpose exit(3), but for some reason that works fine.
Closes: <https://github.com/shadow-maint/shadow/issues/1382>
Reported-by: Silvan Mosberger <github@infinisil.com>
Tested-by: Silvan Mosberger <github@infinisil.com>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Tue, 4 Nov 2025 12:46:01 +0000 (13:46 +0100)]
tests/unit/: Use more generic strings and names for testing exit_if_null()
This test is actually for exit_if_null(), not xaprintf(). Rename the
test file and functions, and make strings more generic.
Tested-by: Silvan Mosberger <github@infinisil.com>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Fri, 21 Feb 2025 05:37:24 +0000 (06:37 +0100)]
lib/, src/: Remove unused parameter $2 of audit_logger()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Mon, 6 Oct 2025 08:57:34 +0000 (10:57 +0200)]
lib/defines.h: LOG_NOWAIT: Remove unused macro
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Mon, 6 Oct 2025 08:53:19 +0000 (10:53 +0200)]
lib/defines.h: NGROUPS_MAX: Remove unused macro
BTW, it's already defined in <limits.h>, so even if we used it,
we shouldn't define it here.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Fri, 21 Feb 2025 06:45:33 +0000 (07:45 +0100)]
lib/, src/: Remove unused parameter $3 of passwd_check()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Fri, 21 Feb 2025 06:39:15 +0000 (07:39 +0100)]
lib/obscure.c: Remove unused parameter $1 of palindrome()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Fri, 21 Feb 2025 06:36:53 +0000 (07:36 +0100)]
lib/: Remove unused parameter $3 of password_check() and propagate
Propagate the removal of dead code to its callers, which were only
passing the parameter to this function.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Fri, 21 Feb 2025 05:41:48 +0000 (06:41 +0100)]
lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Fri, 21 Feb 2025 05:40:22 +0000 (06:40 +0100)]
lib/copydir.c: Remove unused parameter $3 of copy_symlink()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 20 Feb 2025 16:46:23 +0000 (17:46 +0100)]
src/gpasswd.c: Remove unused parameter $1 of check_perms()
Fixes: 53e1eb404541 (2024-07-01; "src/: Remove dead code")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Thu, 20 Feb 2025 16:37:56 +0000 (17:37 +0100)]
src/useradd.c: Remove unused variable
Fixes: d91b22cc2f6d (2024-07-08; "lib/, src/: Use stpsep() instead of its pattern")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Tue, 22 Jul 2025 21:18:48 +0000 (23:18 +0200)]
lib/, src/: Use strerrno() instead of its pattern
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Tue, 22 Jul 2025 20:14:08 +0000 (22:14 +0200)]
lib/string/: strerrno(): Add macro
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Wed, 23 Jul 2025 20:50:51 +0000 (22:50 +0200)]
lib/getdef.h: Add missing includes
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Fri, 24 Oct 2025 10:09:55 +0000 (12:09 +0200)]
lib/utmp.c: ttyname_ra(): Add macro
And use it instead of its pattern.
This macro enforces correct use of ttyname_r(3) with arrays.
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Fri, 24 Oct 2025 09:55:06 +0000 (11:55 +0200)]
lib/utmp.c: is_my_tty(): Use ttyname_r(3) to make it re-entrant
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Fri, 24 Oct 2025 10:03:41 +0000 (12:03 +0200)]
lib/utmp.c: is_my_tty(): Rename local variable
This name makes the function definition more readable.
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Fri, 24 Oct 2025 10:22:24 +0000 (12:22 +0200)]
lib/utmp.c: is_my_tty(): Don't cache ttyname(3).
The method for checking for truncation was quite weird. By not caching
ttyname(3), we use it directly, without needing a temporary copy, which
removes opportunities for bugs.
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Wed, 1 Jan 2025 23:12:51 +0000 (00:12 +0100)]
lib/, src/, tests/: Move x*() definitions to non-x* header files
Now that all of these are one-liners, they don't need a separate header
file. Compact stuff.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sat, 7 Jun 2025 17:29:10 +0000 (19:29 +0200)]
lib/string/strtok/: xastrsep2ls() Reimplement in terms of exit_if_null()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Tue, 27 May 2025 08:48:28 +0000 (10:48 +0200)]
lib/string/strdup/xstrndup.h: Add STRNDUP()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Wed, 1 Jan 2025 22:24:57 +0000 (23:24 +0100)]
lib/string/strdup/: XSTRNDUP(): Reimplement in terms of exit_if_null()
This is much simpler.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 8 Dec 2024 11:21:06 +0000 (12:21 +0100)]
lib/string/sprintf/, tests/: xaprintf(): Reimplement in terms of exit_if_null()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 8 Dec 2024 11:09:15 +0000 (12:09 +0100)]
lib/alloc/x/: X*ALLOC(): Reimplement in terms of exit_if_null()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 8 Dec 2024 11:04:11 +0000 (12:04 +0100)]
lib/string/strdup/: xstrdup(): Reimplement xstrdup() in terms of exit_if_null()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Tue, 5 Dec 2023 12:46:23 +0000 (13:46 +0100)]
lib/: exit_if_null(): Add macro to exit(3) on error
Writing an x*() variant function of several functions is unnecessary.
It's simpler to write a generic exit_if_null() macro that can be chained
with any other calls. With such a macro, the x*() variants can be
implemented as one-liner macros that are much easier to read:
For example:
#define xmalloc(size) exit_if_null(malloc(size))
If an error is detected, log an error, and exit(13). About why 13, I
don't really know. It's just what was used previously in xmalloc().
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alejandro Colomar [Sun, 20 Jul 2025 15:02:17 +0000 (17:02 +0200)]
lib/, src/: Use STRNEQ() instead of their pattern
Signed-off-by: Alejandro Colomar <alx@kernel.org>
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>