From f4882b24fdea18ae33c3269c1f1ec917804842c8 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sat, 23 Sep 2006 15:43:29 +0000 Subject: [PATCH] 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 --- usr.bin/id/id.1 | 10 +++++----- usr.bin/id/id.c | 31 +++++++++++++++---------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/usr.bin/id/id.1 b/usr.bin/id/id.1 index 47e2b297d7b5..899ed7d5c376 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 1e432525f39a..b8f1519dbc42 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]");