1
0
mirror of https://github.com/systemd/systemd synced 2026-03-16 18:14:46 +01:00

Compare commits

..

5 Commits

Author SHA1 Message Date
Mike Yuan
a9859a62f1
reread-partition-table: fix typo 2026-01-21 02:15:09 +01:00
Mike Yuan
14d4bb527c
prompt-util: trivial header cleanups (#40407) 2026-01-21 01:38:19 +01:00
Mike Yuan
dbd7555190 mkdir: reset mtime *after* fchown()
Follow-up for 34c3d574742e867ef97e79509e4051a82f1b7d9b

Also, drop pointless shortcut.
2026-01-21 08:35:31 +09:00
Mike Yuan
475c8a491f
prompt-util: use our own sd-varlink header 2026-01-21 00:10:08 +01:00
Mike Yuan
dca48de7ed
prompt-util: drop unneeded inclusion of stdbool.h
Our -forward headers have it covered.
2026-01-21 00:09:49 +01:00
4 changed files with 4 additions and 9 deletions

View File

@ -255,8 +255,8 @@ int mkdir_p_root_full(const char *root, const char *p, uid_t uid, gid_t gid, mod
if (nfd < 0) if (nfd < 0)
return nfd; return nfd;
if (ts == USEC_INFINITY && !uid_is_valid(uid) && !gid_is_valid(gid)) if ((uid_is_valid(uid) || gid_is_valid(gid)) && fchown(nfd, uid, gid) < 0)
return 1; return -errno;
if (ts != USEC_INFINITY) { if (ts != USEC_INFINITY) {
struct timespec tspec; struct timespec tspec;
@ -269,8 +269,5 @@ int mkdir_p_root_full(const char *root, const char *p, uid_t uid, gid_t gid, mod
return -errno; return -errno;
} }
if ((uid_is_valid(uid) || gid_is_valid(gid)) && fchown(nfd, uid, gid) < 0)
return -errno;
return 1; return 1;
} }

View File

@ -2,7 +2,7 @@
#include <unistd.h> #include <unistd.h>
#include <sd-varlink.h> #include "sd-varlink.h"
#include "alloc-util.h" #include "alloc-util.h"
#include "glyph-util.h" #include "glyph-util.h"

View File

@ -1,8 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once #pragma once
#include <stdbool.h>
#include "shared-forward.h" #include "shared-forward.h"
typedef enum PromptFlags { typedef enum PromptFlags {

View File

@ -6,7 +6,7 @@
#include "shared-forward.h" #include "shared-forward.h"
typedef enum RereadPartitionTableFlags { typedef enum RereadPartitionTableFlags {
REREADPT_FORCE_UEVENT = 1 << 0, /* Force a "change" ueven out on partitions we didn't resize/remove/add */ REREADPT_FORCE_UEVENT = 1 << 0, /* Force a "change" uevent out on partitions we didn't resize/remove/add */
REREADPT_BSD_LOCK = 1 << 1, /* Take a BSD lock on the device around the rescan operation */ REREADPT_BSD_LOCK = 1 << 1, /* Take a BSD lock on the device around the rescan operation */
} RereadPartitionTableFlags; } RereadPartitionTableFlags;