mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-10 13:41:35 +00:00
util: get rid of unnecessary umask() call
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> (cherry picked from commit d00c6fd25854bfd4822f6ce3d769a8ca132ec31b)
This commit is contained in:
parent
a34ec87d2d
commit
818c5c6b83
@ -545,17 +545,15 @@ virPidFileConstructPath(bool privileged,
|
|||||||
if (virAsprintf(pidfile, "%s/run/%s.pid", statedir, progname) < 0)
|
if (virAsprintf(pidfile, "%s/run/%s.pid", statedir, progname) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else {
|
} else {
|
||||||
mode_t old_umask;
|
|
||||||
|
|
||||||
if (!(rundir = virGetUserRuntimeDirectory()))
|
if (!(rundir = virGetUserRuntimeDirectory()))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
old_umask = umask(077);
|
if (virFileMakePathWithMode(rundir, 0700) < 0) {
|
||||||
if (virFileMakePath(rundir) < 0) {
|
virReportSystemError(errno,
|
||||||
umask(old_umask);
|
_("Cannot create user runtime directory '%s'"),
|
||||||
|
rundir);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
umask(old_umask);
|
|
||||||
|
|
||||||
if (virAsprintf(pidfile, "%s/%s.pid", rundir, progname) < 0) {
|
if (virAsprintf(pidfile, "%s/%s.pid", rundir, progname) < 0) {
|
||||||
VIR_FREE(rundir);
|
VIR_FREE(rundir);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user