pw: exit with an error in case of using an illegal option

PR:		263188
Reported by:	Dennis Clarke <dclarke@blastwave.org>
MFC After:	1 week
This commit is contained in:
Baptiste Daroussin 2022-10-12 12:06:32 +02:00
parent 0b4886f454
commit c0358afd5b
2 changed files with 24 additions and 0 deletions

View File

@ -276,6 +276,8 @@ pw_group_next(int argc, char **argv, char *arg1 __unused)
case 'q':
quiet = true;
break;
default:
exit(EX_USAGE);
}
}
@ -333,6 +335,8 @@ pw_group_show(int argc, char **argv, char *arg1)
case 'a':
all = true;
break;
default:
exit(EX_USAGE);
}
}
@ -390,6 +394,8 @@ pw_group_del(int argc, char **argv, char *arg1)
case 'Y':
nis = true;
break;
default:
exit(EX_USAGE);
}
}
@ -548,6 +554,8 @@ pw_group_add(int argc, char **argv, char *arg1)
case 'Y':
nis = true;
break;
default:
exit(EX_USAGE);
}
}
@ -640,6 +648,8 @@ pw_group_mod(int argc, char **argv, char *arg1)
case 'Y':
nis = true;
break;
default:
exit(EX_USAGE);
}
}
if (quiet)

View File

@ -723,6 +723,8 @@ pw_user_next(int argc, char **argv, char *name __unused)
case 'q':
quiet = true;
break;
default:
exit(EX_USAGE);
}
}
@ -785,6 +787,8 @@ pw_user_show(int argc, char **argv, char *arg1)
case '7':
v7 = true;
break;
default:
exit(EX_USAGE);
}
}
@ -866,6 +870,8 @@ pw_user_del(int argc, char **argv, char *arg1)
case 'Y':
nis = true;
break;
default:
exit(EX_USAGE);
}
}
@ -1003,6 +1009,8 @@ pw_user_lock(int argc, char **argv, char *arg1)
case 'q':
/* compatibility */
break;
default:
exit(EX_USAGE);
}
}
@ -1020,6 +1028,8 @@ pw_user_unlock(int argc, char **argv, char *arg1)
case 'q':
/* compatibility */
break;
default:
exit(EX_USAGE);
}
}
@ -1287,6 +1297,8 @@ pw_user_add(int argc, char **argv, char *arg1)
case 'Y':
nis = true;
break;
default:
exit(EX_USAGE);
}
}
@ -1595,6 +1607,8 @@ pw_user_mod(int argc, char **argv, char *arg1)
case 'Y':
nis = true;
break;
default:
exit(EX_USAGE);
}
}