summaryrefslogtreecommitdiffstats
path: root/usr.bin/id
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-09-23 15:43:29 +0000
committerrwatson <rwatson@FreeBSD.org>2006-09-23 15:43:29 +0000
commit2f0a02201d4138870fc8e30f35809b7c9e2c86ea (patch)
tree2b8cc6ba0aa5fbc99c719252e5630d6ecee5c15e /usr.bin/id
parent9af53fcaabbc08489f360aaebe10bb92a9f7d9a6 (diff)
downloadFreeBSD-src-2f0a02201d4138870fc8e30f35809b7c9e2c86ea.zip
FreeBSD-src-2f0a02201d4138870fc8e30f35809b7c9e2c86ea.tar.gz
Rename "-a" flag to "-A" in order to avoid conflicting with the "-a" flag
as found on Solaris. Requested by: ceri MFC after: 3 days
Diffstat (limited to 'usr.bin/id')
-rw-r--r--usr.bin/id/id.110
-rw-r--r--usr.bin/id/id.c31
2 files changed, 20 insertions, 21 deletions
diff --git a/usr.bin/id/id.1 b/usr.bin/id/id.1
index 47e2b29..899ed7d 100644
--- a/usr.bin/id/id.1
+++ b/usr.bin/id/id.1
@@ -45,6 +45,8 @@
.Nm
.Op Ar user
.Nm
+.Fl A
+.Nm
.Fl G Op Fl n
.Op Ar user
.Nm
@@ -53,8 +55,6 @@
.Fl P
.Op Ar user
.Nm
-.Fl a
-.Nm
.Fl g Op Fl nr
.Op Ar user
.Nm
@@ -79,6 +79,9 @@ In this case, the real and effective IDs are assumed to be the same.
.Pp
The options are as follows:
.Bl -tag -width indent
+.It Fl A
+Display the process audit user ID and other process audit properties, which
+requires privilege.
.It Fl G
Display the different group IDs (effective, real and supplementary)
as white-space separated numbers, in no particular order.
@@ -86,9 +89,6 @@ as white-space separated numbers, in no particular order.
Display the MAC label of the current process.
.It Fl P
Display the id as a password file entry.
-.It Fl a
-Display the process audit user ID and other process audit properties, which
-requires privilege.
.It Fl g
Display the effective group ID as a number.
.It Fl n
diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c
index 1e43252..b8f1519 100644
--- a/usr.bin/id/id.c
+++ b/usr.bin/id/id.c
@@ -78,11 +78,11 @@ main(int argc, char *argv[])
struct group *gr;
struct passwd *pw;
int Gflag, Mflag, Pflag, ch, gflag, id, nflag, pflag, rflag, uflag;
- int aflag;
+ int Aflag;
const char *myname;
Gflag = Mflag = Pflag = gflag = nflag = pflag = rflag = uflag = 0;
- aflag = 0;
+ Aflag = 0;
myname = strrchr(argv[0], '/');
myname = (myname != NULL) ? myname + 1 : argv[0];
@@ -96,8 +96,13 @@ main(int argc, char *argv[])
}
while ((ch = getopt(argc, argv,
- (isgroups || iswhoami) ? "" : "PGMagnpru")) != -1)
+ (isgroups || iswhoami) ? "" : "APGMgnpru")) != -1)
switch(ch) {
+#ifdef USE_BSM_AUDIT
+ case 'A':
+ Aflag = 1;
+ break;
+#endif
case 'G':
Gflag = 1;
break;
@@ -107,9 +112,6 @@ main(int argc, char *argv[])
case 'P':
Pflag = 1;
break;
- case 'a':
- aflag = 1;
- break;
case 'g':
gflag = 1;
break;
@@ -135,7 +137,7 @@ main(int argc, char *argv[])
if (iswhoami && argc > 0)
usage();
- switch(Gflag + Mflag + Pflag + aflag + gflag + pflag + uflag) {
+ switch(Aflag + Gflag + Mflag + Pflag + gflag + pflag + uflag) {
case 1:
break;
case 0:
@@ -152,13 +154,10 @@ main(int argc, char *argv[])
usage();
#ifdef USE_BSM_AUDIT
- if (aflag) {
+ if (Aflag) {
auditid();
exit(0);
}
-#else
- if (aflag)
- usage();
#endif
if (gflag) {
@@ -418,16 +417,16 @@ usage(void)
else if (iswhoami)
(void)fprintf(stderr, "usage: whoami\n");
else
- (void)fprintf(stderr, "%s\n%s\n%s\n%s%s\n%s\n%s\n%s\n",
+ (void)fprintf(stderr, "%s\n%s%s\n%s\n%s\n%s\n%s\n%s\n",
"usage: id [user]",
- " id -G [-n] [user]",
- " id -M",
- " id -P [user]",
#ifdef USE_BSM_AUDIT
- " id -a\n",
+ " id -A\n",
#else
"",
#endif
+ " id -G [-n] [user]",
+ " id -M",
+ " id -P [user]",
" id -g [-nr] [user]",
" id -p [user]",
" id -u [-nr] [user]");
OpenPOWER on IntegriCloud