36577fca4e
* Spawn: don't loop forever on ECHILD * Do not fail locking if there is a stale lockfile (Tomas Mraz) * Use lckpwdf if prefix not set (Tomas Mraz) * Build: check correct DocBook version (Jan Tojnar) * Usermod: Print 'no changes' to stdout, not stderr (Serge Hallyn) * Add support for btrfs subvolumes for home (Adam Majer) * Fix chpasswd long line handling (Nathan Ruiz) * Use secure_getenv for gettime (Chris Lamb) * Make sp_lstchg reproducible (Chris Lamb) * Do not crash commonio_close if db file is not open (Tomas Mraz) * Don't flush nscd and sssd cache in read-only mode (Charlie Vuillemez) * French manpage update (Alban VIDAL) * Fix manpage defaults for SUB_UID/GID_COUNT (Tomas Mraz) * Sync po files from shadow.pot (Alban VIDAL) * Usermod: guard against unsafe chown of homedir contents (Tomas Mraz) * Add LASTLOG_UID_MAX to login.defs (Tomas Mraz) * new[ug]idmap file capabilities support (Giuseppe Scrivano and Christian Brauner) * Fix segfault in useradd (Tomas Mraz) * Coverity issues (Tomas Mraz) * Flush sssd caches (Jakub Hrozek) * Log UID in nologin (Vladimir Ivanov) * run pam_getenvlist after setup_env in su.c (Michael Vogt) * Support systems with only utmpx (A. Wilcox) * Fix unguarded ENABLE_SUBIDS code (Jan Chren (rindeal)) * Update po/zh_CN translation (Lion Yang) * Create parent dirs for useradd -m (Michael Vetter) * Prevent usermod segv * Fix usermod crash (fariouche) - Remove btrfs-subvolumes.patch (fate#316134): OBS-URL: https://build.opensuse.org/package/show/Base:System/shadow?expand=0&rev=68
75 lines
1.8 KiB
Diff
75 lines
1.8 KiB
Diff
Index: etc/login.defs
|
|
===================================================================
|
|
--- etc/login.defs.orig
|
|
+++ etc/login.defs
|
|
@@ -212,6 +212,13 @@ CHFN_RESTRICT rwh
|
|
DEFAULT_HOME yes
|
|
|
|
#
|
|
+# If defined, this command is run when adding a user.
|
|
+# It should rebuild any NIS database etc. to add the
|
|
+# new created account.
|
|
+#
|
|
+USERADD_CMD /usr/sbin/useradd.local
|
|
+
|
|
+#
|
|
# If defined, this command is run when removing a user.
|
|
# It should remove any at/cron/print jobs etc. owned by
|
|
# the user to be removed (passed as the first argument).
|
|
Index: lib/getdef.c
|
|
===================================================================
|
|
--- lib/getdef.c.orig
|
|
+++ lib/getdef.c
|
|
@@ -126,6 +126,7 @@ static struct itemdef def_table[] = {
|
|
{"UID_MAX", NULL},
|
|
{"UID_MIN", NULL},
|
|
{"UMASK", NULL},
|
|
+ {"USERADD_CMD", NULL},
|
|
{"USERDEL_CMD", NULL},
|
|
{"USERDEL_PRECMD", NULL},
|
|
{"USERDEL_POSTCMD", NULL},
|
|
Index: src/useradd.c
|
|
===================================================================
|
|
--- src/useradd.c.orig
|
|
+++ src/useradd.c
|
|
@@ -2216,6 +2216,30 @@ static void create_mail (void)
|
|
}
|
|
|
|
/*
|
|
+ * call_script - call a script to do some work
|
|
+ *
|
|
+ * call_script calls a script for additional changes to the
|
|
+ * account.
|
|
+ */
|
|
+
|
|
+static void call_script (const char *user)
|
|
+{
|
|
+ const char *cmd;
|
|
+ const char *argv[3];
|
|
+ int status;
|
|
+
|
|
+ cmd = getdef_str ("USERADD_CMD");
|
|
+ if (NULL == cmd) {
|
|
+ return;
|
|
+ }
|
|
+ argv[0] = cmd;
|
|
+ argv[1] = user;
|
|
+ argv[2] = (char *)0;
|
|
+ (void) run_command (cmd, argv, NULL, &status);
|
|
+}
|
|
+
|
|
+
|
|
+/*
|
|
* main - useradd command
|
|
*/
|
|
int main (int argc, char **argv)
|
|
@@ -2492,6 +2516,7 @@ int main (int argc, char **argv)
|
|
nscd_flush_cache ("group");
|
|
sssd_flush_cache (SSSD_DB_PASSWD | SSSD_DB_GROUP);
|
|
|
|
+ call_script (user_name);
|
|
+
|
|
return E_SUCCESS;
|
|
}
|
|
-
|