Compare commits

...

6 Commits

Author SHA1 Message Date
Alejandro Colomar 22656c36a2 Release 4.14.2
Link: <https://github.com/shadow-maint/shadow/pull/824>
Reviewed-by: Michael Vetter <jubalh@iodoru.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-10-30 00:14:15 +01:00
Michael Vetter 11071522a2 man: document --prefix option in chage, chpasswd and passwd
Support for `--prefix` was added in
https://github.com/shadow-maint/shadow/pull/714 and is available since
shadow 4.14.0.

Close https://github.com/shadow-maint/shadow/issues/822

Cherry-picked-from: 01f6258df7 ("man: document --prefix option in chage, chpasswd and passwd")
Link: <https://github.com/shadow-maint/shadow/pull/823>
Suggested-by: Michael Vetter <jubalh@iodoru.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-10-30 00:00:28 +01:00
Johannes Segitz 909036d714 useradd: Set proper SELinux labels for def_usrtemplate
Fixes: 74c17c716 ("Add support for skeleton files from /usr/etc/skel")

Signed-off-by: Johannes Segitz <jsegitz@suse.com>
Cherry-picked-from: 48aa12af31
Link: <https://github.com/shadow-maint/shadow/pull/812>
Reviewed-by: Michael Vetter <jubalh@iodoru.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-10-30 00:00:24 +01:00
Iker Pedrosa de50b39475 utmp: call prepare_utmp() even if utent is NULL
update_utmp() should also return 0 when success.

Fixes: 1f368e1c18 ("utmp: update
`update_utmp()")
Resolves: https://github.com/shadow-maint/shadow/issues/805

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Cherry-picked-from: 5178f8c5af
Link: <https://github.com/shadow-maint/shadow/issues/805>
Link: <https://github.com/shadow-maint/shadow/pull/808>
Reviewed-by: Michael Vetter <jubalh@iodoru.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-10-30 00:00:19 +01:00
Christian Göttsche b5c99ec30e lib/btrfs: avoid NULL-dereference
btrfs.c:42:13: warning: use of NULL 'cmd' where non-null expected [CWE-476] [-Wanalyzer-null-argument]

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: 54ab542887
Link: <https://github.com/shadow-maint/shadow/pull/770>
Reviewed-by: Michael Vetter <jubalh@iodoru.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-10-30 00:00:15 +01:00
Heiko Becker 58b96645c9 Replace __{BEGIN,END}_DECLS with #ifdef __cplusplus
Fixes the build with musl libc.

Cherry-picked-from: 890f911e17
Link: <https://github.com/shadow-maint/shadow/pull/789>
Reviewed-by: Michael Vetter <jubalh@iodoru.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-10-30 00:00:10 +01:00
8 changed files with 59 additions and 11 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ m4_define([libsubid_abi_major], 4)
m4_define([libsubid_abi_minor], 0) m4_define([libsubid_abi_minor], 0)
m4_define([libsubid_abi_micro], 0) m4_define([libsubid_abi_micro], 0)
m4_define([libsubid_abi], [libsubid_abi_major.libsubid_abi_minor.libsubid_abi_micro]) m4_define([libsubid_abi], [libsubid_abi_major.libsubid_abi_minor.libsubid_abi_micro])
AC_INIT([shadow], [4.14.1], [pkg-shadow-devel@lists.alioth.debian.org], [], AC_INIT([shadow], [4.14.2], [pkg-shadow-devel@lists.alioth.debian.org], [],
[https://github.com/shadow-maint/shadow]) [https://github.com/shadow-maint/shadow])
AM_INIT_AUTOMAKE([1.11 foreign dist-xz]) AM_INIT_AUTOMAKE([1.11 foreign dist-xz])
AC_CONFIG_MACRO_DIRS([m4]) AC_CONFIG_MACRO_DIRS([m4])
+1 -1
View File
@@ -39,7 +39,7 @@ static int run_btrfs_subvolume_cmd(const char *subcmd, const char *arg1, const c
NULL NULL
}; };
if (access(cmd, X_OK)) { if (!cmd || access(cmd, X_OK)) {
return 1; return 1;
} }
+6 -2
View File
@@ -36,8 +36,12 @@
#endif #endif
#include <sys/types.h> #include <sys/types.h>
__BEGIN_DECLS #ifdef __cplusplus
extern "C" {
#endif
char * readpassphrase(const char *, char *, size_t, int); char * readpassphrase(const char *, char *, size_t, int);
__END_DECLS #ifdef __cplusplus
}
#endif
#endif /* !LIBBSD_READPASSPHRASE_H */ #endif /* !LIBBSD_READPASSPHRASE_H */
+5 -6
View File
@@ -368,17 +368,16 @@ int update_utmp (const char *user,
struct utmp *utent, *ut; struct utmp *utent, *ut;
utent = get_current_utmp (); utent = get_current_utmp ();
if (utent == NULL) {
return -1;
}
ut = prepare_utmp (user, tty, host, utent); ut = prepare_utmp (user, tty, host, utent);
(void) setutmp (ut); /* make entry in the utmp & wtmp files */ (void) setutmp (ut); /* make entry in the utmp & wtmp files */
free (utent);
if (utent != NULL) {
free (utent);
}
free (ut); free (ut);
return 1; return 0;
} }
void record_failure(const char *failent_user, void record_failure(const char *failent_user,
+15
View File
@@ -198,6 +198,21 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<option>-P</option>, <option>--prefix</option>&nbsp;<replaceable>PREFIX_DIR</replaceable>
</term>
<listitem>
<para>
Apply changes to configuration files under the root filesystem
found under the directory <replaceable>PREFIX_DIR</replaceable>.
This option does not chroot and is intended for preparing a cross-compilation
target. Some limitations: NIS and LDAP users/groups are
not verified. PAM authentication is using the host files.
No SELINUX support.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<option>-W</option>, <option>--warndays</option>&nbsp;<replaceable>WARN_DAYS</replaceable> <option>-W</option>, <option>--warndays</option>&nbsp;<replaceable>WARN_DAYS</replaceable>
+15
View File
@@ -173,6 +173,21 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<option>-P</option>, <option>--prefix</option>&nbsp;<replaceable>PREFIX_DIR</replaceable>
</term>
<listitem>
<para>
Apply changes to configuration files under the root filesystem
found under the directory <replaceable>PREFIX_DIR</replaceable>.
This option does not chroot and is intended for preparing a cross-compilation
target. Some limitations: NIS and LDAP users/groups are
not verified. PAM authentication is using the host files.
No SELINUX support.
</para>
</listitem>
</varlistentry>
<varlistentry condition="sha_crypt"> <varlistentry condition="sha_crypt">
<term> <term>
<option>-s</option>, <option>--sha-rounds</option>&nbsp;<replaceable>ROUNDS</replaceable> <option>-s</option>, <option>--sha-rounds</option>&nbsp;<replaceable>ROUNDS</replaceable>
+15
View File
@@ -280,6 +280,21 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<option>-P</option>, <option>--prefix</option>&nbsp;<replaceable>PREFIX_DIR</replaceable>
</term>
<listitem>
<para>
Apply changes to configuration files under the root filesystem
found under the directory <replaceable>PREFIX_DIR</replaceable>.
This option does not chroot and is intended for preparing a cross-compilation
target. Some limitations: NIS and LDAP users/groups are
not verified. PAM authentication is using the host files.
No SELINUX support.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<option>-S</option>, <option>--status</option> <option>-S</option>, <option>--status</option>
+1 -1
View File
@@ -2787,7 +2787,7 @@ int main (int argc, char **argv)
if (home_added) { if (home_added) {
copy_tree (def_template, prefix_user_home, false, true, copy_tree (def_template, prefix_user_home, false, true,
(uid_t)-1, user_id, (gid_t)-1, user_gid); (uid_t)-1, user_id, (gid_t)-1, user_gid);
copy_tree (def_usrtemplate, prefix_user_home, false, false, copy_tree (def_usrtemplate, prefix_user_home, false, true,
(uid_t)-1, user_id, (gid_t)-1, user_gid); (uid_t)-1, user_id, (gid_t)-1, user_gid);
} else { } else {
fprintf (stderr, fprintf (stderr,