* src/chage.c, src/chgpasswd.c, src/chpasswd.c, src/chsh.c,
src/faillog.c, src/gpasswd.c, src/groupadd.c, src/groupdel.c, src/groupmems.c, src/groupmod.c, src/grpconv.c, src/grpunconv.c, src/lastlog.c, src/newusers.c, src/passwd.c, src/pwconv.c, src/pwunconv.c, src/su.c, src/useradd.c, src/userdel.c, src/usermod.c, src/vipw.c: Align and sort options.
This commit is contained in:
parent
7d8ca29bea
commit
f0a63185c9
@ -1,3 +1,12 @@
|
|||||||
|
2011-10-31 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* src/chage.c, src/chgpasswd.c, src/chpasswd.c, src/chsh.c,
|
||||||
|
src/faillog.c, src/gpasswd.c, src/groupadd.c, src/groupdel.c,
|
||||||
|
src/groupmems.c, src/groupmod.c, src/grpconv.c, src/grpunconv.c,
|
||||||
|
src/lastlog.c, src/newusers.c, src/passwd.c, src/pwconv.c,
|
||||||
|
src/pwunconv.c, src/su.c, src/useradd.c, src/userdel.c,
|
||||||
|
src/usermod.c, src/vipw.c: Align and sort options.
|
||||||
|
|
||||||
2011-10-31 Nicolas François <nicolas.francois@centraliens.net>
|
2011-10-31 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* NEWS, src/pwck.c, man/pwck.8.xm, src/grpck.c, man/grpck.8.xml:
|
* NEWS, src/pwck.c, man/pwck.8.xm, src/grpck.c, man/grpck.8.xml:
|
||||||
|
16
src/chage.c
16
src/chage.c
@ -386,15 +386,15 @@ static void process_flags (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"lastday", required_argument, NULL, 'd'},
|
{"lastday", required_argument, NULL, 'd'},
|
||||||
{"expiredate", required_argument, NULL, 'E'},
|
{"expiredate", required_argument, NULL, 'E'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"inactive", required_argument, NULL, 'I'},
|
{"inactive", required_argument, NULL, 'I'},
|
||||||
{"list", no_argument, NULL, 'l'},
|
{"list", no_argument, NULL, 'l'},
|
||||||
{"mindays", required_argument, NULL, 'm'},
|
{"mindays", required_argument, NULL, 'm'},
|
||||||
{"maxdays", required_argument, NULL, 'M'},
|
{"maxdays", required_argument, NULL, 'M'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{"warndays", required_argument, NULL, 'W'},
|
{"warndays", required_argument, NULL, 'W'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -156,12 +156,12 @@ static void process_flags (int argc, char **argv)
|
|||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"crypt-method", required_argument, NULL, 'c'},
|
{"crypt-method", required_argument, NULL, 'c'},
|
||||||
{"encrypted", no_argument, NULL, 'e'},
|
{"encrypted", no_argument, NULL, 'e'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"md5", no_argument, NULL, 'm'},
|
{"md5", no_argument, NULL, 'm'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
#ifdef USE_SHA_CRYPT
|
#ifdef USE_SHA_CRYPT
|
||||||
{"sha-rounds", required_argument, NULL, 's'},
|
{"sha-rounds", required_argument, NULL, 's'},
|
||||||
#endif
|
#endif
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
@ -149,13 +149,13 @@ static void process_flags (int argc, char **argv)
|
|||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"crypt-method", required_argument, NULL, 'c'},
|
{"crypt-method", required_argument, NULL, 'c'},
|
||||||
{"encrypted", no_argument, NULL, 'e'},
|
{"encrypted", no_argument, NULL, 'e'},
|
||||||
{"md5", no_argument, NULL, 'm'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"md5", no_argument, NULL, 'm'},
|
||||||
|
{"root", required_argument, NULL, 'R'},
|
||||||
#ifdef USE_SHA_CRYPT
|
#ifdef USE_SHA_CRYPT
|
||||||
{"sha-rounds", required_argument, NULL, 's'},
|
{"sha-rounds", required_argument, NULL, 's'},
|
||||||
#endif /* USE_SHA_CRYPT */
|
#endif /* USE_SHA_CRYPT */
|
||||||
{"help", no_argument, NULL, 'h'},
|
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -167,15 +167,15 @@ static void process_flags (int argc, char **argv)
|
|||||||
#endif /* !USE_SHA_CRYPT */
|
#endif /* !USE_SHA_CRYPT */
|
||||||
long_options, NULL)) != -1) {
|
long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
|
||||||
usage (E_SUCCESS);
|
|
||||||
/*@notreached@*/break;
|
|
||||||
case 'c':
|
case 'c':
|
||||||
crypt_method = optarg;
|
crypt_method = optarg;
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
eflg = true;
|
eflg = true;
|
||||||
break;
|
break;
|
||||||
|
case 'h':
|
||||||
|
usage (E_SUCCESS);
|
||||||
|
/*@notreached@*/break;
|
||||||
case 'm':
|
case 'm':
|
||||||
md5flg = true;
|
md5flg = true;
|
||||||
break;
|
break;
|
||||||
|
@ -206,8 +206,8 @@ static void process_flags (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{"shell", required_argument, NULL, 's'},
|
{"shell", required_argument, NULL, 's'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
@ -579,14 +579,14 @@ int main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"all", no_argument, NULL, 'a'},
|
{"all", no_argument, NULL, 'a'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"lock-secs", required_argument, NULL, 'l'},
|
{"lock-secs", required_argument, NULL, 'l'},
|
||||||
{"maximum", required_argument, NULL, 'm'},
|
{"maximum", required_argument, NULL, 'm'},
|
||||||
{"reset", no_argument, NULL, 'r'},
|
{"reset", no_argument, NULL, 'r'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{"time", required_argument, NULL, 't'},
|
{"time", required_argument, NULL, 't'},
|
||||||
{"user", required_argument, NULL, 'u'},
|
{"user", required_argument, NULL, 'u'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
while ((c = getopt_long (argc, argv, "ahl:m:rR:t:u:",
|
while ((c = getopt_long (argc, argv, "ahl:m:rR:t:u:",
|
||||||
|
@ -229,14 +229,14 @@ static void process_flags (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"add", required_argument, NULL, 'a'},
|
{"add", required_argument, NULL, 'a'},
|
||||||
{"delete", required_argument, NULL, 'd'},
|
{"administrators", required_argument, NULL, 'A'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"delete", required_argument, NULL, 'd'},
|
||||||
{"remove-password", no_argument, NULL, 'r'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"restrict", no_argument, NULL, 'R'},
|
{"members", required_argument, NULL, 'M'},
|
||||||
{"administrators", required_argument, NULL, 'A'},
|
{"root", required_argument, NULL, 'Q'},
|
||||||
{"members", required_argument, NULL, 'M'},
|
{"remove-password", no_argument, NULL, 'r'},
|
||||||
{"root", required_argument, NULL, 'Q'},
|
{"restrict", no_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -378,14 +378,14 @@ static void process_flags (int argc, char **argv)
|
|||||||
char *cp;
|
char *cp;
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"force", no_argument, NULL, 'f'},
|
{"force", no_argument, NULL, 'f'},
|
||||||
{"gid", required_argument, NULL, 'g'},
|
{"gid", required_argument, NULL, 'g'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"key", required_argument, NULL, 'K'},
|
{"key", required_argument, NULL, 'K'},
|
||||||
{"non-unique", no_argument, NULL, 'o'},
|
{"non-unique", no_argument, NULL, 'o'},
|
||||||
{"password", required_argument, NULL, 'p'},
|
{"password", required_argument, NULL, 'p'},
|
||||||
{"system", no_argument, NULL, 'r'},
|
{"system", no_argument, NULL, 'r'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ static void process_flags (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
@ -389,13 +389,13 @@ static void process_flags (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"add", required_argument, NULL, 'a'},
|
{"add", required_argument, NULL, 'a'},
|
||||||
{"delete", required_argument, NULL, 'd'},
|
{"delete", required_argument, NULL, 'd'},
|
||||||
{"group", required_argument, NULL, 'g'},
|
{"group", required_argument, NULL, 'g'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"list", no_argument, NULL, 'l'},
|
{"list", no_argument, NULL, 'l'},
|
||||||
{"purge", no_argument, NULL, 'p'},
|
{"purge", no_argument, NULL, 'p'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -370,12 +370,12 @@ static void process_flags (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"gid", required_argument, NULL, 'g'},
|
{"gid", required_argument, NULL, 'g'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"new-name", required_argument, NULL, 'n'},
|
{"new-name", required_argument, NULL, 'n'},
|
||||||
{"non-unique", no_argument, NULL, 'o'},
|
{"non-unique", no_argument, NULL, 'o'},
|
||||||
{"password", required_argument, NULL, 'p'},
|
{"password", required_argument, NULL, 'p'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
while ((c = getopt_long (argc, argv, "g:hn:op:R:",
|
while ((c = getopt_long (argc, argv, "g:hn:op:R:",
|
||||||
|
@ -114,7 +114,7 @@ static void process_flags (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
@ -114,7 +114,7 @@ static void process_flags (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
@ -211,33 +211,17 @@ int main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
static struct option const longopts[] = {
|
static struct option const longopts[] = {
|
||||||
{"help", no_argument, NULL, 'h'},
|
|
||||||
{"time", required_argument, NULL, 't'},
|
|
||||||
{"before", required_argument, NULL, 'b'},
|
{"before", required_argument, NULL, 'b'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"user", required_argument, NULL, 'u'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
|
{"time", required_argument, NULL, 't'},
|
||||||
|
{"user", required_argument, NULL, 'u'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
while ((c = getopt_long (argc, argv, "ht:b:R:u:", longopts,
|
while ((c = getopt_long (argc, argv, "b:hR:t:u:", longopts,
|
||||||
NULL)) != -1) {
|
NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
|
||||||
usage (EXIT_SUCCESS);
|
|
||||||
/*@notreached@*/break;
|
|
||||||
case 't':
|
|
||||||
{
|
|
||||||
unsigned long days;
|
|
||||||
if (getulong (optarg, &days) == 0) {
|
|
||||||
fprintf (stderr,
|
|
||||||
_("%s: invalid numeric argument '%s'\n"),
|
|
||||||
Prog, optarg);
|
|
||||||
exit (EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
seconds = (time_t) days * DAY;
|
|
||||||
tflg = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'b':
|
case 'b':
|
||||||
{
|
{
|
||||||
unsigned long inverse_days;
|
unsigned long inverse_days;
|
||||||
@ -251,8 +235,24 @@ int main (int argc, char **argv)
|
|||||||
bflg = true;
|
bflg = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'h':
|
||||||
|
usage (EXIT_SUCCESS);
|
||||||
|
/*@notreached@*/break;
|
||||||
case 'R': /* no-op, handled in process_root_flag () */
|
case 'R': /* no-op, handled in process_root_flag () */
|
||||||
break;
|
break;
|
||||||
|
case 't':
|
||||||
|
{
|
||||||
|
unsigned long days;
|
||||||
|
if (getulong (optarg, &days) == 0) {
|
||||||
|
fprintf (stderr,
|
||||||
|
_("%s: invalid numeric argument '%s'\n"),
|
||||||
|
Prog, optarg);
|
||||||
|
exit (EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
seconds = (time_t) days * DAY;
|
||||||
|
tflg = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'u':
|
case 'u':
|
||||||
{
|
{
|
||||||
const struct passwd *pwent;
|
const struct passwd *pwent;
|
||||||
|
@ -527,12 +527,14 @@ static void process_flags (int argc, char **argv)
|
|||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
#ifndef USE_PAM
|
#ifndef USE_PAM
|
||||||
{"crypt-method", required_argument, NULL, 'c'},
|
{"crypt-method", required_argument, NULL, 'c'},
|
||||||
|
#endif /* !USE_PAM */
|
||||||
|
{"help", no_argument, NULL, 'h'},
|
||||||
|
{"system", no_argument, NULL, 'r'},
|
||||||
|
#ifndef USE_PAM
|
||||||
#ifdef USE_SHA_CRYPT
|
#ifdef USE_SHA_CRYPT
|
||||||
{"sha-rounds", required_argument, NULL, 's'},
|
{"sha-rounds", required_argument, NULL, 's'},
|
||||||
#endif /* USE_SHA_CRYPT */
|
#endif /* USE_SHA_CRYPT */
|
||||||
#endif /* !USE_PAM */
|
#endif /* !USE_PAM */
|
||||||
{"help", no_argument, NULL, 'h'},
|
|
||||||
{"system", no_argument, NULL, 'r'},
|
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -548,6 +550,11 @@ static void process_flags (int argc, char **argv)
|
|||||||
#endif
|
#endif
|
||||||
long_options, NULL)) != -1) {
|
long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
#ifndef USE_PAM
|
||||||
|
case 'c':
|
||||||
|
crypt_method = optarg;
|
||||||
|
break;
|
||||||
|
#endif /* !USE_PAM */
|
||||||
case 'h':
|
case 'h':
|
||||||
usage (EXIT_SUCCESS);
|
usage (EXIT_SUCCESS);
|
||||||
break;
|
break;
|
||||||
@ -555,9 +562,6 @@ static void process_flags (int argc, char **argv)
|
|||||||
rflg = true;
|
rflg = true;
|
||||||
break;
|
break;
|
||||||
#ifndef USE_PAM
|
#ifndef USE_PAM
|
||||||
case 'c':
|
|
||||||
crypt_method = optarg;
|
|
||||||
break;
|
|
||||||
#ifdef USE_SHA_CRYPT
|
#ifdef USE_SHA_CRYPT
|
||||||
case 's':
|
case 's':
|
||||||
sflg = true;
|
sflg = true;
|
||||||
|
36
src/passwd.c
36
src/passwd.c
@ -802,21 +802,21 @@ int main (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"all", no_argument, NULL, 'a'},
|
{"all", no_argument, NULL, 'a'},
|
||||||
{"delete", no_argument, NULL, 'd'},
|
{"delete", no_argument, NULL, 'd'},
|
||||||
{"expire", no_argument, NULL, 'e'},
|
{"expire", no_argument, NULL, 'e'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"inactive", required_argument, NULL, 'i'},
|
{"inactive", required_argument, NULL, 'i'},
|
||||||
{"keep-tokens", no_argument, NULL, 'k'},
|
{"keep-tokens", no_argument, NULL, 'k'},
|
||||||
{"lock", no_argument, NULL, 'l'},
|
{"lock", no_argument, NULL, 'l'},
|
||||||
{"mindays", required_argument, NULL, 'n'},
|
{"mindays", required_argument, NULL, 'n'},
|
||||||
{"quiet", no_argument, NULL, 'q'},
|
{"quiet", no_argument, NULL, 'q'},
|
||||||
{"repository", required_argument, NULL, 'r'},
|
{"repository", required_argument, NULL, 'r'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{"status", no_argument, NULL, 'S'},
|
{"status", no_argument, NULL, 'S'},
|
||||||
{"unlock", no_argument, NULL, 'u'},
|
{"unlock", no_argument, NULL, 'u'},
|
||||||
{"warndays", required_argument, NULL, 'w'},
|
{"warndays", required_argument, NULL, 'w'},
|
||||||
{"maxdays", required_argument, NULL, 'x'},
|
{"maxdays", required_argument, NULL, 'x'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -834,6 +834,9 @@ int main (int argc, char **argv)
|
|||||||
eflg = true;
|
eflg = true;
|
||||||
anyflag = true;
|
anyflag = true;
|
||||||
break;
|
break;
|
||||||
|
case 'h':
|
||||||
|
usage (E_SUCCESS);
|
||||||
|
/*@notreached@*/break;
|
||||||
case 'i':
|
case 'i':
|
||||||
if ( (getlong (optarg, &inact) == 0)
|
if ( (getlong (optarg, &inact) == 0)
|
||||||
|| (inact < -1)) {
|
|| (inact < -1)) {
|
||||||
@ -908,9 +911,6 @@ int main (int argc, char **argv)
|
|||||||
xflg = true;
|
xflg = true;
|
||||||
anyflag = true;
|
anyflag = true;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
|
||||||
usage (E_SUCCESS);
|
|
||||||
/*@notreached@*/break;
|
|
||||||
default:
|
default:
|
||||||
usage (E_BAD_ARG);
|
usage (E_BAD_ARG);
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ static void process_flags (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
@ -106,7 +106,7 @@ static void process_flags (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
10
src/su.c
10
src/su.c
@ -737,11 +737,11 @@ static void process_flags (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"command", required_argument, NULL, 'c'},
|
{"command", required_argument, NULL, 'c'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"login", no_argument, NULL, 'l'},
|
{"login", no_argument, NULL, 'l'},
|
||||||
{"preserve-environment", no_argument, NULL, 'p'},
|
{"preserve-environment", no_argument, NULL, 'p'},
|
||||||
{"shell", required_argument, NULL, 's'},
|
{"shell", required_argument, NULL, 's'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -980,31 +980,31 @@ static void process_flags (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"base-dir", required_argument, NULL, 'b'},
|
{"base-dir", required_argument, NULL, 'b'},
|
||||||
{"comment", required_argument, NULL, 'c'},
|
{"comment", required_argument, NULL, 'c'},
|
||||||
{"home-dir", required_argument, NULL, 'd'},
|
{"home-dir", required_argument, NULL, 'd'},
|
||||||
{"defaults", no_argument, NULL, 'D'},
|
{"defaults", no_argument, NULL, 'D'},
|
||||||
{"expiredate", required_argument, NULL, 'e'},
|
{"expiredate", required_argument, NULL, 'e'},
|
||||||
{"inactive", required_argument, NULL, 'f'},
|
{"inactive", required_argument, NULL, 'f'},
|
||||||
{"gid", required_argument, NULL, 'g'},
|
{"gid", required_argument, NULL, 'g'},
|
||||||
{"groups", required_argument, NULL, 'G'},
|
{"groups", required_argument, NULL, 'G'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"skel", required_argument, NULL, 'k'},
|
{"skel", required_argument, NULL, 'k'},
|
||||||
{"key", required_argument, NULL, 'K'},
|
{"key", required_argument, NULL, 'K'},
|
||||||
{"create-home", no_argument, NULL, 'm'},
|
{"no-log-init", no_argument, NULL, 'l'},
|
||||||
{"no-create-home", no_argument, NULL, 'M'},
|
{"create-home", no_argument, NULL, 'm'},
|
||||||
{"no-log-init", no_argument, NULL, 'l'},
|
{"no-create-home", no_argument, NULL, 'M'},
|
||||||
{"no-user-group", no_argument, NULL, 'N'},
|
{"no-user-group", no_argument, NULL, 'N'},
|
||||||
{"non-unique", no_argument, NULL, 'o'},
|
{"non-unique", no_argument, NULL, 'o'},
|
||||||
{"password", required_argument, NULL, 'p'},
|
{"password", required_argument, NULL, 'p'},
|
||||||
{"system", no_argument, NULL, 'r'},
|
{"system", no_argument, NULL, 'r'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{"shell", required_argument, NULL, 's'},
|
{"shell", required_argument, NULL, 's'},
|
||||||
|
{"uid", required_argument, NULL, 'u'},
|
||||||
|
{"user-group", no_argument, NULL, 'U'},
|
||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
{"selinux-user", required_argument, NULL, 'Z'},
|
{"selinux-user", required_argument, NULL, 'Z'},
|
||||||
#endif
|
#endif
|
||||||
{"uid", required_argument, NULL, 'u'},
|
|
||||||
{"user-group", no_argument, NULL, 'U'},
|
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
while ((c = getopt_long (argc, argv,
|
while ((c = getopt_long (argc, argv,
|
||||||
|
@ -870,10 +870,10 @@ int main (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"force", no_argument, NULL, 'f'},
|
{"force", no_argument, NULL, 'f'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"remove", no_argument, NULL, 'r'},
|
{"remove", no_argument, NULL, 'r'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
while ((c = getopt_long (argc, argv, "fhrR:",
|
while ((c = getopt_long (argc, argv, "fhrR:",
|
||||||
|
@ -875,26 +875,26 @@ static void process_flags (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"append", no_argument, NULL, 'a'},
|
{"append", no_argument, NULL, 'a'},
|
||||||
{"comment", required_argument, NULL, 'c'},
|
{"comment", required_argument, NULL, 'c'},
|
||||||
{"home", required_argument, NULL, 'd'},
|
{"home", required_argument, NULL, 'd'},
|
||||||
{"expiredate", required_argument, NULL, 'e'},
|
{"expiredate", required_argument, NULL, 'e'},
|
||||||
{"inactive", required_argument, NULL, 'f'},
|
{"inactive", required_argument, NULL, 'f'},
|
||||||
{"gid", required_argument, NULL, 'g'},
|
{"gid", required_argument, NULL, 'g'},
|
||||||
{"groups", required_argument, NULL, 'G'},
|
{"groups", required_argument, NULL, 'G'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"login", required_argument, NULL, 'l'},
|
{"login", required_argument, NULL, 'l'},
|
||||||
{"lock", no_argument, NULL, 'L'},
|
{"lock", no_argument, NULL, 'L'},
|
||||||
{"move-home", no_argument, NULL, 'm'},
|
{"move-home", no_argument, NULL, 'm'},
|
||||||
{"non-unique", no_argument, NULL, 'o'},
|
{"non-unique", no_argument, NULL, 'o'},
|
||||||
{"password", required_argument, NULL, 'p'},
|
{"password", required_argument, NULL, 'p'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
|
{"shell", required_argument, NULL, 's'},
|
||||||
|
{"uid", required_argument, NULL, 'u'},
|
||||||
|
{"unlock", no_argument, NULL, 'U'},
|
||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
{"selinux-user", required_argument, NULL, 'Z'},
|
{"selinux-user", required_argument, NULL, 'Z'},
|
||||||
#endif
|
#endif
|
||||||
{"shell", required_argument, NULL, 's'},
|
|
||||||
{"uid", required_argument, NULL, 'u'},
|
|
||||||
{"unlock", no_argument, NULL, 'U'},
|
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
while ((c = getopt_long (argc, argv,
|
while ((c = getopt_long (argc, argv,
|
||||||
|
14
src/vipw.c
14
src/vipw.c
@ -434,14 +434,14 @@ int main (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"group", no_argument, NULL, 'g'},
|
{"group", no_argument, NULL, 'g'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"passwd", no_argument, NULL, 'p'},
|
{"passwd", no_argument, NULL, 'p'},
|
||||||
{"quiet", no_argument, NULL, 'q'},
|
{"quiet", no_argument, NULL, 'q'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{"shadow", no_argument, NULL, 's'},
|
{"shadow", no_argument, NULL, 's'},
|
||||||
#ifdef WITH_TCB
|
#ifdef WITH_TCB
|
||||||
{"user", required_argument, NULL, 'u'},
|
{"user", required_argument, NULL, 'u'},
|
||||||
#endif /* WITH_TCB */
|
#endif /* WITH_TCB */
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user