summaryrefslogtreecommitdiffstats
path: root/pw
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-06-07 21:57:20 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-06-07 21:57:20 +0000
commit44a564bd4185ea1e172a8f310d13f71f24abf73f (patch)
tree783b2a888312a7cd12a09886e65419f79bf28825 /pw
parent50b3230917e6e4c6538d6d0f01fed543b8be5efc (diff)
downloadpw-darwin-44a564bd4185ea1e172a8f310d13f71f24abf73f.tar.gz
pw-darwin-44a564bd4185ea1e172a8f310d13f71f24abf73f.tar.zst
pw-darwin-44a564bd4185ea1e172a8f310d13f71f24abf73f.zip
Remove '-q' support for pw [user|group] next
the intent of -q in this command is to return as exit status the value of the next group/user id, which does not make sense given exit status are limited to values between 0 and 255.
Diffstat (limited to 'pw')
-rw-r--r--pw/pw.84
-rw-r--r--pw/pw.c8
-rw-r--r--pw/pw_group.c7
-rw-r--r--pw/pw_user.c10
4 files changed, 9 insertions, 20 deletions
diff --git a/pw/pw.8 b/pw/pw.8
index 9074313..1c1f740 100644
--- a/pw/pw.8
+++ b/pw/pw.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 3, 2015
+.Dd June 7, 2015
.Dt PW 8
.Os
.Sh NAME
@@ -128,7 +128,6 @@
.Op Fl V Ar etcdir
.Ar usernext
.Op Fl C Ar config
-.Op Fl q
.Nm
.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
@@ -184,7 +183,6 @@
.Op Fl V Ar etcdir
.Ar groupnext
.Op Fl C Ar config
-.Op Fl q
.Nm
.Op Fl R Ar rootdir
.Op Fl V Ar etcdir
diff --git a/pw/pw.c b/pw/pw.c
index 30fb55b..d75557e 100644
--- a/pw/pw.c
+++ b/pw/pw.c
@@ -113,7 +113,7 @@ main(int argc, char *argv[])
"R:V:C:qn:u:rY",
"R:V:C:qn:u:c:d:e:p:g:G:mM:l:k:s:w:L:h:H:FNPY",
"R:V:C:qn:u:FPa7",
- "R:V:C:q",
+ "R:V:C",
"R:V:C:q",
"R:V:C:q"
},
@@ -122,7 +122,7 @@ main(int argc, char *argv[])
"R:V:C:qn:g:Y",
"R:V:C:qn:d:g:l:h:H:FM:m:NPY",
"R:V:C:qn:g:FPa",
- "R:V:C:q"
+ "R:V:C"
}
};
@@ -469,8 +469,7 @@ cmdhelp(int mode, int which)
"usage: pw usernext [switches]\n"
"\t-V etcdir alternate /etc location\n"
"\t-R rootir alternate root directory\n"
- "\t-C config configuration file\n"
- "\t-q quiet operation\n",
+ "\t-C config configuration file\n",
"usage pw: lock [switches]\n"
"\t-V etcdir alternate /etc locations\n"
"\t-C config configuration file\n"
@@ -524,7 +523,6 @@ cmdhelp(int mode, int which)
"\t-V etcdir alternate /etc location\n"
"\t-R rootir alternate root directory\n"
"\t-C config configuration file\n"
- "\t-q quiet operation\n"
}
};
diff --git a/pw/pw_group.c b/pw/pw_group.c
index b9cce0d..e504a12 100644
--- a/pw/pw_group.c
+++ b/pw/pw_group.c
@@ -73,11 +73,8 @@ pw_group(int mode, char *name, long id, struct cargs * args)
* next gid to stdout
*/
if (mode == M_NEXT) {
- gid_t next = gr_gidpolicy(cnf, id);
- if (getarg(args, 'q'))
- return next;
- printf("%u\n", next);
- return EXIT_SUCCESS;
+ printf("%u\n", gr_gidpolicy(cnd, id));
+ return (EXIT_SUCCESS);
}
if (mode == M_PRINT && getarg(args, 'a')) {
diff --git a/pw/pw_user.c b/pw/pw_user.c
index c3b2751..ea3cb3d 100644
--- a/pw/pw_user.c
+++ b/pw/pw_user.c
@@ -158,14 +158,10 @@ pw_user(int mode, char *name, long id, struct cargs * args)
* With M_NEXT, we only need to return the
* next uid to stdout
*/
- if (mode == M_NEXT)
- {
- uid_t next = pw_uidpolicy(cnf, id);
- if (getarg(args, 'q'))
- return next;
- printf("%u:", next);
+ if (mode == M_NEXT) {
+ printf("%u:", pw_uidpolicy(cnf, id));
pw_group(mode, name, -1, args);
- return EXIT_SUCCESS;
+ return (EXIT_SUCCESS);
}
/*