diff options
author | davidn <davidn@FreeBSD.org> | 1999-10-26 08:34:09 +0000 |
---|---|---|
committer | davidn <davidn@FreeBSD.org> | 1999-10-26 08:34:09 +0000 |
commit | 091d63007009782645e83fda77ebeff7eb52f243 (patch) | |
tree | 2aa1f2f02b890aebacec8f3289cb2e2be16b19ca /usr.sbin/pw/pw.c | |
parent | 297001db2a5f0a61adb1417b3e483603abf2f786 (diff) | |
download | FreeBSD-src-091d63007009782645e83fda77ebeff7eb52f243.zip FreeBSD-src-091d63007009782645e83fda77ebeff7eb52f243.tar.gz |
Add new functionality "lock" and "unlock" to provide a simple password
locking mechanism for users. This works by prepending the string
"*LOCKED*" to the password field in master.passwd to prevent successful
decoding.
Diffstat (limited to 'usr.sbin/pw/pw.c')
-rw-r--r-- | usr.sbin/pw/pw.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index 1da063c..2118854 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -35,16 +35,20 @@ static const char rcsid[] = #include <sys/wait.h> #include "pw.h" -const char *Modes[] = {"add", "del", "mod", "show", "next", NULL}; +const char *Modes[] = { + "add", "del", "mod", "show", "next", + NULL}; const char *Which[] = {"user", "group", NULL}; static const char *Combo1[] = { "useradd", "userdel", "usermod", "usershow", "usernext", + "lock", "unlock", "groupadd", "groupdel", "groupmod", "groupshow", "groupnext", NULL}; static const char *Combo2[] = { "adduser", "deluser", "moduser", "showuser", "nextuser", + "lock", "unlock", "addgroup", "delgroup", "modgroup", "showgroup", "nextgroup", -NULL}; + NULL}; struct pwf PWF = { @@ -102,6 +106,8 @@ main(int argc, char *argv[]) "V:C:qn:u:rY", "V:C:qn:u:c:d:e:p:g:G:ml:k:s:w:L:h:FNPY", "V:C:qn:u:FPa7", + "V:C:q", + "V:C:q", "V:C:q" }, { /* grp */ @@ -272,9 +278,9 @@ static void cmdhelp(int mode, int which) { if (which == -1) - fprintf(stderr, "usage: pw [user|group] [add|del|mod|show|next] [ help | switches/values ]\n"); + fprintf(stderr, "usage:\n pw [user|group|lock|unlock] [add|del|mod|show|next] [help|switches/values]\n"); else if (mode == -1) - fprintf(stderr, "usage: pw %s [add|del|mod|show|next] [ help | switches/values ]\n", Which[which]); + fprintf(stderr, "usage:\n pw %s [add|del|mod|show|next] [help|switches/values]\n", Which[which]); else { /* |