aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/useradd.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-01-16 09:26:50 -0600
committerRob Landley <rob@landley.net>2014-01-16 09:26:50 -0600
commit59d85e2bb065a3bdc27868acb7a65f89d872c7fa (patch)
tree25db9183f6e142b7c5f12b69e9728aaa98f5bbd6 /toys/pending/useradd.c
parent2ded83376cb822198e83048335417a0e870f2240 (diff)
downloadtoybox-59d85e2bb065a3bdc27868acb7a65f89d872c7fa.tar.gz
Rename xmsprintf() to just xmprintf().
Partly because there's no supplied target string ala sprintf, and partly because I can never remember what order the m and s go in.
Diffstat (limited to 'toys/pending/useradd.c')
-rw-r--r--toys/pending/useradd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/toys/pending/useradd.c b/toys/pending/useradd.c
index ecfd638f..450e021a 100644
--- a/toys/pending/useradd.c
+++ b/toys/pending/useradd.c
@@ -90,7 +90,7 @@ static void create_copy_skel(char *skel, char *hdir)
args[0] = "chown";
args[1] = "-R";
- args[2] = xmsprintf("%u:%u", TT.uid, TT.gid);
+ args[2] = xmprintf("%u:%u", TT.uid, TT.gid);
args[3] = hdir;
//Change ownership to that of UID and GID of new user
toys.exitval = exec_wait(args);
@@ -118,7 +118,7 @@ static void new_user()
if (toys.optflags & FLAG_g) pwd.pw_gecos = TT.gecos;
else pwd.pw_gecos = "Linux User,";
if (toys.optflags & FLAG_h) pwd.pw_dir = TT.dir;
- else pwd.pw_dir = xmsprintf("/home/%s", *toys.optargs);
+ else pwd.pw_dir = xmprintf("/home/%s", *toys.optargs);
if (toys.optflags & FLAG_s) pwd.pw_shell = TT.shell;
else pwd.pw_shell = get_shell();
@@ -168,7 +168,7 @@ static void new_user()
//add group, invoke addgroup command
args[0] = "groupadd";
args[1] = toys.optargs[0];
- args[2] = xmsprintf("-g%ld", pwd.pw_gid);
+ args[2] = xmprintf("-g%ld", pwd.pw_gid);
args[3] = NULL;
if (exec_wait(args)) error_msg("addgroup fail");
}
@@ -180,15 +180,15 @@ static void new_user()
*/
// 1. add an entry to /etc/passwd and /etc/shadow file
- entry = xmsprintf("%s:%s:%ld:%ld:%s:%s:%s", pwd.pw_name, pwd.pw_passwd,
+ entry = xmprintf("%s:%s:%ld:%ld:%s:%s:%s", pwd.pw_name, pwd.pw_passwd,
pwd.pw_uid, pwd.pw_gid, pwd.pw_gecos, pwd.pw_dir, pwd.pw_shell);
if (update_password("/etc/passwd", pwd.pw_name, entry)) error_exit("updating passwd file failed");
free(entry);
if (toys.optflags & FLAG_S)
- entry = xmsprintf("%s:!!:%u::::::", pwd.pw_name,
+ entry = xmprintf("%s:!!:%u::::::", pwd.pw_name,
(unsigned)(time(NULL))/(24*60*60)); //passwd is not set initially
- else entry = xmsprintf("%s:!!:%u:%ld:%ld:%ld:::", pwd.pw_name,
+ else entry = xmprintf("%s:!!:%u:%ld:%ld:%ld:::", pwd.pw_name,
(unsigned)(time(NULL))/(24*60*60), 0, 99999, 7); //passwd is not set initially
update_password("/etc/shadow", pwd.pw_name, entry);
free(entry);