ofd = mkstemp (new_file);
if (-1 == ofd) {
fprintf (stderr,
- _("%s: cannot create new defaults file\n"), Prog);
+ _("%s: cannot create new defaults file\n"),
+ Prog);
return -1;
}
ofp = fdopen (ofd, "w");
if (NULL == ofp) {
- fprintf (stderr, _("%s: cannot open new defaults file\n"),
- Prog);
+ fprintf (stderr,
+ _("%s: cannot open new defaults file\n"),
+ Prog);
return -1;
}
out_skel = true;
} else if (!out_create_mail_spool
&& MATCH (buf, CREATE_MAIL_SPOOL)) {
- fprintf (ofp, CREATE_MAIL_SPOOL "%s\n",
- def_create_mail_spool);
+ fprintf (ofp,
+ CREATE_MAIL_SPOOL "%s\n",
+ def_create_mail_spool);
out_create_mail_spool = true;
} else
fprintf (ofp, "%s\n", buf);
SHADOW_AUDIT_SUCCESS);
#endif
SYSLOG ((LOG_INFO,
- "useradd defaults: GROUP=%u, HOME=%s, SHELL=%s, INACTIVE=%ld, "
- "EXPIRE=%s, SKEL=%s, CREATE_MAIL_SPOOL=%s",
- (unsigned int) def_group, def_home, def_shell,
- def_inactive, def_expire, def_template,
- def_create_mail_spool));
+ "useradd defaults: GROUP=%u, HOME=%s, SHELL=%s, INACTIVE=%ld, "
+ "EXPIRE=%s, SKEL=%s, CREATE_MAIL_SPOOL=%s",
+ (unsigned int) def_group, def_home, def_shell,
+ def_inactive, def_expire, def_template,
+ def_create_mail_spool));
return 0;
}
* string name.
*/
if (NULL == grp) {
- fprintf (stderr, _("%s: group '%s' does not exist\n"),
- Prog, list);
+ fprintf (stderr,
+ _("%s: group '%s' does not exist\n"),
+ Prog, list);
errors++;
}
list = cp;
*/
if (__isgrNIS ()) {
fprintf (stderr,
- _("%s: group '%s' is a NIS group.\n"),
- Prog, grp->gr_name);
+ _("%s: group '%s' is a NIS group.\n"),
+ Prog, grp->gr_name);
continue;
}
#endif
if (ngroups == sys_ngroups) {
fprintf (stderr,
- _
- ("%s: too many groups specified (max %d).\n"),
- Prog, ngroups);
+ _("%s: too many groups specified (max %d).\n"),
+ Prog, ngroups);
break;
}
user_name, AUDIT_NO_ID,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO, "add '%s' to group '%s'",
- user_name, ngrp->gr_name));
+ SYSLOG ((LOG_INFO,
+ "add '%s' to group '%s'",
+ user_name, ngrp->gr_name));
}
#ifdef SHADOWGRP
nsgrp = __sgr_dup (sgrp);
if (NULL == nsgrp) {
fprintf (stderr,
- _("%s: Out of memory. Cannot update %s.\n"),
- Prog, sgr_dbname ());
+ _("%s: Out of memory. Cannot update %s.\n"),
+ Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to prepare the new %s entry '%s'", sgr_dbname (), user_name));
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER, Prog,
user_name, AUDIT_NO_ID,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO, "add '%s' to shadow group '%s'",
- user_name, nsgrp->sg_name));
+ SYSLOG ((LOG_INFO,
+ "add '%s' to shadow group '%s'",
+ user_name, nsgrp->sg_name));
}
#endif /* SHADOWGRP */
}
if (NULL == grp) {
fprintf (stderr,
_("%s: group '%s' does not exist\n"),
- Prog, optarg);
+ Prog, optarg);
exit (E_NOTFOUND);
}
if (Dflg) {
create_mail_spool = def_create_mail_spool;
if (!rflg) {
- /* for system accounts defaults are ignored and we
- * do not create a home dir */
+ /* for system accounts defaults are ignored and we
+ * do not create a home dir */
if (getdef_bool("CREATE_HOME")) {
mflg = true;
}
* happens so we know what we were trying to accomplish.
*/
SYSLOG ((LOG_INFO,
- "new user: name=%s, UID=%u, GID=%u, home=%s, shell=%s",
- user_name, (unsigned int) user_id,
- (unsigned int) user_gid, user_home, user_shell));
+ "new user: name=%s, UID=%u, GID=%u, home=%s, shell=%s",
+ user_name, (unsigned int) user_id,
+ (unsigned int) user_gid, user_home, user_shell));
/*
* Initialize faillog and lastlog entries for this UID in case
/* XXX - create missing parent directories. --marekm */
if (mkdir (user_home, 0) != 0) {
fprintf (stderr,
- _
- ("%s: cannot create directory %s\n"),
- Prog, user_home);
+ _("%s: cannot create directory %s\n"),
+ Prog, user_home);
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER, Prog,
"adding home directory",
/* local, no need for xgetgrnam */
if (getgrnam (user_name) != NULL) {
fprintf (stderr,
- _("%s: group %s exists - if you want to add this user to that group, use -g.\n"),
- Prog, user_name);
+ _("%s: group %s exists - if you want to add this user to that group, use -g.\n"),
+ Prog, user_name);
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER, Prog,
"adding group",
if (Uflg) {
if (find_new_gid (rflg, &user_gid, &user_id) < 0) {
fprintf (stderr,
- _("%s: can't create group\n"),
- Prog);
+ _("%s: can't create group\n"),
+ Prog);
fail_exit (4);
}
grp_add ();
if (mflg) {
create_home ();
- if (home_added)
+ if (home_added) {
copy_tree (def_template, user_home, user_id, user_gid);
- else
+ } else {
fprintf (stderr,
- _
- ("%s: warning: the home directory already exists.\n"
- "Not copying any file from skel directory into it.\n"),
- Prog);
+ _("%s: warning: the home directory already exists.\n"
+ "Not copying any file from skel directory into it.\n"),
+ Prog);
+ }
}