2012-10-29 16:15:23 +01:00
|
|
|
--- src/useradd.c
|
2016-05-30 12:38:25 +02:00
|
|
|
+++ src/useradd.c
|
|
|
|
@@ -1982,6 +1982,30 @@ static void create_mail (void)
|
2012-10-29 16:15:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
+ * 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)
|
2016-05-30 12:38:25 +02:00
|
|
|
@@ -2242,6 +2266,7 @@ int main (int argc, char **argv)
|
2012-10-29 16:15:23 +01:00
|
|
|
nscd_flush_cache ("passwd");
|
|
|
|
nscd_flush_cache ("group");
|
|
|
|
|
|
|
|
+ call_script (user_name);
|
|
|
|
+
|
|
|
|
return E_SUCCESS;
|
|
|
|
}
|
|
|
|
-
|