* src/groupmod.c: Re-indent.
* src/groupmod.c: Do not add the command synopsis to the main () documentation. This avoids outdated information.
This commit is contained in:
parent
fca6aeeea2
commit
ad7a108d60
@ -1,6 +1,8 @@
|
||||
2008-12-22 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* src/groupadd.c: Re-indent.
|
||||
* src/groupadd.c, src/groupmod.c: Re-indent.
|
||||
* src/groupmod.c: Do not add the command synopsis to the main ()
|
||||
documentation. This avoids outdated information.
|
||||
|
||||
2008-12-22 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
|
@ -277,7 +277,8 @@ static void check_new_gid (void)
|
||||
/*
|
||||
* Tell the user what they did wrong.
|
||||
*/
|
||||
fprintf (stderr, _("%s: GID '%lu' already exists\n"),
|
||||
fprintf (stderr,
|
||||
_("%s: GID '%lu' already exists\n"),
|
||||
Prog, (unsigned long int) group_newid);
|
||||
exit (E_GID_IN_USE);
|
||||
}
|
||||
@ -306,8 +307,8 @@ static void check_new_name (void)
|
||||
/* local, no need for xgetgrnam */
|
||||
if (getgrnam (group_newname) != NULL) {
|
||||
fprintf (stderr,
|
||||
_("%s: group '%s' already exists\n"), Prog,
|
||||
group_newname);
|
||||
_("%s: group '%s' already exists\n"),
|
||||
Prog, group_newname);
|
||||
exit (E_NAME_IN_USE);
|
||||
}
|
||||
return;
|
||||
@ -317,7 +318,8 @@ static void check_new_name (void)
|
||||
* All invalid group names land here.
|
||||
*/
|
||||
|
||||
fprintf (stderr, _("%s: invalid group name '%s'\n"),
|
||||
fprintf (stderr,
|
||||
_("%s: invalid group name '%s'\n"),
|
||||
Prog, group_newname);
|
||||
exit (E_BAD_ARG);
|
||||
}
|
||||
@ -332,8 +334,9 @@ static gid_t get_gid (const char *gidstr)
|
||||
|
||||
val = strtol (gidstr, &errptr, 10); /* FIXME: Should be strtoul ? */
|
||||
if (('\0' != *errptr) || (ERANGE == errno) || (val < 0)) {
|
||||
fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog,
|
||||
gidstr);
|
||||
fprintf (stderr,
|
||||
_("%s: invalid numeric argument '%s'\n"),
|
||||
Prog, gidstr);
|
||||
exit (E_BAD_ARG);
|
||||
}
|
||||
return (gid_t) val;
|
||||
@ -347,8 +350,6 @@ static gid_t get_gid (const char *gidstr)
|
||||
* are checked for sanity.
|
||||
*/
|
||||
static void process_flags (int argc, char **argv)
|
||||
{
|
||||
|
||||
{
|
||||
int option_index = 0;
|
||||
int c;
|
||||
@ -383,7 +384,6 @@ static void process_flags (int argc, char **argv)
|
||||
usage ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (oflg && !gflg) {
|
||||
usage ();
|
||||
@ -676,14 +676,6 @@ void update_primary_groups (gid_t ogid, gid_t ngid)
|
||||
/*
|
||||
* main - groupmod command
|
||||
*
|
||||
* The syntax of the groupmod command is
|
||||
*
|
||||
* groupmod [ -g gid [ -o ]] [ -n name ] group
|
||||
*
|
||||
* The flags are
|
||||
* -g - specify a new group ID value
|
||||
* -o - permit the group ID value to be non-unique
|
||||
* -n - specify a new group name
|
||||
*/
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
@ -755,7 +747,8 @@ int main (int argc, char **argv)
|
||||
*/
|
||||
grp = getgrnam (group_name); /* local, no need for xgetgrnam */
|
||||
if (NULL == grp) {
|
||||
fprintf (stderr, _("%s: group '%s' does not exist\n"),
|
||||
fprintf (stderr,
|
||||
_("%s: group '%s' does not exist\n"),
|
||||
Prog, group_name);
|
||||
exit (E_NOTFOUND);
|
||||
} else {
|
||||
@ -771,12 +764,14 @@ int main (int argc, char **argv)
|
||||
char *nis_domain;
|
||||
char *nis_master;
|
||||
|
||||
fprintf (stderr, _("%s: group %s is a NIS group\n"),
|
||||
fprintf (stderr,
|
||||
_("%s: group %s is a NIS group\n"),
|
||||
Prog, group_name);
|
||||
|
||||
if (!yp_get_default_domain (&nis_domain) &&
|
||||
!yp_master (nis_domain, "group.byname", &nis_master)) {
|
||||
fprintf (stderr, _("%s: %s is the NIS master\n"),
|
||||
fprintf (stderr,
|
||||
_("%s: %s is the NIS master\n"),
|
||||
Prog, nis_master);
|
||||
}
|
||||
exit (E_NOTFOUND);
|
||||
|
Loading…
Reference in New Issue
Block a user