* src/useradd.c: Re-indent.
This commit is contained in:
parent
06c81b67c2
commit
95bc6eb7b2
@ -1,5 +1,6 @@
|
|||||||
2009-04-06 Nicolas François <nicolas.francois@centraliens.net>
|
2009-04-06 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* src/useradd.c: Re-indent.
|
||||||
* src/useradd.c: Use getlong instead of get_number.
|
* src/useradd.c: Use getlong instead of get_number.
|
||||||
|
|
||||||
2009-04-06 Nicolas François <nicolas.francois@centraliens.net>
|
2009-04-06 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
@ -443,13 +443,15 @@ static int set_defaults (void)
|
|||||||
ofd = mkstemp (new_file);
|
ofd = mkstemp (new_file);
|
||||||
if (-1 == ofd) {
|
if (-1 == ofd) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot create new defaults file\n"), Prog);
|
_("%s: cannot create new defaults file\n"),
|
||||||
|
Prog);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ofp = fdopen (ofd, "w");
|
ofp = fdopen (ofd, "w");
|
||||||
if (NULL == ofp) {
|
if (NULL == ofp) {
|
||||||
fprintf (stderr, _("%s: cannot open new defaults file\n"),
|
fprintf (stderr,
|
||||||
|
_("%s: cannot open new defaults file\n"),
|
||||||
Prog);
|
Prog);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -491,7 +493,8 @@ static int set_defaults (void)
|
|||||||
out_skel = true;
|
out_skel = true;
|
||||||
} else if (!out_create_mail_spool
|
} else if (!out_create_mail_spool
|
||||||
&& MATCH (buf, CREATE_MAIL_SPOOL)) {
|
&& MATCH (buf, CREATE_MAIL_SPOOL)) {
|
||||||
fprintf (ofp, CREATE_MAIL_SPOOL "%s\n",
|
fprintf (ofp,
|
||||||
|
CREATE_MAIL_SPOOL "%s\n",
|
||||||
def_create_mail_spool);
|
def_create_mail_spool);
|
||||||
out_create_mail_spool = true;
|
out_create_mail_spool = true;
|
||||||
} else
|
} else
|
||||||
@ -610,7 +613,8 @@ static int get_groups (char *list)
|
|||||||
* string name.
|
* string name.
|
||||||
*/
|
*/
|
||||||
if (NULL == grp) {
|
if (NULL == grp) {
|
||||||
fprintf (stderr, _("%s: group '%s' does not exist\n"),
|
fprintf (stderr,
|
||||||
|
_("%s: group '%s' does not exist\n"),
|
||||||
Prog, list);
|
Prog, list);
|
||||||
errors++;
|
errors++;
|
||||||
}
|
}
|
||||||
@ -639,8 +643,7 @@ static int get_groups (char *list)
|
|||||||
|
|
||||||
if (ngroups == sys_ngroups) {
|
if (ngroups == sys_ngroups) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_
|
_("%s: too many groups specified (max %d).\n"),
|
||||||
("%s: too many groups specified (max %d).\n"),
|
|
||||||
Prog, ngroups);
|
Prog, ngroups);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -848,7 +851,8 @@ static void grp_update (void)
|
|||||||
user_name, AUDIT_NO_ID,
|
user_name, AUDIT_NO_ID,
|
||||||
SHADOW_AUDIT_SUCCESS);
|
SHADOW_AUDIT_SUCCESS);
|
||||||
#endif
|
#endif
|
||||||
SYSLOG ((LOG_INFO, "add '%s' to group '%s'",
|
SYSLOG ((LOG_INFO,
|
||||||
|
"add '%s' to group '%s'",
|
||||||
user_name, ngrp->gr_name));
|
user_name, ngrp->gr_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -918,7 +922,8 @@ static void grp_update (void)
|
|||||||
user_name, AUDIT_NO_ID,
|
user_name, AUDIT_NO_ID,
|
||||||
SHADOW_AUDIT_SUCCESS);
|
SHADOW_AUDIT_SUCCESS);
|
||||||
#endif
|
#endif
|
||||||
SYSLOG ((LOG_INFO, "add '%s' to shadow group '%s'",
|
SYSLOG ((LOG_INFO,
|
||||||
|
"add '%s' to shadow group '%s'",
|
||||||
user_name, nsgrp->sg_name));
|
user_name, nsgrp->sg_name));
|
||||||
}
|
}
|
||||||
#endif /* SHADOWGRP */
|
#endif /* SHADOWGRP */
|
||||||
@ -1680,8 +1685,7 @@ static void create_home (void)
|
|||||||
/* XXX - create missing parent directories. --marekm */
|
/* XXX - create missing parent directories. --marekm */
|
||||||
if (mkdir (user_home, 0) != 0) {
|
if (mkdir (user_home, 0) != 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_
|
_("%s: cannot create directory %s\n"),
|
||||||
("%s: cannot create directory %s\n"),
|
|
||||||
Prog, user_home);
|
Prog, user_home);
|
||||||
#ifdef WITH_AUDIT
|
#ifdef WITH_AUDIT
|
||||||
audit_logger (AUDIT_ADD_USER, Prog,
|
audit_logger (AUDIT_ADD_USER, Prog,
|
||||||
@ -1931,14 +1935,14 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
if (mflg) {
|
if (mflg) {
|
||||||
create_home ();
|
create_home ();
|
||||||
if (home_added)
|
if (home_added) {
|
||||||
copy_tree (def_template, user_home, user_id, user_gid);
|
copy_tree (def_template, user_home, user_id, user_gid);
|
||||||
else
|
} else {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_
|
_("%s: warning: the home directory already exists.\n"
|
||||||
("%s: warning: the home directory already exists.\n"
|
|
||||||
"Not copying any file from skel directory into it.\n"),
|
"Not copying any file from skel directory into it.\n"),
|
||||||
Prog);
|
Prog);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user