[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24659: 'mkdir' procedure is neither thread-safe nor safe (2.0.12)
From: |
tomas |
Subject: |
bug#24659: 'mkdir' procedure is neither thread-safe nor safe (2.0.12) |
Date: |
Mon, 10 Oct 2016 20:25:37 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, Oct 10, 2016 at 06:39:47PM +0200, Ludovic Courtès wrote:
> Hello!
[...]
> Furthermore, AFAICS, the above logic is redundant with what the kernel
> does anyway. That is, in a single-threaded program,
>
> mask = umask (0);
> umask (mask);
> mkdir (file, 0777 ^ mask);
>
> is equivalent to:
>
> mkdir (file, 0777);
>
> Am I right that we should just remove these two ‘umask’ calls?
According to umask(2), yes, you are right. Unless someone has been
trying to work around some platform-specific bug/idiosyncracy.
Regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlf73SEACgkQBcgs9XrR2kZehwCfQ+P2CMZt8doHe2tKi0u1Yc7f
RU0An0WY1oEq/b3vu/X1rNWjTP7ZxUsY
=7Jhs
-----END PGP SIGNATURE-----