void-packages/srcpkgs/shadow/patches/fix-load_defaults.patch

36 lines
955 B
Diff

From 507f96cdeb54079fb636c7ce21e371f7a16a520e Mon Sep 17 00:00:00 2001
From: Tomas Mraz <tmraz@fedoraproject.org>
Date: Thu, 25 Aug 2016 11:20:34 +0200
Subject: [PATCH] Fix regression in useradd not loading defaults properly.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The get_defaults() has to be called before processing the flags.
Signed-off-by: Tomáš Mráz <tmraz@fedoraproject.org>
---
src/useradd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- src/useradd.c.orig
+++ src/useradd.c
@@ -2027,6 +2027,8 @@ int main (int argc, char **argv)
is_shadow_grp = sgr_file_present ();
#endif
+ get_defaults ();
+
process_flags (argc, argv);
#ifdef ENABLE_SUBIDS
@@ -2036,8 +2038,6 @@ int main (int argc, char **argv)
(!user_id || (user_id <= uid_max && user_id >= uid_min));
#endif /* ENABLE_SUBIDS */
- get_defaults ();
-
#ifdef ACCT_TOOLS_SETUID
#ifdef USE_PAM
{