]> git.ipfire.org Git - thirdparty/shadow.git/log
thirdparty/shadow.git
3 years agolib: provide default values for shadow_progname/shadow_logfd 474/head
Adam Sampson [Sun, 26 Dec 2021 18:21:09 +0000 (18:21 +0000)] 
lib: provide default values for shadow_progname/shadow_logfd

3 years agolibsubid: use log_set_progname in subid_init
Adam Sampson [Sun, 26 Dec 2021 18:16:10 +0000 (18:16 +0000)] 
libsubid: use log_set_progname in subid_init

The static Prog variable here is no longer used, so remove it.

3 years agoMerge pull request #467 from alejandro-colomar/date_to_str
Serge Hallyn [Mon, 27 Dec 2021 15:53:00 +0000 (09:53 -0600)] 
Merge pull request #467 from alejandro-colomar/date_to_str

Have a single definition of date_to_str()

3 years agoMerge pull request #473 from hallyn/2021-12-26/srht
Serge Hallyn [Mon, 27 Dec 2021 15:40:19 +0000 (09:40 -0600)] 
Merge pull request #473 from hallyn/2021-12-26/srht

Test sr.ht CI integration

3 years agofix newuidmap testcase 473/head
Serge Hallyn [Sun, 26 Dec 2021 19:46:50 +0000 (13:46 -0600)] 
fix newuidmap testcase

sleep 2s before running newxidmap - it seems we were sometimes
racing, causing newxidmap to fail.

Make sure to remove /tmp/test-xidmap, for some reason they
were sometimes still there, causing test to fail.

Fix some irregular tabbing.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agolibsubid_zzz (test): fix pointer test
Serge Hallyn [Sun, 26 Dec 2021 17:55:01 +0000 (11:55 -0600)] 
libsubid_zzz (test): fix pointer test

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agorun_some: exit error if there were failed tests
Serge Hallyn [Sun, 7 Nov 2021 23:56:31 +0000 (17:56 -0600)] 
run_some: exit error if there were failed tests

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoremove broken github actions
Serge Hallyn [Sun, 26 Dec 2021 17:51:21 +0000 (11:51 -0600)] 
remove broken github actions

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoadd a .build.yml to build on builds.sr.ht
Serge Hallyn [Sun, 26 Dec 2021 17:45:52 +0000 (11:45 -0600)] 
add a .build.yml to build on builds.sr.ht

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoHave a single definition of date_to_str() 467/head
Alejandro Colomar [Wed, 22 Dec 2021 14:32:17 +0000 (15:32 +0100)] 
Have a single definition of date_to_str()

PARAMETERS:

According to the C2x charter, I reordered the parameters 'size'
and 'buf' from previously existing date_to_str() definitions.

C2x charter:
> 15. Application Programming Interfaces (APIs) should be
> self-documenting when possible.  In particular, the order of
> parameters in function declarations should be arranged such that
> the size of an array appears before the array.  The purpose is to
> allow Variable-Length Array (VLA) notation to be used.  This not
> only makes the code's purpose clearer to human readers, but also
> makes static analysis easier.  Any new APIs added to the Standard
> should take this into consideration.

I used 'long' for the date parameter, as some uses of the function
need to pass a negative value meaning "never".

FUNCTION BODY:

I didn't check '#ifdef HAVE_STRFTIME', which old definitions did,
since strftime(3) is guaranteed by the C89 standard, and all of
the conversion specifiers that we use are also specified by that
standard, so we don't need any extensions at all.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoMerge pull request #472 from atsampson/progname
Serge Hallyn [Sun, 26 Dec 2021 16:02:04 +0000 (10:02 -0600)] 
Merge pull request #472 from atsampson/progname

lib: rename Prog to shadow_progname, with only one definition

3 years agolib: rename Prog to shadow_progname, with only one definition 472/head
Adam Sampson [Sat, 25 Dec 2021 22:41:58 +0000 (22:41 +0000)] 
lib: rename Prog to shadow_progname, with only one definition

The build was failing with duplicate symbol errors with -fno-common.
This is the default in GCC 10 and later, and explicitly enabled in some
distributions to catch problems like this. There were two causes:

- Prog and shadow_logfd were defined in a header file that was included
  in multiple other files. Fix this by defining them once in
  shadowlog.c, and having extern declarations in the header.

- Most of the tools (except id/nologin) also define a Prog variable,
  which is not intended to alias the one in the library. Fix
  this by renaming Prog in the library to shadow_progname, which also
  matches the new accessor functions for it.

3 years agoMerge pull request #471 from hallyn/2021-12-23/extern
Serge Hallyn [Thu, 23 Dec 2021 21:19:16 +0000 (15:19 -0600)] 
Merge pull request #471 from hallyn/2021-12-23/extern

Make shadow_logfd and Prog not extern

3 years agoMake shadow_logfd and Prog not extern 471/head
Serge Hallyn [Sun, 28 Nov 2021 23:37:53 +0000 (17:37 -0600)] 
Make shadow_logfd and Prog not extern

Closes #444
Closes #465

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoMerge pull request #463 from thesamesam/master
Serge Hallyn [Mon, 20 Dec 2021 01:46:55 +0000 (19:46 -0600)] 
Merge pull request #463 from thesamesam/master

libsubid: fix defining SONAME version

3 years agolibsubid: fix defining SONAME version 463/head
Sam James [Mon, 20 Dec 2021 01:37:23 +0000 (01:37 +0000)] 
libsubid: fix defining SONAME version

We were overriding this when --enable-shared was passed. We can actually
just dump the conditional logic as libtool will do the right thing for
us here anyway.

Without this patch, libsubid is installed as .0.

Signed-off-by: Sam James <sam@gentoo.org>
3 years agoconfigure.ac and changelog: release 4.9 4.10 v4.10
Serge Hallyn [Sun, 19 Dec 2021 20:06:09 +0000 (14:06 -0600)] 
configure.ac and changelog: release 4.9

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoAdd README as symlink to README.md
Serge Hallyn [Sun, 19 Dec 2021 20:08:27 +0000 (14:08 -0600)] 
Add README as symlink to README.md

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoMerge pull request #461 from edneville/441_passwd_message
Serge Hallyn [Sun, 19 Dec 2021 17:27:44 +0000 (11:27 -0600)] 
Merge pull request #461 from edneville/441_passwd_message

passwd -l should not say that it changes expiry

3 years agopasswd -l should not say that it changes expiry 461/head
ed neville [Fri, 17 Dec 2021 22:59:46 +0000 (22:59 +0000)] 
passwd -l should not say that it changes expiry

Closes #441

3 years agoMerge pull request #458 from edneville/434_usermod_home_dir_trailing_slash
Serge Hallyn [Fri, 17 Dec 2021 14:41:26 +0000 (08:41 -0600)] 
Merge pull request #458 from edneville/434_usermod_home_dir_trailing_slash

Remove tailing slash on home dir

3 years agoMerge pull request #455 from alejandro-colomar/master
Serge Hallyn [Fri, 17 Dec 2021 14:33:47 +0000 (08:33 -0600)] 
Merge pull request #455 from alejandro-colomar/master

usermod: Remove special case for ""

3 years agoRemove tailing slash on home dir 458/head
ed neville [Fri, 17 Dec 2021 11:30:57 +0000 (11:30 +0000)] 
Remove tailing slash on home dir

Closes #434

Signed-off-by: ed neville <ed@s5h.net>
3 years agoMerge pull request #456 from stoeckmann/chld
Serge Hallyn [Wed, 15 Dec 2021 15:22:19 +0000 (09:22 -0600)] 
Merge pull request #456 from stoeckmann/chld

Verify default SIGCHLD handling.

3 years agoVerify default SIGCHLD handling. 456/head
Tobias Stoeckmann [Sat, 23 Oct 2021 13:36:00 +0000 (15:36 +0200)] 
Verify default SIGCHLD handling.

The SIGCHLD handler could have been ignored by parent process.
Make sure that we have default handling activated.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 years agoMerge pull request #421 from AZaugg/issue337
Serge Hallyn [Tue, 14 Dec 2021 14:04:29 +0000 (08:04 -0600)] 
Merge pull request #421 from AZaugg/issue337

Adding new switch -rG to usermod

3 years agousermod: Remove special case for "" 455/head
Alejandro Colomar [Tue, 14 Dec 2021 11:40:06 +0000 (12:40 +0100)] 
usermod: Remove special case for ""

That special case is already handled by the called function: strtoday()
so we can simplify the calling code.

Link: <https://github.com/shadow-maint/shadow/issues/454>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoAdding new option -rG to usermod 421/head
Andy Zaugg [Thu, 23 Sep 2021 03:29:09 +0000 (20:29 -0700)] 
Adding new option -rG to usermod

Adding a new switch -rG, which provides a similar feature set to
-aG, allowing a person to list exactly what groups to remove a
user from.

https://github.com/shadow-maint/shadow/issues/337

3 years agoMerge pull request #452 from 20100074/fix-typo-in-is
Serge Hallyn [Fri, 10 Dec 2021 15:43:12 +0000 (09:43 -0600)] 
Merge pull request #452 from 20100074/fix-typo-in-is

Fixed typo in login.defs

3 years agoMerge pull request #453 from ikerexxe/getsubids_h
Serge Hallyn [Fri, 10 Dec 2021 15:37:02 +0000 (09:37 -0600)] 
Merge pull request #453 from ikerexxe/getsubids_h

man: getsubids define -h

3 years agoman: getsubids define -h 453/head
Iker Pedrosa [Fri, 10 Dec 2021 15:14:13 +0000 (16:14 +0100)] 
man: getsubids define -h

Define -h option behaviour in getsubids man page.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoMerge pull request #449 from hallyn/2021-11-27/libsubid-symbols
Serge Hallyn [Tue, 7 Dec 2021 14:58:03 +0000 (08:58 -0600)] 
Merge pull request #449 from hallyn/2021-11-27/libsubid-symbols

2021 11 27/libsubid symbols

3 years agofixed typo in login.defs 452/head
KOSHIKAWA Kenichi [Sun, 5 Dec 2021 16:41:17 +0000 (01:41 +0900)] 
fixed typo in login.defs

3 years agoMerge pull request #408 from bjorn-fischer/ambient_caps
Serge Hallyn [Sun, 5 Dec 2021 14:05:06 +0000 (08:05 -0600)] 
Merge pull request #408 from bjorn-fischer/ambient_caps

Add support for ambient capabilities

3 years agoCall pam_end() after fork in child code path 408/head
Björn Fischer [Wed, 8 Sep 2021 13:03:36 +0000 (15:03 +0200)] 
Call pam_end() after fork in child code path

This conforms to PAM documentation and it is needed to support
ambient capabilities with PAM + libcap-2.58+.

Signed-off-by: Björn Fischer <bf@CeBiTec.Uni-Bielefeld.DE>
3 years agoShow libsubid api version in subid.h 449/head
Serge Hallyn [Sun, 5 Dec 2021 13:57:39 +0000 (07:57 -0600)] 
Show libsubid api version in subid.h

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoMerge pull request #231 from gjzkrug/useradd-maildir-fix
Serge Hallyn [Sun, 5 Dec 2021 04:26:51 +0000 (22:26 -0600)] 
Merge pull request #231 from gjzkrug/useradd-maildir-fix

Removed hard-coded default mail spool in useradd

3 years agoMerge pull request #450 from lnussel/master
Serge Hallyn [Sun, 5 Dec 2021 04:21:37 +0000 (22:21 -0600)] 
Merge pull request #450 from lnussel/master

useradd: assume uid 0 == root as fallback

3 years agoUpdate email address for Julie Haugh
Serge Hallyn [Sun, 5 Dec 2021 04:20:23 +0000 (22:20 -0600)] 
Update email address for Julie Haugh

3 years agouseradd: assume uid 0 == root as fallback 450/head
Ludwig Nussel [Tue, 30 Nov 2021 16:14:14 +0000 (17:14 +0100)] 
useradd: assume uid 0 == root as fallback

In absence of /etc/passwd, eg when bootstrapping a chroot, resolving
uid 0 to a name may not work. Therefore just assume "root".

3 years agoChange the subid export symbols
Serge Hallyn [Sat, 27 Nov 2021 16:49:03 +0000 (10:49 -0600)] 
Change the subid export symbols

Rename libsubid symbols to all be prefixed with subid_.

Don't export anything but the subid_*.

Closes #443

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoundo accidental autogen.sh commit: enable-shared
Serge Hallyn [Sat, 27 Nov 2021 17:11:04 +0000 (11:11 -0600)] 
undo accidental autogen.sh commit: enable-shared

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoMerge pull request #447 from ikerexxe/documentation
Serge Hallyn [Sat, 27 Nov 2021 15:37:19 +0000 (09:37 -0600)] 
Merge pull request #447 from ikerexxe/documentation

README: update content and format

3 years agoREADME: update content and format 447/head
Iker Pedrosa [Fri, 19 Nov 2021 11:22:05 +0000 (12:22 +0100)] 
README: update content and format

* Change to markdown format
* Include an introduction
* Remove the commit mailing list from the contacts
* Add the IRC channel to the contacts
* Move 'S/Key' section to doc/README.skey
* Move authors and maintainers to AUTHORS.md

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoMerge pull request #440 from stoeckmann/vipw
Serge Hallyn [Mon, 22 Nov 2021 13:33:57 +0000 (07:33 -0600)] 
Merge pull request #440 from stoeckmann/vipw

Improve child error handling

3 years agoMerge pull request #446 from ikerexxe/spw_free
Serge Hallyn [Mon, 22 Nov 2021 13:32:32 +0000 (07:32 -0600)] 
Merge pull request #446 from ikerexxe/spw_free

lib: check NULL before freeing passwd data

3 years agolib: check NULL before freeing passwd data 446/head
Iker Pedrosa [Thu, 18 Nov 2021 15:48:26 +0000 (16:48 +0100)] 
lib: check NULL before freeing passwd data

Add an additional NULL check condition in spw_free() and pw_free() to
avoid freeing an already empty pointer.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoMerge pull request #435 from freedge/groupdelcore
Serge Hallyn [Thu, 18 Nov 2021 16:30:46 +0000 (10:30 -0600)] 
Merge pull request #435 from freedge/groupdelcore

groupdel: fix SIGSEGV when passwd does not exist

3 years agoMerge pull request #436 from ikerexxe/getsubids
Serge Hallyn [Thu, 18 Nov 2021 13:32:10 +0000 (07:32 -0600)] 
Merge pull request #436 from ikerexxe/getsubids

getsubids: system binary for user's sub*ids

3 years agoREADME: add myself to the contributors list 436/head
Iker Pedrosa [Wed, 10 Nov 2021 09:04:12 +0000 (10:04 +0100)] 
README: add myself to the contributors list

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agogetsubids: system binary for user's sub*ids
Iker Pedrosa [Wed, 10 Nov 2021 08:54:59 +0000 (09:54 +0100)] 
getsubids: system binary for user's sub*ids

Rename list_subid_ranges to getsubids to provide a system binary to
check the sub*ids of a user. The intention is to provide this binary
with any distribution that includes the subid feature, so that system
administrators can check the subid ranges of a given user.

Finally, add a man page to explain the behaviour of getsubids.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1980780

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoMerge pull request #437 from ikerexxe/newgrp_segfault
Serge Hallyn [Wed, 17 Nov 2021 14:18:13 +0000 (08:18 -0600)] 
Merge pull request #437 from ikerexxe/newgrp_segfault

newgrp: fix segmentation fault

3 years agoMerge pull request #439 from ikerexxe/useradd_skel_fix
Serge Hallyn [Wed, 17 Nov 2021 14:17:34 +0000 (08:17 -0600)] 
Merge pull request #439 from ikerexxe/useradd_skel_fix

useradd: change SELinux labels for home files

3 years agoMerge pull request #442 from rbalint/fix-no-passwd-help
Serge Hallyn [Wed, 17 Nov 2021 14:15:04 +0000 (08:15 -0600)] 
Merge pull request #442 from rbalint/fix-no-passwd-help

Fix typo in passwd --help's Norvegian translation

3 years agoMerge pull request #445 from ikerexxe/pwck_segfault
Serge Hallyn [Wed, 17 Nov 2021 14:14:22 +0000 (08:14 -0600)] 
Merge pull request #445 from ikerexxe/pwck_segfault

pwck: fix segfault when calling fprintf()

3 years agopwck: fix segfault when calling fprintf() 445/head
Iker Pedrosa [Mon, 15 Nov 2021 11:40:15 +0000 (12:40 +0100)] 
pwck: fix segfault when calling fprintf()

As shadow_logfd variable is not set at the beginning of the program if
something fails and fprintf() is called a segmentation fault happens.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2021339

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoFix typo in passwd --help's Norvegian translation 442/head
Balint Reczey [Sun, 14 Nov 2021 11:50:53 +0000 (12:50 +0100)] 
Fix typo in passwd --help's Norvegian translation

Thanks to Tollef Fog Heen for the bug report at https://bugs.debian.org/949862

3 years agoImprove child error handling 440/head
Tobias Stoeckmann [Sun, 14 Nov 2021 11:01:32 +0000 (12:01 +0100)] 
Improve child error handling

Always set SIGCHLD handler to default, even if the caller of vipw has
set SIGCHLD to ignore. If SIGCHLD is ignored no zombie processes would
be created, which in turn could mean that kill is called with an already
recycled pid.

Proof of Concept:

1. Compile nochld:
 --
 #include <signal.h>
 #include <unistd.h>
 int main(void) {
 char *argv[] = { "vipw", NULL };
 signal(SIGCHLD, SIG_IGN);
 execvp("vipw", argv);
 return 1;
 }
 --
2. Run nochld
3. Suspend child vi, which suspends vipw too:
`kill -STOP childpid`
4. Kill vi:
`kill -9 childpid`
5. You can see with ps that childpid is no zombie but disappeared
6. Bring vipw back into foreground
`fg`

The kill call sends SIGCONT to "childpid" which in turn could have been
already recycled for another process.

This is definitely not a vulnerability. It would take super user
operations, at which point an attacker would have already elevated
permissions.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 years agouseradd: change SELinux labels for home files 439/head
Iker Pedrosa [Fri, 12 Nov 2021 14:23:30 +0000 (15:23 +0100)] 
useradd: change SELinux labels for home files

Change SELinux labels for files copied from the skeleton directory to
the home directory.

This could cause gnome's graphical user adding to fail without copying
the full skeleton files.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2022658

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agonewgrp: fix segmentation fault 437/head
Iker Pedrosa [Wed, 10 Nov 2021 11:02:04 +0000 (12:02 +0100)] 
newgrp: fix segmentation fault

Fix segmentation fault in newgrp when xgetspnam() returns a NULL value
that is immediately freed.

The error was committed in
https://github.com/shadow-maint/shadow/commit/e65cc6aebcb4132fa413f00a905216a5b35b3d57

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2019553

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agogroupdel: fix SIGSEGV when passwd does not exist 435/head
François Rigault [Mon, 1 Nov 2021 12:54:25 +0000 (13:54 +0100)] 
groupdel: fix SIGSEGV when passwd does not exist

When using groupdel with a prefix, groupdel will attempt to read a
passwd file to look for any user in the group. When the file does not
exist it cores with segmentation fault.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1986111

3 years agoMerge pull request #423 from lrh2000/su-fix-sigkill
Serge Hallyn [Sun, 31 Oct 2021 17:36:03 +0000 (12:36 -0500)] 
Merge pull request #423 from lrh2000/su-fix-sigkill

su: Fix never alarmed SIGKILL when session terminates

3 years agoMerge pull request #432 from galaxy4public/tcb-missing-chmod
Serge Hallyn [Sat, 30 Oct 2021 16:02:12 +0000 (11:02 -0500)] 
Merge pull request #432 from galaxy4public/tcb-missing-chmod

Add missing chmod() for shadowtcb_move()

3 years agoMerge pull request #433 from stoeckmann/hushed
Serge Hallyn [Sat, 30 Oct 2021 14:34:55 +0000 (09:34 -0500)] 
Merge pull request #433 from stoeckmann/hushed

Handle malformed lines in hushlogins file.

3 years agoHandle malformed lines in hushlogins file. 433/head
Tobias Stoeckmann [Fri, 29 Oct 2021 17:44:46 +0000 (19:44 +0200)] 
Handle malformed lines in hushlogins file.

If a line in hushlogins file, e.g. /etc/hushlogins, starts with
'\0', then current code performs an out of boundary write.
If the line lacks a newline at the end, then another character is
overridden.

With strcspn both cases are solved.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 years agoAdd missing chmod() 432/head
(GalaxyMaster) [Thu, 28 Oct 2021 00:16:59 +0000 (11:16 +1100)] 
Add missing chmod()

During shadowtcb_move() the directory is temporarily changed to be
owned by root:root with permissions 0700.  After the change is done,
the ownership and permissions were supposed to be restored.  The
call for chown() was there, but the chmod() call was missing.  This
resulted in the broken TCB functionality.  The added chmod() fixes
the issue.

3 years agoMerge pull request #430 from galaxy4public/libsubid-static
Serge Hallyn [Wed, 27 Oct 2021 13:31:23 +0000 (08:31 -0500)] 
Merge pull request #430 from galaxy4public/libsubid-static

Fixes the linking issues when libsubid is static and linked to

3 years agoFixes the linking issues when libsubid is static and linked to 430/head
(GalaxyMaster) [Wed, 27 Oct 2021 09:14:42 +0000 (20:14 +1100)] 
Fixes the linking issues when libsubid is static and linked to
binaries that also define the Prog and shadow_logfd variables.

3 years agoMerge pull request #422 from ikerexxe/home_selinux_user
Serge Hallyn [Wed, 27 Oct 2021 01:08:21 +0000 (20:08 -0500)] 
Merge pull request #422 from ikerexxe/home_selinux_user

Create the home and mail directories with SELinux user label

3 years agoAdd Christian Brauner to SECURITY.md
Serge Hallyn [Mon, 25 Oct 2021 19:26:37 +0000 (14:26 -0500)] 
Add Christian Brauner to SECURITY.md

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agosemanage: close the selabel handle 422/head
Iker Pedrosa [Fri, 8 Oct 2021 11:13:13 +0000 (13:13 +0200)] 
semanage: close the selabel handle

Close the selabel handle to update the file_context. This means that the
file_context will be remmaped and used by selabel_lookup() to return
the appropriate context to label the home folder.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1993081

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agouseradd: create directories after the SELinux user
Iker Pedrosa [Fri, 8 Oct 2021 11:09:59 +0000 (13:09 +0200)] 
useradd: create directories after the SELinux user

Create the home and mail folders after the SELinux user has been set for
the added user. This will allow the folders to be created with the
SELinux user label.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agosu: Fix never alarmed SIGKILL when session terminates 423/head
Ruihan Li [Sat, 9 Oct 2021 11:54:36 +0000 (19:54 +0800)] 
su: Fix never alarmed SIGKILL when session terminates

The buggy code was introduced nearly 5 years ago at the
commit 08fd4b69e84364677a10e519ccb25b71710ee686. The
desired behavior is that SIGKILL will be sent to the
child if it does not exit within 2 seconds after it
receives SIGTERM. However, SIGALRM is masked while
waiting for the child so it cannot wake the program
up after 2 seconds to send SIGKILL.

An example shows the buggy behavior, which exists in
Ubuntu 18.04 LTS (with login 1:4.5-1ubuntu2).
```bash
user1@localhost:~$ su user2 -c '
_term() {
  echo SIGTERM received
}
trap _term TERM

while true; do
  sleep 1
  echo still alive
done'
Password:
still alive

Session terminated, terminating shell...Terminated
SIGTERM received
still alive
still alive
still alive
still alive
```
(SIGTERM is sent in another user1's terminal by
executing `killall su`.)

Here is the desired behavior, which shows what the
commit fixes.
```bash
user1@localhost:~$ su user2 -c '
_term() {
  echo SIGTERM received
}
trap _term TERM

while true; do
  sleep 1
  echo still alive
done'
Password:
still alive

Session terminated, terminating shell...Terminated
SIGTERM received
still alive
still alive
 ...killed.
user1@localhost:~$ echo $?
255
```

3 years agoCreate SECURITY.md
Serge Hallyn [Sat, 23 Oct 2021 14:34:48 +0000 (09:34 -0500)] 
Create SECURITY.md

Barebones to unblock current reporters.

3 years agoMerge pull request #426 from hallyn/2021-10-15/man
Serge Hallyn [Wed, 20 Oct 2021 20:16:06 +0000 (15:16 -0500)] 
Merge pull request #426 from hallyn/2021-10-15/man

3 years agomanpages: fix 'File Formats and Conversions" 426/head
Serge Hallyn [Fri, 15 Oct 2021 21:28:12 +0000 (16:28 -0500)] 
manpages: fix 'File Formats and Conversions"

Closes #416

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoinitial github actions attempt
Serge Hallyn [Sun, 10 Oct 2021 20:10:57 +0000 (15:10 -0500)] 
initial github actions attempt

Closes #415

3 years agoAdded a new configurable LOG_INIT to useradd
Andy Zaugg [Tue, 21 Sep 2021 03:42:21 +0000 (20:42 -0700)] 
Added a new configurable LOG_INIT to useradd

In some circumstances I want the default behaviour of useradd to
not add user entries to the lastlog and faillog databases. Allowing
this options behaviour to be controlled by the config file
/etc/default/useradd.

3 years agoAdded documentation around CREATE_MAIL_SPOOL
Andy Zaugg [Tue, 21 Sep 2021 03:41:50 +0000 (20:41 -0700)] 
Added documentation around CREATE_MAIL_SPOOL

Adding documentation aroud the parameter CREATE_MAIL_SPOOL in the
/etc/default/useradd file

3 years agoMerge pull request #412 from ljmf00/fix-trailing-whitespaces
Serge Hallyn [Mon, 27 Sep 2021 15:12:24 +0000 (10:12 -0500)] 
Merge pull request #412 from ljmf00/fix-trailing-whitespaces

treewide: remove trailing whitespaces

3 years agoMerge pull request #417 from jubalh/doublefree
Serge Hallyn [Mon, 27 Sep 2021 15:10:22 +0000 (10:10 -0500)] 
Merge pull request #417 from jubalh/doublefree

Only free sgent if it was initialized

3 years agoMerge pull request #420 from AZaugg/issue419
Serge Hallyn [Mon, 27 Sep 2021 13:48:24 +0000 (08:48 -0500)] 
Merge pull request #420 from AZaugg/issue419

Fix parentheses in configure.ac

3 years agoFix parentheses in configure.ac 420/head
Andy Zaugg [Wed, 22 Sep 2021 04:51:10 +0000 (21:51 -0700)] 
Fix parentheses in configure.ac

Resolving issue https://github.com/shadow-maint/shadow/issues/419

3 years agoOnly free sgent if it was initialized 417/head
Michael Vetter [Mon, 20 Sep 2021 09:04:50 +0000 (11:04 +0200)] 
Only free sgent if it was initialized

`sgent` is only initialized in `get_group()` if `is_shadowgrp` is true.
So we should also only attempt to free it if this is actually the case.

Can otherwise lead to:
```
free() double free detected in tcache 2 (gpasswd)
```

3 years agoMerge pull request #414 from Frans-Spiesschaert/new_dutch_po_branch
Serge Hallyn [Tue, 14 Sep 2021 15:01:17 +0000 (10:01 -0500)] 
Merge pull request #414 from Frans-Spiesschaert/new_dutch_po_branch

updated Dutch translation

3 years agoupdated Dutch translation 414/head
Frans Spiesschaert [Mon, 13 Sep 2021 19:05:45 +0000 (21:05 +0200)] 
updated Dutch translation

3 years agotreewide: remove trailing whitespaces 412/head
Luís Ferreira [Mon, 13 Sep 2021 16:23:17 +0000 (17:23 +0100)] 
treewide: remove trailing whitespaces

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
3 years agoMerge pull request #405 from a1346054/master
Serge Hallyn [Mon, 13 Sep 2021 15:57:38 +0000 (10:57 -0500)] 
Merge pull request #405 from a1346054/master

Minor cleanups

3 years agoMerge pull request #411 from ljmf00/ignore-check-subid
Serge Hallyn [Mon, 13 Sep 2021 15:37:59 +0000 (10:37 -0500)] 
Merge pull request #411 from ljmf00/ignore-check-subid

git: ignore generated check_subid_range

3 years agogit: ignore generated check_subid_range 411/head
Luís Ferreira [Mon, 13 Sep 2021 15:17:49 +0000 (16:17 +0100)] 
git: ignore generated check_subid_range

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
3 years agofix spelling 405/head
a1346054 [Mon, 13 Sep 2021 15:11:40 +0000 (15:11 +0000)] 
fix spelling

3 years agoMerge pull request #410 from paulmenzel/use-https-urls-in-readme
Serge Hallyn [Sun, 12 Sep 2021 15:50:09 +0000 (10:50 -0500)] 
Merge pull request #410 from paulmenzel/use-https-urls-in-readme

Use HTTPS URLs in README, where possible

3 years agoREADME: Use HTTPS URLs where possible 410/head
Paul Menzel [Sun, 12 Sep 2021 10:06:02 +0000 (12:06 +0200)] 
README: Use HTTPS URLs where possible

The GitHub and Debian permanently moved to HTTPS URLs and redirect
there. The Gentoo URL does not redirect to HTTPS, but still use it to
address certain kinds of attacks. Lastly, the NetBSD URL is only
available using HTTP.

3 years agofix some shellcheck-identified issues in scripts
a1346054 [Wed, 18 Aug 2021 18:21:06 +0000 (18:21 +0000)] 
fix some shellcheck-identified issues in scripts

3 years agouse a geographically close URL
a1346054 [Wed, 18 Aug 2021 18:07:50 +0000 (18:07 +0000)] 
use a geographically close URL

3 years agofix spelling and unify whitespace
a1346054 [Wed, 18 Aug 2021 18:06:02 +0000 (18:06 +0000)] 
fix spelling and unify whitespace

3 years agoRevert "useradd.c:fix memleaks of grp"
Serge Hallyn [Sun, 15 Aug 2021 00:37:24 +0000 (19:37 -0500)] 
Revert "useradd.c:fix memleaks of grp"

In some cases, the value which was being freed is not actually
safe to free.

Closes #394

This reverts commit c44b71cec25d60efc51aec9de3abce1f6efbfcf5.

3 years agoMerge pull request #400 from floppym/sha-rounds
Serge Hallyn [Sun, 15 Aug 2021 00:29:54 +0000 (19:29 -0500)] 
Merge pull request #400 from floppym/sha-rounds

libmisc: fix default value in SHA_get_salt_rounds()

3 years agoMerge pull request #401 from hallyn/2021-08-14/dropxml2po
Serge Hallyn [Sun, 15 Aug 2021 00:28:18 +0000 (19:28 -0500)] 
Merge pull request #401 from hallyn/2021-08-14/dropxml2po

man/po/Makefile.in: switch from xml2po to itstool

3 years agoMerge pull request #403 from hallyn/2021-08-14/fixnosubuidbuild
Serge Hallyn [Sun, 15 Aug 2021 00:28:07 +0000 (19:28 -0500)] 
Merge pull request #403 from hallyn/2021-08-14/fixnosubuidbuild

useradd.c: Fix undeclared subuid_count when not using subids