]> git.ipfire.org Git - thirdparty/shadow.git/log
thirdparty/shadow.git
2 years agoRevert "Drop unused function subid_init()"
Serge Hallyn [Sun, 21 Aug 2022 18:14:37 +0000 (13:14 -0500)] 
Revert "Drop unused function subid_init()"

As rbalint points out, this was an exported fn.  It also is
the only way for a libsubid user to do what it does, so let's
not drop it.

This reverts commit 477c8e6f42df1e17e45584e74988eb46a11e6caa.

2 years agouseradd.8.xml: fix default group id from 100 to 1000 according to bbf4b79
Tim Biermann [Fri, 19 Aug 2022 20:31:01 +0000 (22:31 +0200)] 
useradd.8.xml: fix default group id from 100 to 1000 according to bbf4b79

2 years agoRelease 4.12.2 with CVE fix 4.12.2
Serge Hallyn [Thu, 18 Aug 2022 21:54:21 +0000 (16:54 -0500)] 
Release 4.12.2 with CVE fix

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2 years agoAvoid races in copy_tree()
Christian Göttsche [Fri, 5 Aug 2022 15:57:32 +0000 (17:57 +0200)] 
Avoid races in copy_tree()

Use *at() functions to pin the directory operating in to avoid being
redirected by unprivileged users replacing parts of paths by symlinks to
privileged files.

Introduce a path_info struct with the full path and dirfd and name
information for *at() functions, since the full path is needed for link
resolution, SELinux label lookup and ACL attributes.

2 years agoAddress minor compiler warnings
Christian Göttsche [Fri, 5 Aug 2022 15:57:29 +0000 (17:57 +0200)] 
Address minor compiler warnings

    copydir.c:666:44: warning: unsigned conversion from 'int' to '__mode_t' {aka 'unsigned int'} changes value from '-4096' to '4294963200' [-Wsign-conversion]
      666 |         if (   (mknod (dst, statp->st_mode & ~07777, statp->st_rdev) != 0)
          |                                            ^

    copydir.c:116:1: warning: missing initializer for field 'quote' of 'struct error_context' [-Wmissing-field-initializers]
      116 | };
          | ^
    In file included from copydir.c:27:
    /usr/include/attr/error_context.h:30:23: note: 'quote' declared here
       30 |         const char *(*quote) (struct error_context *, const char *);
          |                       ^~~~~

2 years agoMore robust file content copy in copy_tree()
Christian Göttsche [Fri, 5 Aug 2022 15:57:27 +0000 (17:57 +0200)] 
More robust file content copy in copy_tree()

Bail out on read(2) failure, continue on EINTR, support short writes and
increase chunk size.

2 years agoFail if regular file pre-exists in copy_tree()
Christian Göttsche [Fri, 5 Aug 2022 15:57:26 +0000 (17:57 +0200)] 
Fail if regular file pre-exists in copy_tree()

Similar to the default behavior of mkdir(2), symlink(2), link(2) and
mknod(2).

2 years agoRequire symlink support
Christian Göttsche [Fri, 5 Aug 2022 15:57:24 +0000 (17:57 +0200)] 
Require symlink support

Require lstat(2), lchown(2), S_IFLNK and S_ISLNK from POSIX.1-2001.

Already unconditionally used in lib/tcbfuncs.c and lib/run_part.c.

2 years agoAvoid races in remove_tree()
Christian Göttsche [Fri, 5 Aug 2022 15:57:22 +0000 (17:57 +0200)] 
Avoid races in remove_tree()

Use *at() functions to pin the directory operating in to avoid being
redirected by unprivileged users replacing parts of paths by symlinks to
privileged files.

2 years agoAvoid races in chown_tree()
Christian Göttsche [Fri, 5 Aug 2022 15:57:19 +0000 (17:57 +0200)] 
Avoid races in chown_tree()

Use *at() functions to pin the directory operating in to avoid being
redirected by unprivileged users replacing parts of paths by symlinks to
privileged files.

2 years agoRelease 4.12 4.12.1
Serge Hallyn [Mon, 15 Aug 2022 17:16:41 +0000 (12:16 -0500)] 
Release 4.12

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2 years agouk has no limits.5 translation
Serge Hallyn [Fri, 12 Aug 2022 18:11:56 +0000 (13:11 -0500)] 
uk has no limits.5 translation

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2 years agoAdd uk to list of man subdirs
Serge Hallyn [Fri, 12 Aug 2022 17:29:50 +0000 (12:29 -0500)] 
Add uk to list of man subdirs

Closes #547

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2 years agoRelease 4.12 4.12
Serge Hallyn [Thu, 11 Aug 2022 16:04:18 +0000 (11:04 -0500)] 
Release 4.12

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2 years agoUpdate changelog
Serge Hallyn [Mon, 8 Aug 2022 23:56:41 +0000 (18:56 -0500)] 
Update changelog

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agolibmisc/root_flag: add tips for --root flag only support abspath
Celeste Liu [Wed, 27 Jul 2022 15:06:36 +0000 (23:06 +0800)] 
libmisc/root_flag: add tips for --root flag only support abspath

- Add tips in error message.
- Add tips in man.
- Add zh_CN and zh_TW for tips.

Signed-off-by: Celeste Liu <coelacanthus@outlook.com>
3 years agoUse function format attribute where applicable
Christian Göttsche [Fri, 5 Aug 2022 15:40:42 +0000 (17:40 +0200)] 
Use function format attribute where applicable

Allow the compiler to verify the format string against the supplied
arguments.

    chage.c:239:51: warning: format not a string literal, format string not checked [-Wformat-nonliteral]
      239 |                 (void) strftime (buf, sizeof buf, format, tp);
          |                                                   ^~~~~~

3 years agoDrop unused function subid_init()
Christian Göttsche [Fri, 5 Aug 2022 15:40:39 +0000 (17:40 +0200)] 
Drop unused function subid_init()

3 years agoDrop obsolete prototype for log_dolog()
Christian Göttsche [Fri, 5 Aug 2022 15:40:37 +0000 (17:40 +0200)] 
Drop obsolete prototype for log_dolog()

log_dolog() is neither implemented nor used.

3 years agoDrop superfluous const from return type
Christian Göttsche [Fri, 5 Aug 2022 15:40:36 +0000 (17:40 +0200)] 
Drop superfluous const from return type

    salt.c:102:22: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
      102 | static /*@observer@*/const unsigned long SHA_get_salt_rounds (/*@null@*/int *prefered_rounds);
          |                      ^~~~~
    salt.c:110:22: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
      110 | static /*@observer@*/const unsigned long YESCRYPT_get_salt_cost (/*@null@*/int *prefered_cost);
          |                      ^~~~~

    subordinateio.c:160:8: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
      160 | static const bool range_exists(struct commonio_db *db, const char *owner)
          |        ^~~~~

3 years agoAdd include for uid_t
Christian Göttsche [Fri, 5 Aug 2022 15:40:34 +0000 (17:40 +0200)] 
Add include for uid_t

Allow IDEs to parse the header file on its own.

3 years agoDrop unnecessary prototype
Christian Göttsche [Fri, 5 Aug 2022 15:40:33 +0000 (17:40 +0200)] 
Drop unnecessary prototype

The function is defined directly after.

3 years agoDeclare read-only data const
Christian Göttsche [Fri, 5 Aug 2022 15:40:31 +0000 (17:40 +0200)] 
Declare read-only data const

3 years agoDrop register keyword
Christian Göttsche [Fri, 5 Aug 2022 15:40:29 +0000 (17:40 +0200)] 
Drop register keyword

Compilers are free to ignore the indented hint and modern optimizations
should create good code by themself.

(As such it is for example deprecated in C++17.)

3 years agoReturn void pointer from xmalloc
Christian Göttsche [Fri, 5 Aug 2022 15:40:28 +0000 (17:40 +0200)] 
Return void pointer from xmalloc

xmalloc is a wrapper around malloc(3), which bails out on OOM failures.
As such it returns raw memory and is used to allocated all kind of
types.

3 years agoDeclare read-only parameters const
Christian Göttsche [Fri, 5 Aug 2022 15:40:26 +0000 (17:40 +0200)] 
Declare read-only parameters const

Signal callers arguments are not going to be modified and allow passing
const pointers.

3 years agopo: update translations
Christian Göttsche [Fri, 5 Aug 2022 15:40:24 +0000 (17:40 +0200)] 
po: update translations

Add language identifiers and fix line break.

3 years agoconfigure.ac: bump gettext version
Christian Göttsche [Fri, 5 Aug 2022 15:40:21 +0000 (17:40 +0200)] 
configure.ac: bump gettext version

Version 1.19.1 was released in June 2014.

    configure.ac:697: warning: AM_PROG_MKDIR_P: this macro is deprecated, and will soon be removed.
    configure.ac:697: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
    configure.ac:697: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
    ./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
    aclocal.m4:780: AM_PROG_MKDIR_P is expanded from...
    m4/po.m4:23: AM_PO_SUBDIRS is expanded from...
    m4/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
    configure.ac:697: the top level
    configure.ac:697: warning: The macro `AC_TRY_LINK' is obsolete.
    configure.ac:697: You should run autoupdate.
    ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
    lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
    lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
    ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
    ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
    m4/gettext.m4:365: gt_INTL_MACOSX is expanded from...
    m4/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
    configure.ac:697: the top level
    configure.ac:697: warning: The macro `AC_TRY_LINK' is obsolete.
    configure.ac:697: You should run autoupdate.
    ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
    lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
    lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
    ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
    ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
    m4/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
    configure.ac:697: the top level
    configure.ac:697: warning: The macro `AC_TRY_LINK' is obsolete.
    configure.ac:697: You should run autoupdate.
    ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
    lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
    lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
    ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
    ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
    m4/iconv.m4:20: AM_ICONV_LINK is expanded from...
    m4/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
    configure.ac:697: the top level

3 years agoconfigure.ac: replace deprecated aliases
Christian Göttsche [Fri, 5 Aug 2022 15:40:12 +0000 (17:40 +0200)] 
configure.ac: replace deprecated aliases

See https://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html

    configure.ac:25: warning: The macro `AM_ENABLE_STATIC' is obsolete.
    configure.ac:25: You should run autoupdate.
    m4/ltoptions.m4:259: AM_ENABLE_STATIC is expanded from...
    configure.ac:25: the top level
    configure.ac:26: warning: The macro `AM_ENABLE_SHARED' is obsolete.
    configure.ac:26: You should run autoupdate.
    m4/ltoptions.m4:205: AM_ENABLE_SHARED is expanded from...
    configure.ac:26: the top level

3 years agoFix E_NAME_IN_USE documentation.
Jeremy Whiting [Wed, 27 Jul 2022 18:02:12 +0000 (12:02 -0600)] 
Fix E_NAME_IN_USE documentation.

Since code gives this error if username or group name is already
used the documentation should reflect that.

3 years agoFix CI by testing Ubuntu 22.04 instead of 21.10.
Jeremy Whiting [Sat, 6 Aug 2022 15:48:53 +0000 (09:48 -0600)] 
Fix CI by testing Ubuntu 22.04 instead of 21.10.

Since Ubuntu 21.10 has gone out of support it no longer works for
testing with CI. Instead use 22.04 which is still supported.

3 years agotests: add a case for testing -F option of useradd
Masatake YAMATO [Wed, 20 Jul 2022 08:40:11 +0000 (17:40 +0900)] 
tests: add a case for testing -F option of useradd

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agouseradd: add -F option for updating /etc/sub[ig]id for system accounts
Masatake YAMATO [Wed, 20 Jul 2022 02:17:16 +0000 (11:17 +0900)] 
useradd: add -F option for updating /etc/sub[ig]id for system accounts

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agouseradd: make the option specstr passed to getopt_long extensible
Masatake YAMATO [Wed, 20 Jul 2022 01:43:02 +0000 (10:43 +0900)] 
useradd: make the option specstr passed to getopt_long extensible

It was hard to extend the option specification string passed to
getopt_long as the third argument.

The origian code had a branch with WITH_SELINUX ifdef condition. If
one wants to add one more option char with another ifdef condition
like ENABLE_SUBIDS to the spec, the one must enumerate the specs for
all combinations of the conditions:

*  WITH_SELINUX &&  ENABLE_SUBIDS
*  WITH_SELINUX && !ENABLE_SUBIDS
* !WITH_SELINUX &&  ENABLE_SUBIDS
* !WITH_SELINUX && !ENABLE_SUBIDS

With this change, you can append an option char to the spec.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agosubordinateio: also compare the owner ID
Iker Pedrosa [Wed, 13 Jul 2022 07:55:14 +0000 (09:55 +0200)] 
subordinateio: also compare the owner ID

IDs already populate /etc/subuid and /etc/subgid files so it's necessary
not only to check for the owner name but also for the owner ID of a
given range.

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

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoman (useradd): add a note about -r option and /etc/subuid and subgid
Masatake YAMATO [Wed, 13 Jul 2022 16:58:33 +0000 (01:58 +0900)] 
man (useradd): add a note about -r option and /etc/subuid and subgid

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
3 years agoFix typo
Alexander Zhang [Wed, 6 Jul 2022 21:41:09 +0000 (14:41 -0700)] 
Fix typo

3 years agofix Changelog typo
Serge Hallyn [Tue, 5 Jul 2022 13:49:15 +0000 (08:49 -0500)] 
fix Changelog typo

Spotted by cgzones.

3 years agoUpdate changelog
Serge Hallyn [Mon, 4 Jul 2022 19:30:09 +0000 (14:30 -0500)] 
Update changelog

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agolibmisc: use /dev/urandom as a generic fallback for read_random_bytes()
Xi Ruoyao [Mon, 13 Jun 2022 08:44:14 +0000 (16:44 +0800)] 
libmisc: use /dev/urandom as a generic fallback for read_random_bytes()

On systems with Linux kernel < 3.17, getentropy() and getrandom() may
exist but return ENOSYS.  Use /dev/urandom as a fallback to avoid a hard
requirement on Linux kernel version.

Fixes #512.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
3 years agoCI: update actions version
Iker Pedrosa [Wed, 1 Jun 2022 11:22:22 +0000 (13:22 +0200)] 
CI: update actions version

CodeQL Action v1 is being deprecated and v2 needs to be used instead.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoCI: enable CodeQL analyzer
Iker Pedrosa [Mon, 9 May 2022 14:06:38 +0000 (16:06 +0200)] 
CI: enable CodeQL analyzer

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoCI: create Github workflow to install dependencies
Iker Pedrosa [Mon, 9 May 2022 14:17:57 +0000 (16:17 +0200)] 
CI: create Github workflow to install dependencies

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoComplete Ukrainian translation
Yuri Chornoivan [Sat, 21 May 2022 17:49:25 +0000 (20:49 +0300)] 
Complete Ukrainian translation

3 years agoUpdate Ukrainian translation
Yuri Chornoivan [Fri, 20 May 2022 18:46:54 +0000 (21:46 +0300)] 
Update Ukrainian translation

3 years agoAdd Ukrainian translation for man pages
Yuri Chornoivan [Thu, 19 May 2022 19:01:55 +0000 (22:01 +0300)] 
Add Ukrainian translation for man pages

3 years agoInitialize local variables
Iker Pedrosa [Mon, 16 May 2022 15:24:58 +0000 (17:24 +0200)] 
Initialize local variables

CWE-457 by CodeQL.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoAdd header guards
Iker Pedrosa [Tue, 10 May 2022 13:26:15 +0000 (15:26 +0200)] 
Add header guards

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoRemove commented out code and FIXMEs
Iker Pedrosa [Tue, 10 May 2022 13:01:21 +0000 (15:01 +0200)] 
Remove commented out code and FIXMEs

In order to remove some of the FIXMEs it was necessary to change the
code and call getulong() instead of getlong().

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoRemove redeclared variable
Iker Pedrosa [Tue, 10 May 2022 11:23:07 +0000 (13:23 +0200)] 
Remove redeclared variable

No need to redeclare a variable with the same name and type. Just keep
the one with the biggest scope.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoUpdate Ukrainian translation
Yuri Chornoivan [Mon, 16 May 2022 16:38:39 +0000 (19:38 +0300)] 
Update Ukrainian translation

3 years agotests: replace egrep -> grep -E
Sam James [Sun, 15 May 2022 01:37:11 +0000 (01:37 +0000)] 
tests: replace egrep -> grep -E

"egrep" is an obsolete alias for grep -E and newer greps will warn on usage
of egrep, so let's just swap it out.

Signed-off-by: Sam James <sam@gentoo.org>
3 years agoconfigure: replace obsolete autoconf macros
Christian Göttsche [Mon, 9 May 2022 16:36:02 +0000 (18:36 +0200)] 
configure: replace obsolete autoconf macros

Replace
 AC_HELP_STRING by AS_HELP_STRING,
 AC_GNU_SOURCE by AC_USE_SYSTEM_EXTENSIONS,
 AC_TRY_COMPILE by AC_COMPILE_IFELSE and
 AM_PROG_LIBTOOL by LT_INIT.

See https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html

3 years agosrc: correct "badname" option
Iker Pedrosa [Wed, 4 May 2022 07:33:59 +0000 (09:33 +0200)] 
src: correct "badname" option

Change "badnames" to "badname" as this is the accepted option name.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoman: correct "badname" option
Iker Pedrosa [Wed, 27 Apr 2022 14:59:03 +0000 (16:59 +0200)] 
man: correct "badname" option

Change "badnames" to "badname" as this is the accepted option name.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agopo: update translation files
Iker Pedrosa [Wed, 27 Apr 2022 14:53:39 +0000 (16:53 +0200)] 
po: update translation files

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoSuggest badname if name has special characters
Iker Pedrosa [Tue, 26 Apr 2022 14:45:04 +0000 (16:45 +0200)] 
Suggest badname if name has special characters

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

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agopasswd: erase password copy on all error branches
Christian Göttsche [Mon, 25 Apr 2022 10:17:40 +0000 (12:17 +0200)] 
passwd: erase password copy on all error branches

3 years agousermod: fix alphabetical order in help message
Matheus Marques [Sun, 24 Apr 2022 19:16:58 +0000 (16:16 -0300)] 
usermod: fix alphabetical order in help message

3 years agoWork around git safe.directory enforcement
Serge Hallyn [Mon, 25 Apr 2022 15:42:41 +0000 (10:42 -0500)] 
Work around git safe.directory enforcement

Git wants to ensure that you do not read .git owned by other users.
But we fetch+build as 'build' user, and run tests as root user.  Those
tests calculate git topdir using git rev-parse --show-toplevel, which
git now fails.

Setting safe.directory, seems wrong.  Let's just use bash to figure
out the top dir.

3 years agochpasswd: add IS_CRYPT_METHOD
juyin [Sat, 2 Apr 2022 03:48:51 +0000 (11:48 +0800)] 
chpasswd: add IS_CRYPT_METHOD

Use macro IS_CRYPT_METHOD instead of ’strcmp(crypt_method, xx)==0’ to make the code more cleanup

3 years agorefactor get_salt function
juyin [Fri, 1 Apr 2022 01:26:29 +0000 (09:26 +0800)] 
refactor get_salt function

refactor get_salt function to make it easier to read.

3 years agochpasswd: fix function problem with -R parameter
juyin [Thu, 31 Mar 2022 08:48:52 +0000 (16:48 +0800)] 
chpasswd: fix function problem with -R parameter

Generating salt value depends on /dev/urandom. But after the
function process_root_flag changed the root directory, It does
not exist.

So, generate salt value before changeing the directory.

Fixes: #514
3 years agochpasswd: add get_salt for generating salt value
juyin [Thu, 31 Mar 2022 08:45:19 +0000 (16:45 +0800)] 
chpasswd: add get_salt for generating salt value

The function that generates the salt value is extracted separately, and it is more convenient to modify it later.

3 years agolibmisc: add check fopen return value in read_random_bytes()
juyin [Wed, 30 Mar 2022 11:21:32 +0000 (19:21 +0800)] 
libmisc: add check fopen return value in read_random_bytes()

Returns null when fopen fails. Then, using fread with a null pointer will cause a segfault.

Signed-off-by: Yan Zhu <zhuyan34@huawei.com>
3 years agoHandle ERANGE error correctly
Niko [Tue, 1 Mar 2022 13:43:07 +0000 (14:43 +0100)] 
Handle ERANGE error correctly

The reentrant functions getgrgid_r, getgrnam_r, getpwnam_r, etc. all return an error code instead of setting errno. Adapt the error check accordingly.

3 years agoAUTHORS: improve markdown output
Iker Pedrosa [Tue, 15 Mar 2022 08:29:04 +0000 (09:29 +0100)] 
AUTHORS: improve markdown output

The markdown output for the maintainers, authors and contributors list
was wrapped in a single line and it was difficult to read. I've created
an unordered list to get a better output. On top of that I've also added
myself as a maintainer.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoChange to strncat
Steve Grubb [Fri, 18 Mar 2022 19:35:02 +0000 (15:35 -0400)] 
Change to strncat

ut_line is declared as a nonstring in bits/utmp.h. It might not be NUL
terminated. Limit how much it copies to the size of the array.

3 years agoFix code comment
ed neville [Sat, 12 Mar 2022 08:22:31 +0000 (08:22 +0000)] 
Fix code comment

Improving check around pw_dir which may be NULL

3 years agoCI: add fedora to build
Iker Pedrosa [Fri, 11 Mar 2022 14:38:13 +0000 (15:38 +0100)] 
CI: add fedora to build

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoFix syntax error in usermod man source.
Adam Sampson [Mon, 7 Mar 2022 23:51:18 +0000 (23:51 +0000)] 
Fix syntax error in usermod man source.

Signed-off-by: Adam Sampson <ats@offog.org>
3 years agoImprove groupadd and useradd manpage
Markus Hiereth [Mon, 7 Mar 2022 00:48:22 +0000 (18:48 -0600)] 
Improve groupadd and useradd manpage

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoupdate useradd homepage
Markus Hiereth [Mon, 7 Mar 2022 00:37:39 +0000 (18:37 -0600)] 
update useradd homepage

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoManpage improvements for usermod
Markus Hiereth [Mon, 7 Mar 2022 00:12:13 +0000 (18:12 -0600)] 
Manpage improvements for usermod

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoImprove groups and id manpages
Markus Hiereth [Sun, 6 Mar 2022 23:59:41 +0000 (17:59 -0600)] 
Improve groups and id manpages

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoImprove pwck manpage
Markus Hiereth [Sun, 6 Mar 2022 23:53:02 +0000 (17:53 -0600)] 
Improve pwck manpage

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
3 years agofix PAM service files --without-selinux
Ali Riza KESKIN [Fri, 4 Mar 2022 11:48:54 +0000 (11:48 +0000)] 
fix PAM service files --without-selinux

Make pam_selinux.so optional in environments where the module isn't provided.

3 years agoconfigure.ac: Default to max group name length of 32
Jami Kettunen [Fri, 18 Feb 2022 05:20:20 +0000 (07:20 +0200)] 
configure.ac: Default to max group name length of 32

This used to be 16 for historical reasons but these days basically every
distro configures --with-group-name-max-length=32 to make it match the
max Linux username length, make it default.

Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
3 years agoUpdate Spanish translation
feer9 [Mon, 14 Feb 2022 20:19:42 +0000 (17:19 -0300)] 
Update Spanish translation

3 years agoUpdate Spanish translation
Fernando [Mon, 14 Feb 2022 00:43:23 +0000 (21:43 -0300)] 
Update Spanish translation

I changed the order of some words to be easier to understand

3 years agoconfigure.ac: fix occurance of with-pam (should be with-libpam)
Serge Hallyn [Fri, 4 Feb 2022 18:28:18 +0000 (12:28 -0600)] 
configure.ac: fix occurance of with-pam (should be with-libpam)

Closes #500

Reported-by: dpa-github@aegee.org
Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agopo/fr.po: Fix a few typos
Balint Reczey [Wed, 26 Jan 2022 16:53:28 +0000 (17:53 +0100)] 
po/fr.po: Fix a few typos

3 years agoUpdated French translations
bubu [Wed, 26 Jan 2022 16:36:44 +0000 (17:36 +0100)] 
Updated French translations

Proofread by the debian-l10n-french mailing list contributors.

Link: https://bugs.debian.org/1004242
3 years agoMake libsubid more easily usable from C++
Alois Wohlschlager [Wed, 19 Jan 2022 10:39:53 +0000 (11:39 +0100)] 
Make libsubid more easily usable from C++

C++ requires extern "C" linkage specification to call functions from a C
library. Enclose the function definitions in subid.h in an extern "C"
block if compiling in C++ mode to achieve this.

Signed-off-by: Alois Wohlschlager <alois1@gmx-topmail.de>
3 years agouseradd: modify check ID range for system users
Iker Pedrosa [Tue, 4 Jan 2022 12:06:00 +0000 (13:06 +0100)] 
useradd: modify check ID range for system users

useradd warns that a system user ID less than SYS_UID_MIN is outside the
expected range, even though that ID has been specifically selected with
the "-u" option.

In my opinion all the user ID's below SYS_UID_MAX are for the system,
thus I change the condition to take that into account.

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

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agonss: get shadow_logfd with log_get_logfd()
Iker Pedrosa [Mon, 10 Jan 2022 14:30:28 +0000 (15:30 +0100)] 
nss: get shadow_logfd with log_get_logfd()

If /etc/nsswitch.conf doesn't exist podman crashes because shadow_logfd
is NULL. In order to avoid that load the log file descriptor with the
log_get_logfd() helper function.

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

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
3 years agoUse 'void' instead of 'RETSIGTYPE'. Use 'sighandler_t' too.
Alejandro Colomar [Thu, 30 Dec 2021 15:36:18 +0000 (16:36 +0100)] 
Use 'void' instead of 'RETSIGTYPE'.  Use 'sighandler_t' too.

C89 and POSIX.1-2001 define signal(2) as returning a pointer to a
function returning 'void'.  K&R C signal(2) signature is obsolete.
Use 'void' directly.

Also, instead of writing the function pointer type explicitly, use
POSIX's 'sighandler_t'.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoRemove AC_HEADER_TIME and TIME_WITH_SYS_TIME checks
Alejandro Colomar [Thu, 30 Dec 2021 15:12:15 +0000 (16:12 +0100)] 
Remove AC_HEADER_TIME and TIME_WITH_SYS_TIME checks

Systems on which <sys/time.h> conflicted with <time.h> are obsolete.

This macro has been marked as obsolete by autoconf documentation.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoautoconf: Remove check for struct stat.st_rdev
Alejandro Colomar [Thu, 30 Dec 2021 15:04:38 +0000 (16:04 +0100)] 
autoconf: Remove check for struct stat.st_rdev

It is defined by POSIX.1-2001.  Let's assume it always exists.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoautoconf: Remove AC_C_CONST
Alejandro Colomar [Thu, 30 Dec 2021 14:52:04 +0000 (15:52 +0100)] 
autoconf: Remove AC_C_CONST

All current compilers support C89's 'const' keyword.
Autoconf declares this macro as obsolescent.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoRemove AC_HEADER_STAT and STAT_MACROS_BROKEN
Alejandro Colomar [Thu, 30 Dec 2021 14:47:22 +0000 (15:47 +0100)] 
Remove AC_HEADER_STAT and STAT_MACROS_BROKEN

As autoconf documentation says, this macro is obsolescent, as no
current systems have the bug in S_ISDIR, S_ISREG, etc..
The affected systems were Tektronix UTekV, Amdahl UTS, and
Motorola System V/88.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoautoconf: Remove AC_ISC_POSIX
Alejandro Colomar [Thu, 30 Dec 2021 14:32:17 +0000 (15:32 +0100)] 
autoconf: Remove AC_ISC_POSIX

INTERACTIVE Systems Corporation Unix is no longer sold, and Sun
said (long ago) that it would drop support for it on 2006-07-23.
So this macro has been obsolete for more than a decade.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoautoconf: Remove AC_TYPE_MODE_T
Alejandro Colomar [Thu, 30 Dec 2021 14:15:50 +0000 (15:15 +0100)] 
autoconf: Remove AC_TYPE_MODE_T

'mode_t' is defined by POSIX.1-2001 in <sys/types.h>.
It's unlikely to be missing.

See mode_t(3).

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoautoconf: Remove AC_TYPE_PID_T
Alejandro Colomar [Thu, 30 Dec 2021 14:15:50 +0000 (15:15 +0100)] 
autoconf: Remove AC_TYPE_PID_T

'pid_t' is defined by POSIX.1-2001 in <sys/types.h>.
It's unlikely to be missing.

See pid_t(3).

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoautoconf: Remove AC_TYPE_OFF_T
Alejandro Colomar [Thu, 30 Dec 2021 14:15:50 +0000 (15:15 +0100)] 
autoconf: Remove AC_TYPE_OFF_T

'off_t' is defined by POSIX.1-2001 in <sys/types.h>.
It's unlikely to be missing.

See off_t(3).

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoautoconf: Remove AC_TYPE_UID_T
Alejandro Colomar [Thu, 30 Dec 2021 14:15:50 +0000 (15:15 +0100)] 
autoconf: Remove AC_TYPE_UID_T

'uid_t' is defined by POSIX.1-2001 in <sys/types.h>.
It's unlikely to be missing.

See uid_t(3).

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoRemove unused autoconf check: ruserok(3)
Alejandro Colomar [Thu, 30 Dec 2021 14:10:01 +0000 (15:10 +0100)] 
Remove unused autoconf check: ruserok(3)

The macro HAVE_RUSEROK is not being used anywhere.

As the Linux manual page says, ruserok(3) is present on the BDSs, Solaris, and many other systems.  This function appeared in 4.2BSD.  So we probably can rely on its existence.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoRemove unused autoconf check: getaddrinfo(3)
Alejandro Colomar [Thu, 30 Dec 2021 14:05:47 +0000 (15:05 +0100)] 
Remove unused autoconf check: getaddrinfo(3)

The macro HAVE_GETADDRINFO is not being used anywhere.

BTW, the function is defined by POSIX.1-2001 and RFC 2553, so it's likely that it is always available.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoRemove unused autoconf check: sigaction(3)
Alejandro Colomar [Thu, 30 Dec 2021 14:02:02 +0000 (15:02 +0100)] 
Remove unused autoconf check: sigaction(3)

The macro HAVE_SIGACTION is not being used anywhere.

BTW, the function is defined by SVr4 and POSIX.1-2001, so it's likely that it is always available.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoRemove unused autoconf check: gettimeofday(3)
Alejandro Colomar [Thu, 30 Dec 2021 13:56:52 +0000 (14:56 +0100)] 
Remove unused autoconf check: gettimeofday(3)

The macro HAVE_GETTIMEOFDAY is not being used anywhere.

BTW, the function is defined by SVr4, 4.3BSD, and POSIX.1-2001, so
it's likely that it is always available.

POSIX.1-2008 marks it as obsolete, but only because
clock_gettime(2) provides more precission.  Since gettimeofday(3)
is in use by many big projects, and it has no obvious dangers,
it's likely that it will continue to exist even if it's outside of
the POSIX standard.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>