Bug#661627: init script x11-common creates directories in insecure manners
On Tue, Feb 28, 2012 at 06:42:59PM +0100, Julien Cristau wrote:
> > As a solution, I would suggest to take care of the "mkdir" return codes
> > (line 36 and 50). To do not change permissions on failures.
> >
> This script is set -e AFAICT, which means it already does care about the
> mkdir return code.
Yes but with the "-p" option, mkdir always return 0 (success):
$ mkdir /tmp/dir
$ mkdir /tmp/dir
mkdir: cannot create directory `/tmp/dir': File exists
$ echo $?
1
$ mkdir -p /tmp/dir
$ echo $?
0
I have a working PoC if needed.
Regards,
--
http://vladz.devzero.fr
PGP key 8F7E2D3C from pgp.mit.edu
Reply to: