summaryrefslogtreecommitdiffstats
path: root/pw/pw.c
diff options
context:
space:
mode:
authorDavid Nugent <davidn@FreeBSD.org>1999-10-26 08:34:09 +0000
committerDavid Nugent <davidn@FreeBSD.org>1999-10-26 08:34:09 +0000
commitd8a7a1fff98e0500c91cc3034cd88f9f8bbaa4f7 (patch)
treeaf4aeba732ff91f2085c9cdcf75787b96ecfce85 /pw/pw.c
parentc024324408701116d70a6ebc327da9edf2173488 (diff)
downloadpw-darwin-d8a7a1fff98e0500c91cc3034cd88f9f8bbaa4f7.tar.gz
pw-darwin-d8a7a1fff98e0500c91cc3034cd88f9f8bbaa4f7.tar.zst
pw-darwin-d8a7a1fff98e0500c91cc3034cd88f9f8bbaa4f7.zip
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 'pw/pw.c')
-rw-r--r--pw/pw.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/pw/pw.c b/pw/pw.c
index 1da063c..2118854 100644
--- a/pw/pw.c
+++ b/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 {
/*