Re: [hackers] [sbase] chown: fix user:group option parsing

2015-12-21 Thread Dimitris Papastamos
On Mon, Dec 21, 2015 at 08:16:28PM +0100, FRIGN wrote: > On Mon, 21 Dec 2015 19:05:17 + > Dimitris Papastamos wrote: > > > uid_t, gid_t are typically unsigned, so the check needs to be > > == -1 otherwise it will never be true. > > We both are wrong :P It can either be signed

Re: [hackers] [sbase] chown: fix user:group option parsing

2015-12-21 Thread FRIGN
On Mon, 21 Dec 2015 19:05:17 + Dimitris Papastamos wrote: > uid_t, gid_t are typically unsigned, so the check needs to be > == -1 otherwise it will never be true. We both are wrong :P It can either be signed or unsigned. -- FRIGN

Re: [hackers] [sbase] chown: fix user:group option parsing

2015-12-21 Thread FRIGN
On Mon, 21 Dec 2015 19:37:10 +0100 Quentin Rameau wrote: > + if (uid == -1 && gid == -1) > + usage(); better use < 0 than -1 -- FRIGN

[hackers] [sbase] chown: fix user:group option parsing || Quentin Rameau

2015-12-21 Thread git
commit a02d66b8fc651979b7f905f78722a6192896eb90 Author: Quentin Rameau AuthorDate: Mon Dec 21 19:37:10 2015 +0100 Commit: sin CommitDate: Mon Dec 21 19:07:51 2015 + chown: fix user:group option parsing Check that either user or group is

Re: [hackers] [sbase] chown: fix user:group option parsing

2015-12-21 Thread Dimitris Papastamos
> + if (uid < 0 && gid < 0) > + usage(); > + uid_t, gid_t are typically unsigned, so the check needs to be == -1 otherwise it will never be true.