Re: [dev] [sbase] rm missing error message?
On Fri, 16 Jun 2017 21:00:40 +0200 Quentin Rameauwrote: > Hi, > > > Sounds like it says you must not write those error message if -f is > > used. Kind of a strange requirement as `2>/dev/null` would do that. > > > > > I don't fully understand the wording in POSIX on the page[0]. > > > > > > [0] > > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html > > “It is less clear that error messages regarding files that cannot be > unlinked (removed) should be suppressed. Although this is historical > practice, this volume of POSIX.1-2008 does not permit the -f option to > suppress such messages.” > Didn't read that part. pgpQ5vLmOB2u7.pgp Description: OpenPGP digital signature
Re: [dev] [sbase] rm missing error message?
Hi, > Sounds like it says you must not write those error message if -f is > used. Kind of a strange requirement as `2>/dev/null` would do that. > > > I don't fully understand the wording in POSIX on the page[0]. > > > > [0] > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html “It is less clear that error messages regarding files that cannot be unlinked (removed) should be suppressed. Although this is historical practice, this volume of POSIX.1-2008 does not permit the -f option to suppress such messages.”
Re: [dev] [sbase] rm missing error message?
Sounds like it says you must not write those error message if -f is used. Kind of a strange requirement as `2>/dev/null` would do that. On Fri, 16 Jun 2017 20:14:58 +0200 Hiltjo Posthumawrote: > On Fri, Jun 16, 2017 at 02:08:24PM -0300, Marc Collin wrote: > > Hello all. > > > > I found a case where sbase rm command fails but doesn't output any > > error message, making it look like it succeeded. > > > > mkdir ./test > > mkdir ./test/test > > sudo chown root:root ./test > > sudo chown root:root ./test/test > > rm -rf ./test > > > > rm won't output anything and exit (apparently) cleanly. > > But the ./test directory won't be deleted. > > Shouldn't a meaningful message be printed to warn about the failure? > > > > Regards. > > > > Hi, > > Regarding the status code: you specify -f so the exit status is not > modified[0]. > > I'm not sure if it's required to print a warning message with the -f option. > My interpretation is it's not neccesary. However on OpenBSD it says: > > $ rm -rf test/ > rm: test/test: Permission denied > rm: test: Operation not permitted > > I don't fully understand the wording in POSIX on the page[0]. > > [0] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html > pgporVpVwjpde.pgp Description: OpenPGP digital signature
Re: [dev] [sbase] rm missing error message?
On Fri, Jun 16, 2017 at 02:08:24PM -0300, Marc Collin wrote: > Hello all. > > I found a case where sbase rm command fails but doesn't output any > error message, making it look like it succeeded. > > mkdir ./test > mkdir ./test/test > sudo chown root:root ./test > sudo chown root:root ./test/test > rm -rf ./test > > rm won't output anything and exit (apparently) cleanly. > But the ./test directory won't be deleted. > Shouldn't a meaningful message be printed to warn about the failure? > > Regards. > Hi, Regarding the status code: you specify -f so the exit status is not modified[0]. I'm not sure if it's required to print a warning message with the -f option. My interpretation is it's not neccesary. However on OpenBSD it says: $ rm -rf test/ rm: test/test: Permission denied rm: test: Operation not permitted I don't fully understand the wording in POSIX on the page[0]. [0] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html -- Kind regards, Hiltjo
[dev] [sbase] rm missing error message?
Hello all. I found a case where sbase rm command fails but doesn't output any error message, making it look like it succeeded. mkdir ./test mkdir ./test/test sudo chown root:root ./test sudo chown root:root ./test/test rm -rf ./test rm won't output anything and exit (apparently) cleanly. But the ./test directory won't be deleted. Shouldn't a meaningful message be printed to warn about the failure? Regards.