]> git.ipfire.org Git - thirdparty/shadow.git/log
thirdparty/shadow.git
10 months agoconfigure.ac: release 4.16.0 4.16.0
Serge Hallyn [Tue, 18 Jun 2024 21:34:10 +0000 (16:34 -0500)] 
configure.ac: release 4.16.0

Signed-off-by: Serge Hallyn <serge@hallyn.com>
10 months agorelease 4.16.0-rc1 4.16.0-rc1
Serge Hallyn [Thu, 13 Jun 2024 23:09:08 +0000 (18:09 -0500)] 
release 4.16.0-rc1

Signed-off-by: Serge Hallyn <serge@hallyn.com>
10 months agoconfigure.ac: specify tar-pax to avoid 99 char filename limit
Serge Hallyn [Fri, 14 Jun 2024 00:56:48 +0000 (19:56 -0500)] 
configure.ac: specify tar-pax to avoid 99 char filename limit

Signed-off-by: Serge Hallyn <serge@hallyn.com>
10 months agoRemove support for rlogind in login(1), that is, remove the '-r' flag
Alejandro Colomar [Fri, 17 May 2024 23:57:40 +0000 (01:57 +0200)] 
Remove support for rlogind in login(1), that is, remove the '-r' flag

The "quick hack" finally disappeared.  Probably nobody noticed.  ;)
(See the changes in <configure.ac> for the context of this pun.)

Probably everybody uses SSH these days for remote login.  Let's remove
this insecure method.

Closes: <https://github.com/shadow-maint/shadow/issues/992>
Reviewed-by: dkwo <nicolopiazzalunga@gmail.com>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Michael Vetter <jubalh@iodoru.org>
Cc: Sam James <sam@gentoo.org>
Cc: Benedikt Brinkmann <datacobra@thinkbot.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
10 months agolibsubid: Fix code style issues
Daniel Bershatsky [Wed, 12 Jun 2024 19:25:11 +0000 (22:25 +0300)] 
libsubid: Fix code style issues

10 months agolibsubid: Fail on plugin loading if no subid_free provided
Daniel Bershatsky [Wed, 12 Jun 2024 17:07:23 +0000 (20:07 +0300)] 
libsubid: Fail on plugin loading if no subid_free provided

10 months agolibsubid: Apply minor fixes
Daniel Bershatsky [Wed, 12 Jun 2024 14:38:43 +0000 (17:38 +0300)] 
libsubid: Apply minor fixes

10 months agolibsubid: Add routine to free allocated memory
Daniel Bershatsky [Mon, 10 Jun 2024 22:12:45 +0000 (01:12 +0300)] 
libsubid: Add routine to free allocated memory

10 months agolibsubid: Dealocate memory on exit
Daniel Bershatsky [Wed, 12 Jun 2024 16:26:45 +0000 (19:26 +0300)] 
libsubid: Dealocate memory on exit

11 months agosrc/groupmod.c: delete gr_free_members(&grp) to avoid double free
lixinyun [Tue, 28 May 2024 22:53:02 +0000 (06:53 +0800)] 
src/groupmod.c: delete gr_free_members(&grp) to avoid double free

Groupmod -U may cause crashes because of double free. If without -a, the first free of (*ogrp).gr_mem is in gr_free_members(&grp), and then in gr_update without -n or gr_remove with -n.
Considering the minimal impact of modifications on existing code, delete gr_free_members(&grp) to avoid double free.Although this may seem reckless, the second free in two different positions will definitely be triggered, and the following two test cases can be used to illustrate the situation :

[root@localhost src]# ./useradd u1
[root@localhost src]# ./useradd u2
[root@localhost src]# ./useradd u3
[root@localhost src]# ./groupadd -U u1,u2,u3 g1
[root@localhost src]# ./groupmod -n g2 -U u1,u2 g1
Segmentation fault

This case would free (*ogrp).gr_mem in gr_free_members(&grp) due to assignment statements grp = *ogrp, then in if (nflg && (gr_remove (group_name) == 0)), which finally calls gr_free_members(grent) to free (*ogrp).gr_mem again.

[root@localhost src]# ./useradd u1
[root@localhost src]# ./useradd u2
[root@localhost src]# ./useradd u3
[root@localhost src]# ./groupadd -U u1,u2,u3 g1
[root@localhost src]# ./groupmod -U u1,u2 g1
Segmentation fault

The other case would free (*ogrp).gr_mem in gr_free_members(&grp) too, then in if (gr_update (&grp) == 0), which finally calls gr_free_members(grent) too to free (*ogrp).gr_mem again.

So the first free is unnecessary, maybe we can drop it.

Fixes: 342c934a3590 ("add -U option to groupadd and groupmod")
Closes: <https://github.com/shadow-maint/shadow/issues/1013>
Link: <https://github.com/shadow-maint/shadow/pull/1007>
Link: <https://github.com/shadow-maint/shadow/pull/271>
Link: <https://github.com/shadow-maint/shadow/issues/265>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: lixinyun <li.xinyun@h3c.com>
11 months agoman/lastlog: remove wrong use of keyword term
Serge Hallyn [Wed, 5 Jun 2024 13:02:27 +0000 (08:02 -0500)] 
man/lastlog: remove wrong use of keyword term

Per https://tdg.docbook.org/tdg/4.5/term, term is a word being
defined in a varlistentry.  The 'high uid' description is not a
varlistentry, so <term> and </term> show up in the processed
manpage.  See debian Bug#1072297.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
11 months agolib/cast.h: const_cast(): Reimplement with _Generic(3)
Alejandro Colomar [Wed, 15 May 2024 11:19:43 +0000 (13:19 +0200)] 
lib/cast.h: const_cast(): Reimplement with _Generic(3)

This makes it much simpler and portable.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoconfigure: move cmocka library detection
Iker Pedrosa [Mon, 27 May 2024 13:33:45 +0000 (15:33 +0200)] 
configure: move cmocka library detection

`PKG_CONFIG` variable needs to be set for `PKG_CHECK_MODULES` to
succeed, but this wasn't happening in Fedora because the first
appearance of `PKG_CHECK_MODULES` was conditionally skipped because this
distribution is compiled without `libbsd` support. Thus, moving the
cmocka library detection before libbsd fixes the problem.

Suggested-by: Lukas Slebodnik <lslebodn@fedoraproject.org>
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
11 months agotests: add the tests/ subdirectory to dist tarball
Serge Hallyn [Tue, 28 May 2024 18:25:49 +0000 (13:25 -0500)] 
tests: add the tests/ subdirectory to dist tarball

This is a first step to helping distributions to use our tests in CI.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
11 months agolib/atoi/strtou_noneg.[ch], tests/: strtoul_noneg(): Remove unused function
Alejandro Colomar [Tue, 9 Jan 2024 14:00:15 +0000 (15:00 +0100)] 
lib/atoi/strtou_noneg.[ch], tests/: strtoul_noneg(): Remove unused function

All call sites have been replaced by functions from "atoi/a2i.h" and
"atoi/str2i.h" recently.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/check_subid_range.c: Call str2ul() instead of strtoul_noneg()
Alejandro Colomar [Tue, 9 Jan 2024 13:53:59 +0000 (14:53 +0100)] 
src/check_subid_range.c: Call str2ul() instead of strtoul_noneg()

It is a simpler call, with more type safety.

A consequence of this change is that the program now accepts numbers in
bases 8 and 16.  That's not a problem here, I think.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolib/atoi/strtou_noneg.[ch], tests/: strtoull_noneg(): Remove unused function
Alejandro Colomar [Tue, 9 Jan 2024 13:49:34 +0000 (14:49 +0100)] 
lib/atoi/strtou_noneg.[ch], tests/: strtoull_noneg(): Remove unused function

All call sites were replaced by a2i() recently.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolib/gettime.c: gettime(): Call a2i() instead of strtoull_noneg()
Alejandro Colomar [Sat, 6 Jan 2024 22:15:06 +0000 (23:15 +0100)] 
lib/gettime.c: gettime(): Call a2i() instead of strtoull_noneg()

time_t isn't necessarily unsigned (in fact, it's likely to be signed.
Therefore, parse the number as the right type, via a2i(time_t, ...).

Still, reject negative numbers, just to be cautious.  It was done
before (strtoull_noneg()), so it shouldn't be a problem.  (However,
strtoull_noneg() was only introduced recently, and before that we called
strtoull(3), which silently accepted negative values.)

Remove the limitation of ULONG_MAX, which seems arbitrary.  It probably
was written in times where 'time_t' had the same length of 'long', and
this was thus a test that the value didn't overflow 'time_t'.  Such a
test is implicit in the a2i() call, so forget about it.

Unify the error messages into a single one that provides all the info
(except the value of 'fallback').

Link: <https://github.com/shadow-maint/shadow/commit/cb610d54b47ea2fc3da5a1b7c5a71274ada91371#r136407772>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Chris Lamb <lamby@debian.org>
Cc: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoSTABLE.md: 4.15.x is now stable
Tianyu Chen [Wed, 22 May 2024 12:23:04 +0000 (20:23 +0800)] 
STABLE.md: 4.15.x is now stable

11 months agosrc/login.c: main(): Use login_name_max_size()
Alejandro Colomar [Mon, 13 May 2024 23:13:18 +0000 (01:13 +0200)] 
src/login.c: main(): Use login_name_max_size()

Instead of raw sysconf(_SC_LOGIN_NAME_MAX) calls, which was being used
without error handling.

Fixes: 3b7cc053872c ("lib: replace `USER_NAME_MAX_LENGTH` macro")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolib/chkname.[ch]: login_name_max_size(): Add function
Alejandro Colomar [Fri, 10 May 2024 23:34:05 +0000 (01:34 +0200)] 
lib/chkname.[ch]: login_name_max_size(): Add function

It encapsulates some logic that we may want to reuse elsewhere.

Link: <https://github.com/shadow-maint/shadow/pull/989>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolib/chkname.[ch]: Fix includes
Alejandro Colomar [Fri, 10 May 2024 23:41:52 +0000 (01:41 +0200)] 
lib/chkname.[ch]: Fix includes

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/usermod.c: update_gshadow(): Add helper function
Alejandro Colomar [Fri, 17 May 2024 00:29:46 +0000 (02:29 +0200)] 
src/usermod.c: update_gshadow(): Add helper function

Keep the while loop in the outer function, and move the iteration code
to this new helper.  This makes it a bit more readable.

Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/usermod.c: update_group(): Add helper function
Alejandro Colomar [Thu, 16 May 2024 12:12:09 +0000 (14:12 +0200)] 
src/usermod.c: update_group(): Add helper function

Keep the while loop in the outer function, and move the iteration code
to this new helper.  This makes it a bit more readable.

Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/usermod.c: update_gshadow_file(): Reduce scope of local variable
Alejandro Colomar [Fri, 17 May 2024 00:19:46 +0000 (02:19 +0200)] 
src/usermod.c: update_gshadow_file(): Reduce scope of local variable

After _every_ iteration, 'changed' is always 'false'.  We don't need to
have it outside of the loop.

See:

$ grepc update_gshadow_file . \
| grep -e changed -e goto -e continue -e break -e free_ngrp -e '{' -e '}' \
| pcre2grep -v -M '{\n\t*}';
{
bool               changed;
changed = false;
while ((sgrp = sgr_next ()) != NULL) {
if (!was_member && !was_admin && !is_member) {
continue;
}
if (was_admin && lflg) {
changed = true;
}
if (was_member) {
if ((!Gflg) || is_member) {
if (lflg) {
changed = true;
}
} else {
changed = true;
}
} else if (is_member) {
changed = true;
}
if (!changed)
goto free_nsgrp;
changed = false;
}
}

This was already true in the commit that introduced the code:

$ git show 45c6603cc:src/usermod.c \
| grepc update_gshadow \
| grep -e changed -e goto -e break -e continue -e '\<if\>' -e '{' -e '}' \
| pcre2grep -v -M '{\n\t*}';
{
int changed;
changed = 0;
while ((sgrp = sgr_next())) {
 * See if the user was a member of this group
 * See if the user was an administrator of this group
 * See if the user specified this group as one of their
if (!was_member && !was_admin && !is_member)
continue;
if (was_admin && lflg) {
changed = 1;
}
if (was_member && (!Gflg || is_member)) {
if (lflg) {
changed = 1;
}
} else if (was_member && Gflg && !is_member) {
changed = 1;
} else if (!was_member && Gflg && is_member) {
changed = 1;
}
if (!changed)
continue;
changed = 0;
}
}

Fixes: 45c6603cc86c ("[svn-upgrade] Integrating new upstream version, shadow (19990709)")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/usermod.c: update_group_file(): Reduce scope of local variable
Alejandro Colomar [Thu, 16 May 2024 12:02:54 +0000 (14:02 +0200)] 
src/usermod.c: update_group_file(): Reduce scope of local variable

After _every_ iteration, 'changed' is always 'false'.  We don't need to
have it outside of the loop.

See:

$ grepc update_group_file . \
| grep -e changed -e goto -e continue -e break -e free_ngrp -e '{' -e '}' \
| pcre2grep -v -M '{\n\t*}';
{
bool                changed;
changed = false;
while ((grp = gr_next ()) != NULL) {
if (!was_member && !is_member) {
continue;
}
if (was_member) {
if ((!Gflg) || is_member) {
if (lflg) {
changed = true;
}
} else {
changed = true;
}
} else if (is_member) {
changed = true;
}
if (!changed)
goto free_ngrp;
changed = false;
free_ngrp:
}
}

This was already true in the commit that introduced the code:

$ git show 45c6603cc:src/usermod.c \
| grepc update_group \
| grep -e changed -e goto -e break -e continue -e '\<if\>' -e '{' -e '}' \
| pcre2grep -v -M '{\n\t*}';
{
int changed;
changed = 0;
while ((grp = gr_next())) {
 * See if the user specified this group as one of their
if (!was_member && !is_member)
continue;
if (was_member && (!Gflg || is_member)) {
if (lflg) {
changed = 1;
}
} else if (was_member && Gflg && !is_member) {
changed = 1;
} else if (!was_member && Gflg && is_member) {
changed = 1;
}
if (!changed)
continue;
changed = 0;
}
}

Fixes: 45c6603cc86c ("[svn-upgrade] Integrating new upstream version, shadow (19990709)")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/usermod.c: update_gshadow_file(): Fix RESOURCE_LEAK (CWE-772)
Alejandro Colomar [Fri, 17 May 2024 00:15:15 +0000 (02:15 +0200)] 
src/usermod.c: update_gshadow_file(): Fix RESOURCE_LEAK (CWE-772)

Report:
> shadow-4.15.0/src/usermod.c:864:3: alloc_fn: Storage is returned from allocation function "__sgr_dup".
> shadow-4.15.0/src/usermod.c:864:3: var_assign: Assigning: "nsgrp" = storage returned from "__sgr_dup(sgrp)".
> shadow-4.15.0/src/usermod.c:964:1: leaked_storage: Variable "nsgrp" going out of scope leaks the storage it points to.
> 962|                   free (nsgrp);
> 963|           }
> 964|-> }
> 965|   #endif                                /* SHADOWGRP */
> 966|

Link: https://issues.redhat.com/browse/RHEL-35383
Reported-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/usermod.c: update_group_file(): Fix RESOURCE_LEAK (CWE-772)
Alejandro Colomar [Thu, 16 May 2024 11:54:06 +0000 (13:54 +0200)] 
src/usermod.c: update_group_file(): Fix RESOURCE_LEAK (CWE-772)

Report:
> shadow-4.15.0/src/usermod.c:734:3: alloc_fn: Storage is returned from allocation function "__gr_dup".
> shadow-4.15.0/src/usermod.c:734:3: var_assign: Assigning: "ngrp" = storage returned from "__gr_dup(grp)".
> shadow-4.15.0/src/usermod.c:815:1: leaked_storage: Variable "ngrp" going out of scope leaks the storage it points to.
> 813|                   gr_free(ngrp);
> 814|           }
> 815|-> }
> 816|
> 817|   #ifdef SHADOWGRP

Link: https://issues.redhat.com/browse/RHEL-35383
Reported-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/usermod.c: Rename update_gshadow() => update_gshadow_file()
Alejandro Colomar [Fri, 17 May 2024 00:11:22 +0000 (02:11 +0200)] 
src/usermod.c: Rename update_gshadow() => update_gshadow_file()

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/usermod.c: Rename update_group() => update_group_file()
Alejandro Colomar [Thu, 16 May 2024 11:49:34 +0000 (13:49 +0200)] 
src/usermod.c: Rename update_group() => update_group_file()

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/usermod.c: Reduce scope of local variables
Alejandro Colomar [Thu, 16 May 2024 11:52:15 +0000 (13:52 +0200)] 
src/usermod.c: Reduce scope of local variables

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/useradd.c: set_defaults(): Fix FILE* leak
Alejandro Colomar [Fri, 17 May 2024 11:52:07 +0000 (13:52 +0200)] 
src/useradd.c: set_defaults(): Fix FILE* leak

Report:
> shadow-4.15.0/src/useradd.c:575:2: alloc_fn: Storage is returned from allocation function "fdopen".
> shadow-4.15.0/src/useradd.c:575:2: var_assign: Assigning: "ofp" = storage returned from "fdopen(ofd, "w")".
> shadow-4.15.0/src/useradd.c:734:2: leaked_storage: Variable "ofp" going out of scope leaks the storage it points to.
> 732|           }
> 733|
> 734|->         return ret;
> 735|   }
> 736|

Link: <https://issues.redhat.com/browse/RHEL-35383>
Reported-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/useradd.c: Add fmkstemp() to fix file-descriptor leak
Alejandro Colomar [Fri, 17 May 2024 11:40:58 +0000 (13:40 +0200)] 
src/useradd.c: Add fmkstemp() to fix file-descriptor leak

This function creates a temporary file, and returns a FILE pointer to
it.  This avoids dealing with both a file descriptor and a FILE pointer,
and correctly deallocating the resources on error.

The code before this patch was leaking the file descriptor if fdopen(3)
failed.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/useradd.c: De-duplicate code
Alejandro Colomar [Fri, 17 May 2024 11:14:31 +0000 (13:14 +0200)] 
src/useradd.c: De-duplicate code

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/useradd.c: set_defaults(): Do not free(3) the result of asprintf(3) if it failed
Alejandro Colomar [Fri, 17 May 2024 11:10:46 +0000 (13:10 +0200)] 
src/useradd.c: set_defaults(): Do not free(3) the result of asprintf(3) if it failed

See asprintf(3):

RETURN VALUE
     When successful,  these  functions  return  the  number  of  bytes
     printed, just like sprintf(3).  If memory allocation wasn’t possi‐
     ble,  or  some other error occurs, these functions will return -1,
     and the contents of strp are undefined.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/useradd.c: set_defaults(): Rename goto label
Alejandro Colomar [Fri, 17 May 2024 12:28:50 +0000 (14:28 +0200)] 
src/useradd.c: set_defaults(): Rename goto label

This will help add other labels in the following commits.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosrc/useradd.c: set_defaults(): Fix order of clean-ups
Alejandro Colomar [Fri, 17 May 2024 12:05:31 +0000 (14:05 +0200)] 
src/useradd.c: set_defaults(): Fix order of clean-ups

Resources should be freed in the inverse order of the allocation.
This refactor prepares for the following commits, which fix some leaks.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoport: fix OVERRUN (CWE-119)
Iker Pedrosa [Wed, 15 May 2024 10:25:51 +0000 (12:25 +0200)] 
port: fix OVERRUN (CWE-119)

```
shadow-4.15.0/lib/port.c:154:2: alias: Assigning: "port.pt_names" = "ttys". "port.pt_names" now points to element 0 of "ttys" (which consists of 65 8-byte elements).
shadow-4.15.0/lib/port.c:155:2: cond_const: Checking "j < 64" implies that "j" is 64 on the false branch.
shadow-4.15.0/lib/port.c:175:2: overrun-local: Overrunning array of 65 8-byte elements at element index 65 (byte offset 527) by dereferencing pointer "port.pt_names + (j + 1)".
173|           *cp = '\0';
174|           cp++;
175|->         port.pt_names[j + 1] = NULL;
176|
177|           /*
```

Resolves: https://issues.redhat.com/browse/RHEL-35383

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
11 months agolib/getrange.c: getrange(): Report an error when min>max
Alejandro Colomar [Sun, 7 Jan 2024 00:17:33 +0000 (01:17 +0100)] 
lib/getrange.c: getrange(): Report an error when min>max

Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolib/getrange.c: getrange(): Add missing cast
Alejandro Colomar [Sat, 6 Jan 2024 23:31:01 +0000 (00:31 +0100)] 
lib/getrange.c: getrange(): Add missing cast

isdigit(3) requires a cast if the argument is of type 'char'.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolib/getrange.c: getrange(): Add const to pointer
Alejandro Colomar [Mon, 15 Apr 2024 11:47:26 +0000 (13:47 +0200)] 
lib/getrange.c: getrange(): Add const to pointer

Now that we have const-generic macros, we can use a const pointer.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolib/getrange.c: getrange(): Use a2ul() instead of strtoul_noneg()
Alejandro Colomar [Sat, 6 Jan 2024 23:24:26 +0000 (00:24 +0100)] 
lib/getrange.c: getrange(): Use a2ul() instead of strtoul_noneg()

It simplifies the error checking.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolib/atoi/a2i.[ch]: Add const-generic macros
Alejandro Colomar [Mon, 15 Apr 2024 11:20:55 +0000 (13:20 +0200)] 
lib/atoi/a2i.[ch]: Add const-generic macros

These overloaded macros allow passing either a const or a non-const
endp, and will call the appropriate function.  This kind of const
overloading has prior art in C23's string functions, such as memchr(3).

Martin suggested using an artificial function pointer in _Generic(3); it
allows switching on various types at the same time.

Also add a comment referring to liba2i's PDF manual for documentation.

Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf#subsubsection.7.26.5.2>
Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114731>
Link: <http://www.alejandro-colomar.es/share/dist/liba2i/git/HEAD/liba2i-HEAD.pdf>
Co-developed-by: Martin Uecker <muecker@gwdg.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolib/alloc.h: Reimplement [X]REALLOC[F]() macros with _Generic(3)
Alejandro Colomar [Thu, 9 May 2024 22:58:23 +0000 (00:58 +0200)] 
lib/alloc.h: Reimplement [X]REALLOC[F]() macros with _Generic(3)

Instead of GNU builtins and extensions, these macros can be implemented
with C11's _Generic(3), and the result is much simpler (and safer, since
it's now an error, not just a warning).

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoupdated Dutch translation
Frans Spiesschaert [Thu, 9 May 2024 10:36:26 +0000 (12:36 +0200)] 
updated Dutch translation

12 months agoman: update translations for username length
Iker Pedrosa [Tue, 7 May 2024 07:40:00 +0000 (09:40 +0200)] 
man: update translations for username length

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
12 months agoman: update username length
Iker Pedrosa [Tue, 7 May 2024 07:37:21 +0000 (09:37 +0200)] 
man: update username length

Fixes: 6a1f45d932c8 ("lib/chkname.c: Support unlimited user name lengths")
Related-To: https://github.com/shadow-maint/shadow/pull/986
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
12 months agolib/, src/: Rename some local variables
Alejandro Colomar [Sun, 7 Jan 2024 00:37:04 +0000 (01:37 +0100)] 
lib/, src/: Rename some local variables

'endptr' is appropriate internally in strtol(3) because it's a pointer
to 'end', and 'end' itself is a pointer to one-after-the-last character
of the numeric string.  In other words,

endptr == &end

However, naming the pointer whose address we pass to strtol(3)'s
'endptr' feels wrong, and causes me trouble while parsing the code; I
need to double check the number of dereferences, because something feels
wrong in my head.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolib/getrange.c: getrange(): Use goto to deduplicate code
Alejandro Colomar [Sat, 6 Jan 2024 23:06:49 +0000 (00:06 +0100)] 
lib/getrange.c: getrange(): Use goto to deduplicate code

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolib/getrange.c: getrange(): Return early
Alejandro Colomar [Mon, 15 Apr 2024 09:57:49 +0000 (11:57 +0200)] 
lib/getrange.c: getrange(): Return early

It's doesn't make much sense to break from a switch() just to return.
Let's return early, to simplify.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolib/getrange.c: getrange(): Return early to reduce indentation
Alejandro Colomar [Mon, 15 Apr 2024 09:52:43 +0000 (11:52 +0200)] 
lib/getrange.c: getrange(): Return early to reduce indentation

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolib/getrange.c: getrange(): Don't else after return
Alejandro Colomar [Mon, 15 Apr 2024 09:47:21 +0000 (11:47 +0200)] 
lib/getrange.c: getrange(): Don't else after return

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolib/getrange.c: getrange(): Return early to remove an else
Alejandro Colomar [Mon, 15 Apr 2024 09:46:12 +0000 (11:46 +0200)] 
lib/getrange.c: getrange(): Return early to remove an else

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolib/getrange.c: getrange(): Remove temporary variable
Alejandro Colomar [Sat, 6 Jan 2024 22:48:33 +0000 (23:48 +0100)] 
lib/getrange.c: getrange(): Remove temporary variable

This means we set the pointees on error, which we didn't do before, but
since we return -1 on error and ignore (don't use) the pointees at call
site, that's fine.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolib/getrange.c: getrange(): Small refactor
Alejandro Colomar [Mon, 15 Apr 2024 09:32:39 +0000 (11:32 +0200)] 
lib/getrange.c: getrange(): Small refactor

All 3 non-error paths in the second part resulted in *has_min = true.
Set in once before the switch(), to simplify.

This means we set this variable on error, which we didn't do before,
but since we return -1 on error and ignore (don't use) the pointees at
call site, that's fine.

Also, move a couple of *has_max = true statements to before a comment,
in preparation for future commits.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolib/getrange.c: getrange(): Small refactor
Alejandro Colomar [Mon, 15 Apr 2024 09:18:46 +0000 (11:18 +0200)] 
lib/getrange.c: getrange(): Small refactor

Set *has_{min,max} = false at the begining, so we only need to set them
to true later.

This means we set these variables on error, which we didn't do before,
but since we return -1 on error and ignore (don't use) the pointees at
call site, that's fine.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoshare/containers: update build flags for fedora 40
Iker Pedrosa [Thu, 25 Apr 2024 07:12:39 +0000 (09:12 +0200)] 
share/containers: update build flags for fedora 40

libpam is enabled to provide `passwd` binary from this package, as there
are several password quality checks that are enabled through a PAM
module. Same reason to disable account-tools-setuid.

sssd is disabled because `files provider` has been removed in sssd, and
the underlying functionality in shadow isn't needed anymore.

libcrack dependency was disabled some time ago, but the upstream repo
wasn't updated. Doing it now.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
12 months agoshare/containers: sort configuration options
Iker Pedrosa [Mon, 29 Apr 2024 08:16:44 +0000 (10:16 +0200)] 
share/containers: sort configuration options

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
12 months agoshare/containers: fix indentation in fedora
Iker Pedrosa [Thu, 25 Apr 2024 07:09:39 +0000 (09:09 +0200)] 
share/containers: fix indentation in fedora

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
12 months agonewuidmap and newgidmap manpages: fix fd description
Serge Hallyn [Tue, 9 Apr 2024 22:12:46 +0000 (17:12 -0500)] 
newuidmap and newgidmap manpages: fix fd description

The manpages for newuidmap and newgidmap had a typo "[pid[" instead
of "[pid]".  They were also unclear about what the /proc/pid fd should
be.  Fix both.

Closes #977

Reported-by: igo95862@yandex.ru
Signed-off-by: Serge Hallyn <serge@hallyn.com>
13 months agolib/env.c: treat out of memory condition as error
Tobias Stoeckmann [Sun, 31 Mar 2024 10:14:04 +0000 (12:14 +0200)] 
lib/env.c: treat out of memory condition as error

If not enough memory is available for more environment variables, treat
it exactly like not enough memory for new environment variable content.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
13 months agolib/atoi/: a2*(), str2*(): Add variants for other types
Alejandro Colomar [Tue, 16 Jan 2024 20:48:22 +0000 (21:48 +0100)] 
lib/atoi/: a2*(), str2*(): Add variants for other types

And type-generic macros that wrap them: a2i(), str2i()

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/, src/: str2*(): Rename functions and reorder parameters
Alejandro Colomar [Tue, 16 Jan 2024 20:38:24 +0000 (21:38 +0100)] 
lib/, src/: str2*(): Rename functions and reorder parameters

This makes them compatible with liba2i's functions.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/atoi/: Add a2[su]l() and reimplement get[u]long() in terms of them
Alejandro Colomar [Tue, 16 Jan 2024 20:29:59 +0000 (21:29 +0100)] 
lib/atoi/: Add a2[su]l() and reimplement get[u]long() in terms of them

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/, src/, po/: get[u]long(): Move functions to lib/atoi/str2i.h
Alejandro Colomar [Tue, 16 Jan 2024 20:00:42 +0000 (21:00 +0100)] 
lib/, src/, po/: get[u]long(): Move functions to lib/atoi/str2i.h

And make them inline.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agoconfigure.ac: release 4.15.1 4.15.1
Serge Hallyn [Sat, 23 Mar 2024 23:33:45 +0000 (18:33 -0500)] 
configure.ac: release 4.15.1

Signed-off-by: Serge Hallyn <serge@hallyn.com>
13 months agosrc/login.c: Use localtime_r(3) instead of localtime(3)
Alejandro Colomar [Mon, 29 Jan 2024 22:35:43 +0000 (23:35 +0100)] 
src/login.c: Use localtime_r(3) instead of localtime(3)

This silences a CodeQL warning.  We don't care about reentrancy, but
after this patch we don't need to break a long line, so that's a win.

Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/, src/: Use STRFTIME() instead of its pattern
Alejandro Colomar [Mon, 29 Jan 2024 12:50:33 +0000 (13:50 +0100)] 
lib/, src/: Use STRFTIME() instead of its pattern

Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/string/strftime.[ch]: STRFTIME(): Add macro
Alejandro Colomar [Mon, 29 Jan 2024 12:43:07 +0000 (13:43 +0100)] 
lib/string/strftime.[ch]: STRFTIME(): Add macro

This macro makes sure that the first argument is an array, and
calculates its size.

Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agoman/Makefile.am: ship config.xml
Serge Hallyn [Fri, 15 Mar 2024 23:50:04 +0000 (18:50 -0500)] 
man/Makefile.am: ship config.xml

Other man/*.xml's import it, so they need it shipped as well.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
13 months agoman/po/Makefile.in: avoid unnecessary changes to git indexed files
Serge Hallyn [Thu, 14 Mar 2024 23:53:49 +0000 (18:53 -0500)] 
man/po/Makefile.in: avoid unnecessary changes to git indexed files

Keep pot creation date out of our po files when we compare them.
Otherwise, we always think they need to be updated.

We prepend a line '# To re-generate, ....' to the shadow-man-pages.pot
file.  Do that before we compare the new candidate, because right
now our comparison to see if we've made changes always thinks we have.

Put some of the tempfiles in a mktemp -d'd directory, which we remove when
all's done.  This keeps the working tree cleaner.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
13 months agoupdate translations
Serge Hallyn [Thu, 14 Mar 2024 23:34:16 +0000 (18:34 -0500)] 
update translations

Update .po and .pot files to reflect some changes in print
statements.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
13 months agoMakefile.am: clean some tempfiles
Serge Hallyn [Wed, 13 Mar 2024 20:32:26 +0000 (15:32 -0500)] 
Makefile.am: clean some tempfiles

Add some temporary files to CLEANFILES

Put test-driver in .gitignore

Signed-off-by: Serge Hallyn <serge@hallyn.com>
13 months agogetdef: avoid spurious error messages about unknown configuration options
Serge Hallyn [Wed, 20 Mar 2024 22:39:46 +0000 (17:39 -0500)] 
getdef: avoid spurious error messages about unknown configuration options

def_find can return NULL for unset, not just unknown, config options.  So
move the decision of whether to log an error message about an unknown config
option back into def_find, which knows the difference.  Only putdef_str()
will pass a char* srcfile to def_find, so only calls from putdef_str will
cause the message, which was the original intent of fa68441bc4be8.

closes #967

fixes: fa68441bc4be8 ("Improve the login.defs unknown item error message")
Signed-off-by: Serge Hallyn <serge@hallyn.com>
13 months agolib/copydir:copy_entry(): use temporary stat buffer
Enrico Scholz [Mon, 18 Mar 2024 11:14:21 +0000 (12:14 +0100)] 
lib/copydir:copy_entry(): use temporary stat buffer

There are no guarantees that fstatat() does not clobber the stat
buffer on errors.

Use a temporary buffer so that the following code sees correct
attributes of the source entry.

Issue #973

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
13 months agoFix wrong french translation
Antoine Roux [Tue, 19 Mar 2024 15:49:45 +0000 (16:49 +0100)] 
Fix wrong french translation

32 characters were wrongly translated to 16 in french translation file

13 months agogitignore: add a few more generated files to be ignored
Eli Schwartz [Sun, 17 Mar 2024 22:40:21 +0000 (18:40 -0400)] 
gitignore: add a few more generated files to be ignored

before this, the following untracked files showed up in `git status`:

lib/atoi/.dirstamp
lib/string/.dirstamp
lib/time/.dirstamp
man/da/login.defs.d
man/da/messages.mo
man/de/login.defs.d
man/de/messages.mo
man/fr/login.defs.d
man/fr/messages.mo
man/it/login.defs.d
man/it/messages.mo
man/pl/login.defs.d
man/pl/messages.mo
man/ru/login.defs.d
man/ru/messages.mo
man/sv/login.defs.d
man/sv/messages.mo
man/uk/login.defs.d
man/uk/messages.mo
man/zh_CN/login.defs.d
man/zh_CN/messages.mo
test-driver

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/pam_pass_non_interactive.c: use strzero/free
Samanta Navarro [Tue, 23 Jan 2024 12:04:05 +0000 (12:04 +0000)] 
lib/pam_pass_non_interactive.c: use strzero/free

The combination of bzero and free could be optimized away.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
13 months agolib/list.c: is_on_list(): Call strsep(3) instead of open-coding it
Alejandro Colomar [Mon, 15 Jan 2024 18:07:28 +0000 (19:07 +0100)] 
lib/list.c: is_on_list(): Call strsep(3) instead of open-coding it

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/list.c: is_on_list(): Move break condition to loop controlling expression
Alejandro Colomar [Wed, 17 Jan 2024 01:50:42 +0000 (02:50 +0100)] 
lib/list.c: is_on_list(): Move break condition to loop controlling expression

This change executes `i++` one more time before breaking, so we need to
update the `i+1` after the loop to just `i`.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/list.c: is_on_list(): Move code out of loop
Alejandro Colomar [Wed, 17 Jan 2024 01:46:21 +0000 (02:46 +0100)] 
lib/list.c: is_on_list(): Move code out of loop

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/list.c: is_on_list(): Remove unnecessary use of temporary variable
Alejandro Colomar [Mon, 15 Jan 2024 18:03:07 +0000 (19:03 +0100)] 
lib/list.c: is_on_list(): Remove unnecessary use of temporary variable

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/sgetspent.c: sgetspent(): Explicitly use an empty string literal
Alejandro Colomar [Mon, 15 Jan 2024 17:23:17 +0000 (18:23 +0100)] 
lib/sgetspent.c: sgetspent(): Explicitly use an empty string literal

cp can only be an empty string literal in that conditional.  Use a
string literal to be more explicit.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/sgetspent.c: sgetspent(): Use NULL instead of 0 to mean a null pointer constant
Alejandro Colomar [Mon, 15 Jan 2024 17:18:24 +0000 (18:18 +0100)] 
lib/sgetspent.c: sgetspent(): Use NULL instead of 0 to mean a null pointer constant

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/port.c: getportent(): Call strpbrk(3) instead of open-coding it
Alejandro Colomar [Mon, 15 Jan 2024 16:18:33 +0000 (17:18 +0100)] 
lib/port.c: getportent(): Call strpbrk(3) instead of open-coding it

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/: Call strsep(3) instead of open-coding it
Alejandro Colomar [Mon, 15 Jan 2024 15:28:11 +0000 (16:28 +0100)] 
lib/: Call strsep(3) instead of open-coding it

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/: Call strchrnul(3) instead of open-coding it
Alejandro Colomar [Mon, 15 Jan 2024 15:20:03 +0000 (16:20 +0100)] 
lib/: Call strchrnul(3) instead of open-coding it

Performance tests made in 2007 are obsolete.  We should assume libc is
reasonably fast today (otherwise, report a bug to libc).

$ git blame -- lib/sgetgrent.c | grep strchr
45c6603cc (nekral-guest      2007-10-07 11:44:02 +0000  30)  * WARNING: I profiled this once with and without strchr() calls
6f88bcf58 (nekral-guest      2008-05-26 08:31:14 +0000  97)  cp = strchr (cp, ':');

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/, src/: Call gmtime_r(3) instead of gmtime(3)
Alejandro Colomar [Mon, 29 Jan 2024 14:53:34 +0000 (15:53 +0100)] 
lib/, src/: Call gmtime_r(3) instead of gmtime(3)

It's trivial to do the change, and it removes a CodeQL warning.
We don't need to be reentrant, but it doesn't hurt either.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/time/day_to_str.[ch]: day_to_str(): Accept a day instead of a date, and rename...
Alejandro Colomar [Mon, 29 Jan 2024 14:34:20 +0000 (15:34 +0100)] 
lib/time/day_to_str.[ch]: day_to_str(): Accept a day instead of a date, and rename function

It was always being called with 'day * DAY', so do that internally and
simplify.  This grabs some code from print_day_as_date().

Cc: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agosrc/passwd.c: print_status(): Fix typo (bogus use of the comma operator)
Alejandro Colomar [Mon, 29 Jan 2024 14:20:22 +0000 (15:20 +0100)] 
src/passwd.c: print_status(): Fix typo (bogus use of the comma operator)

Amazing that this triggered no warnings at all.

Fixes: 355ad6a9e089 ("Have a single definition of date_to_str()")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agosrc/: Use DAY_TO_STR() instead of its pattern
Alejandro Colomar [Mon, 29 Jan 2024 14:19:44 +0000 (15:19 +0100)] 
src/: Use DAY_TO_STR() instead of its pattern

Cc: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/time/day_to_str.h: DAY_TO_STR(): Add macro
Alejandro Colomar [Mon, 29 Jan 2024 14:14:29 +0000 (15:14 +0100)] 
lib/time/day_to_str.h: DAY_TO_STR(): Add macro

This macro ensures that the buffer is an array, and calculates the size.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/, src/, po/: date_to_str(): Move function to header, and make inline
Alejandro Colomar [Mon, 29 Jan 2024 14:11:04 +0000 (15:11 +0100)] 
lib/, src/, po/: date_to_str(): Move function to header, and make inline

BTW, there's no translatable string in there.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agosrc/sulogin.c: Invert logic to reduce indentation
Alejandro Colomar [Thu, 18 Jan 2024 10:15:17 +0000 (11:15 +0100)] 
src/sulogin.c: Invert logic to reduce indentation

Also, it was checking for >=0 for success, but since that code is for
opening a different tty as stdin, that was bogus.  But since it's
guaranteed to be either 0 or -1, this commit doesn't add any code to
make sure it's 0 (i.e., we could say !=0 instead of ==-1).  That's more
appropriate for a different commit.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/, src/: Use int main(void) where appropriate
Alejandro Colomar [Thu, 18 Jan 2024 00:30:23 +0000 (01:30 +0100)] 
lib/, src/: Use int main(void) where appropriate

Remove /*ARGSUSED*/ comments.  Instead, use appropriate declarators for
main().  ISO C allows using int main(void) if the parameters are going
to be unused.

Also, do some cosmetic changes in the uses of argc and argv, to show
where they are used.

And use *argv[], instead of **argv.  Array notation is friendlier, IMO.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/: Clean up after previous removal of dead code
Alejandro Colomar [Wed, 17 Jan 2024 13:31:05 +0000 (14:31 +0100)] 
lib/: Clean up after previous removal of dead code

Just cosmetic changes.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agolib/, src/: Remove all code wrapped in defined(USE_NIS)
Alejandro Colomar [Wed, 17 Jan 2024 13:16:27 +0000 (14:16 +0100)] 
lib/, src/: Remove all code wrapped in defined(USE_NIS)

I don't find any way to enable USE_NIS, so it looks like it's all
dead code.  Bury it.

Closes: <https://github.com/shadow-maint/shadow/issues/909>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agosrc/passwd.c: Don't print the program name twice in a log entry
Alejandro Colomar [Thu, 7 Mar 2024 23:33:19 +0000 (00:33 +0100)] 
src/passwd.c: Don't print the program name twice in a log entry

OPENLOG() already sets the program name as the prefix.

This resulted in entries like:

$ journalctl 2>/dev/null | grep passwd
Mar 03 01:09:47 debian passwd[140744]: passwd: can't view or modify password information for root

Fixes: 8e167d28afd6 ("[svn-upgrade] Integrating new upstream version, shadow (4.0.8)")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
13 months agoNoting copy_symlink behaviour
ed neville [Thu, 14 Mar 2024 19:38:15 +0000 (19:38 +0000)] 
Noting copy_symlink behaviour

Mention that symlinks are modified when they prefix the skel directory.

Closes #933

13 months agoshare/containers/, .github/workflows/: Don't make(1) twice
Alejandro Colomar [Tue, 13 Feb 2024 15:54:33 +0000 (16:54 +0100)] 
share/containers/, .github/workflows/: Don't make(1) twice

It was being done so that the second one prints errors without races.
However, the same thing can be achieved by passing -Orecurse to make(1).

And this makes the logs even more readable, since there's no racy output
at all.

Fixes: 97f79e3b2715 ("CI: Make build logs more readable")
Link: <https://github.com/shadow-maint/shadow/pull/702>
Link: <https://github.com/nginx/unit/pull/1123>
Acked-by: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Andrew Clayton <a.clayton@nginx.com>
Cc: Konstantin Pavlov <thresh@nginx.com>
Cc: Dylan Arbour <https://github.com/arbourd>
Signed-off-by: Alejandro Colomar <alx@kernel.org>