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
This commit is contained in:
parent
7c56049e6d
commit
f4882b24fd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=162578
@ -45,6 +45,8 @@
|
|||||||
.Nm
|
.Nm
|
||||||
.Op Ar user
|
.Op Ar user
|
||||||
.Nm
|
.Nm
|
||||||
|
.Fl A
|
||||||
|
.Nm
|
||||||
.Fl G Op Fl n
|
.Fl G Op Fl n
|
||||||
.Op Ar user
|
.Op Ar user
|
||||||
.Nm
|
.Nm
|
||||||
@ -53,8 +55,6 @@
|
|||||||
.Fl P
|
.Fl P
|
||||||
.Op Ar user
|
.Op Ar user
|
||||||
.Nm
|
.Nm
|
||||||
.Fl a
|
|
||||||
.Nm
|
|
||||||
.Fl g Op Fl nr
|
.Fl g Op Fl nr
|
||||||
.Op Ar user
|
.Op Ar user
|
||||||
.Nm
|
.Nm
|
||||||
@ -79,6 +79,9 @@ In this case, the real and effective IDs are assumed to be the same.
|
|||||||
.Pp
|
.Pp
|
||||||
The options are as follows:
|
The options are as follows:
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
|
.It Fl A
|
||||||
|
Display the process audit user ID and other process audit properties, which
|
||||||
|
requires privilege.
|
||||||
.It Fl G
|
.It Fl G
|
||||||
Display the different group IDs (effective, real and supplementary)
|
Display the different group IDs (effective, real and supplementary)
|
||||||
as white-space separated numbers, in no particular order.
|
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.
|
Display the MAC label of the current process.
|
||||||
.It Fl P
|
.It Fl P
|
||||||
Display the id as a password file entry.
|
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
|
.It Fl g
|
||||||
Display the effective group ID as a number.
|
Display the effective group ID as a number.
|
||||||
.It Fl n
|
.It Fl n
|
||||||
|
@ -78,11 +78,11 @@ main(int argc, char *argv[])
|
|||||||
struct group *gr;
|
struct group *gr;
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
int Gflag, Mflag, Pflag, ch, gflag, id, nflag, pflag, rflag, uflag;
|
int Gflag, Mflag, Pflag, ch, gflag, id, nflag, pflag, rflag, uflag;
|
||||||
int aflag;
|
int Aflag;
|
||||||
const char *myname;
|
const char *myname;
|
||||||
|
|
||||||
Gflag = Mflag = Pflag = gflag = nflag = pflag = rflag = uflag = 0;
|
Gflag = Mflag = Pflag = gflag = nflag = pflag = rflag = uflag = 0;
|
||||||
aflag = 0;
|
Aflag = 0;
|
||||||
|
|
||||||
myname = strrchr(argv[0], '/');
|
myname = strrchr(argv[0], '/');
|
||||||
myname = (myname != NULL) ? myname + 1 : argv[0];
|
myname = (myname != NULL) ? myname + 1 : argv[0];
|
||||||
@ -96,8 +96,13 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv,
|
while ((ch = getopt(argc, argv,
|
||||||
(isgroups || iswhoami) ? "" : "PGMagnpru")) != -1)
|
(isgroups || iswhoami) ? "" : "APGMgnpru")) != -1)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
|
#ifdef USE_BSM_AUDIT
|
||||||
|
case 'A':
|
||||||
|
Aflag = 1;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case 'G':
|
case 'G':
|
||||||
Gflag = 1;
|
Gflag = 1;
|
||||||
break;
|
break;
|
||||||
@ -107,9 +112,6 @@ main(int argc, char *argv[])
|
|||||||
case 'P':
|
case 'P':
|
||||||
Pflag = 1;
|
Pflag = 1;
|
||||||
break;
|
break;
|
||||||
case 'a':
|
|
||||||
aflag = 1;
|
|
||||||
break;
|
|
||||||
case 'g':
|
case 'g':
|
||||||
gflag = 1;
|
gflag = 1;
|
||||||
break;
|
break;
|
||||||
@ -135,7 +137,7 @@ main(int argc, char *argv[])
|
|||||||
if (iswhoami && argc > 0)
|
if (iswhoami && argc > 0)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
switch(Gflag + Mflag + Pflag + aflag + gflag + pflag + uflag) {
|
switch(Aflag + Gflag + Mflag + Pflag + gflag + pflag + uflag) {
|
||||||
case 1:
|
case 1:
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
@ -152,13 +154,10 @@ main(int argc, char *argv[])
|
|||||||
usage();
|
usage();
|
||||||
|
|
||||||
#ifdef USE_BSM_AUDIT
|
#ifdef USE_BSM_AUDIT
|
||||||
if (aflag) {
|
if (Aflag) {
|
||||||
auditid();
|
auditid();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (aflag)
|
|
||||||
usage();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (gflag) {
|
if (gflag) {
|
||||||
@ -418,16 +417,16 @@ usage(void)
|
|||||||
else if (iswhoami)
|
else if (iswhoami)
|
||||||
(void)fprintf(stderr, "usage: whoami\n");
|
(void)fprintf(stderr, "usage: whoami\n");
|
||||||
else
|
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]",
|
"usage: id [user]",
|
||||||
" id -G [-n] [user]",
|
|
||||||
" id -M",
|
|
||||||
" id -P [user]",
|
|
||||||
#ifdef USE_BSM_AUDIT
|
#ifdef USE_BSM_AUDIT
|
||||||
" id -a\n",
|
" id -A\n",
|
||||||
#else
|
#else
|
||||||
"",
|
"",
|
||||||
#endif
|
#endif
|
||||||
|
" id -G [-n] [user]",
|
||||||
|
" id -M",
|
||||||
|
" id -P [user]",
|
||||||
" id -g [-nr] [user]",
|
" id -g [-nr] [user]",
|
||||||
" id -p [user]",
|
" id -p [user]",
|
||||||
" id -u [-nr] [user]");
|
" id -u [-nr] [user]");
|
||||||
|
Loading…
Reference in New Issue
Block a user