Re: Bail out on "id -R user"
On Tue, 30 May 2023 09:47:08 +0200, Omar Polo wrote: > fwiw I agree. Although it doesn't makes much sense to pass an > argument to id -R, not failing may give the wrong impression. > > ok op@ (i'll wait a bit before commiting this in case someone > disagrees) OK millert@ as well if you want to commit it. - todd
Re: Bail out on "id -R user"
On 2023/05/29 16:37:39 +, Lucas wrote: > Ping. > > > According to both usage() and id.1, "id -R" doesn't accept any > > positional arguments. This diff makes program behave like that. sorry for the delay, i wanted to take a look earlier. fwiw I agree. Although it doesn't makes much sense to pass an argument to id -R, not failing may give the wrong impression. ok op@ (i'll wait a bit before commiting this in case someone disagrees) > diff refs/heads/master refs/heads/id-R-usage > commit - 55055d619d36cc45f8c6891404c51cd405214e86 > commit + 214ec9c042895b8482378b6ee43530ce4ffe9e21 > blob - 30e2c58e088b69dba98577693e37dd961b4eadc4 > blob + 1f4b678597065fb4243f660b4f66040021c56895 > --- usr.bin/id/id.c > +++ usr.bin/id/id.c > @@ -128,6 +128,8 @@ main(int argc, char *argv[]) > usage(); > > if (Rflag) { > + if (argc != 0) > + usage(); > printf("%d\n", getrtable()); > exit(0); > }
Re: Bail out on "id -R user"
Ping. > According to both usage() and id.1, "id -R" doesn't accept any > positional arguments. This diff makes program behave like that. diff refs/heads/master refs/heads/id-R-usage commit - 55055d619d36cc45f8c6891404c51cd405214e86 commit + 214ec9c042895b8482378b6ee43530ce4ffe9e21 blob - 30e2c58e088b69dba98577693e37dd961b4eadc4 blob + 1f4b678597065fb4243f660b4f66040021c56895 --- usr.bin/id/id.c +++ usr.bin/id/id.c @@ -128,6 +128,8 @@ main(int argc, char *argv[]) usage(); if (Rflag) { + if (argc != 0) + usage(); printf("%d\n", getrtable()); exit(0); }