mirror of
https://github.com/shadow-maint/shadow.git
synced 2026-01-31 08:14:08 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7eca27114 | ||
|
|
759fc9a485 | ||
|
|
167a6b7a75 | ||
|
|
6b1d7aafce | ||
|
|
e0758f361c | ||
|
|
1a280cd264 |
@ -5,7 +5,7 @@ m4_define([libsubid_abi_minor], [0])
|
||||
m4_define([libsubid_abi_micro], [0])
|
||||
m4_define([libsubid_abi], [libsubid_abi_major.libsubid_abi_minor.libsubid_abi_micro])
|
||||
|
||||
AC_INIT([shadow], [4.19.0], [pkg-shadow-devel@lists.alioth.debian.org], [],
|
||||
AC_INIT([shadow], [4.19.2], [pkg-shadow-devel@lists.alioth.debian.org], [],
|
||||
[https://github.com/shadow-maint/shadow])
|
||||
AC_CONFIG_MACRO_DIRS([m4])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
||||
@ -7,6 +7,9 @@
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "string/strcmp/streq.h"
|
||||
#include "string/strcmp/strprefix.h"
|
||||
|
||||
|
||||
/*
|
||||
* match_regex - return true if match, false if not
|
||||
@ -37,6 +40,15 @@ match_regex(const char *pattern, const char *string)
|
||||
bool
|
||||
is_valid_hash(const char *hash)
|
||||
{
|
||||
hash = strprefix(hash, "!") ?: hash;
|
||||
|
||||
// Passwordless account; discouraged
|
||||
if (streq(hash, ""))
|
||||
return true;
|
||||
|
||||
if (streq(hash, "*"))
|
||||
return true;
|
||||
|
||||
// Minimum hash length
|
||||
if (strlen(hash) < 13)
|
||||
return false;
|
||||
|
||||
@ -1388,6 +1388,48 @@ process_flags(int argc, char **argv, struct option_flags *flags)
|
||||
}
|
||||
#endif /* WITH_SELINUX */
|
||||
|
||||
if (user_newid == user_id) {
|
||||
uflg = false;
|
||||
oflg = false;
|
||||
}
|
||||
if (user_newgid == user_gid) {
|
||||
gflg = false;
|
||||
}
|
||||
if ( (NULL != user_newshell)
|
||||
&& streq(user_newshell, user_shell)) {
|
||||
sflg = false;
|
||||
}
|
||||
if (streq(user_newname, user_name)) {
|
||||
lflg = false;
|
||||
}
|
||||
if (user_newinactive == user_inactive) {
|
||||
fflg = false;
|
||||
}
|
||||
if (user_newexpire == user_expire) {
|
||||
eflg = false;
|
||||
}
|
||||
if ( (NULL != user_newhome)
|
||||
&& streq(user_newhome, user_home)) {
|
||||
dflg = false;
|
||||
mflg = false;
|
||||
}
|
||||
if ( (NULL != user_newcomment)
|
||||
&& streq(user_newcomment, user_comment)) {
|
||||
cflg = false;
|
||||
}
|
||||
|
||||
if (!(Uflg || uflg || sflg || pflg || mflg || Lflg ||
|
||||
lflg || Gflg || gflg || fflg || eflg || dflg || cflg
|
||||
#ifdef ENABLE_SUBIDS
|
||||
|| vflg || Vflg || wflg || Wflg
|
||||
#endif /* ENABLE_SUBIDS */
|
||||
#ifdef WITH_SELINUX
|
||||
|| Zflg
|
||||
#endif /* WITH_SELINUX */
|
||||
)) {
|
||||
exit (E_SUCCESS);
|
||||
}
|
||||
|
||||
if (!is_shadow_pwd && (eflg || fflg)) {
|
||||
fprintf (stderr,
|
||||
_("%s: shadow passwords required for -e and -f\n"),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user