From: Jim Meyering Date: Sat, 28 Sep 2002 07:55:08 +0000 (+0000) Subject: (make_path): Restore umask *before* creating the final component. X-Git-Tag: v4.5.2~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddb038c033eb6a9b1ba4820d6cc053411bedde40;p=thirdparty%2Fcoreutils.git (make_path): Restore umask *before* creating the final component. --- diff --git a/lib/makepath.c b/lib/makepath.c index 007301077e..4f954ba3a0 100644 --- a/lib/makepath.c +++ b/lib/makepath.c @@ -355,6 +355,9 @@ make_path (const char *argpath, if (!do_chdir) basename_dir = dirpath; + /* Done creating leading directories. Restore original umask. */ + umask (oldmask); + /* We're done making leading directories. Create the final component of the path. */ @@ -364,9 +367,6 @@ make_path (const char *argpath, return 1; } - /* Done creating directories. Restore original umask. */ - umask (oldmask); - if (verbose_fmt_string != NULL) error (0, 0, verbose_fmt_string, quote (dirpath));