Hi Dave, > As for "/bin/ls && /bin/ls", since neither command runs neither one fails, > either. 'Tis a bit of a head-scratcher, though.
Failure to run can in no way be construed as success, as is shown by: $ bash --restricted -c "/bin/ls"; echo $? bash: /bin/ls: restricted: cannot specify `/' in command names 1 It's the combination of commands that causes problems. Chet Ramey has acknowledged this as a bug. In the meantime, can anyone suggest a workaround? Regards, David Pitt | Developer/Designer TI SD Risk Systems | Technology Solution Delivery | OTSS >Level 3 Core A 833 Bourke Street Docklands VIC 3008 >Australia and New Zealand Banking Group Ltd | www.anz.com > -----Original Message----- From: dave.rutherf...@gmail.com [mailto:dave.rutherf...@gmail.com] On Behalf Of Dave Rutherford Sent: Monday, 24 May 2010 6:26 PM To: Pitt, David Cc: bug-bash@gnu.org Subject: Re: Failed bash -r command returns 0 exit status On Mon, May 24, 2010 at 02:48, Pitt, David <david.p...@anz.com> wrote: > However executing "/bin/ls && /bin/ls" under a restricted shell > returns a zero exit > status. This is not expected (at least not by me!). Zero exit > status is returned with > any list of commands, e.g. "/bin/ls && :". That one would, since the second command is 'true'. Replace it with 'false' and you should see an exit status of 1. As for "/bin/ls && /bin/ls", since neither command runs neither one fails, either. 'Tis a bit of a head-scratcher, though. Dave "This e-mail and any attachments to it (the "Communication") is, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities including ANZ National Bank Limited (together "ANZ"). ANZ does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication."