1
0
mirror of https://github.com/systemd/systemd synced 2025-10-06 12:14:46 +02:00

Compare commits

..

No commits in common. "8f5eaeb143dd9e58503980ae5f63dd78c463180e" and "a00078e8c8af30d1d2e23817646ed05ba1f9cfdd" have entirely different histories.

2 changed files with 11 additions and 8 deletions

View File

@ -340,9 +340,6 @@ static int update_efi_boot_binaries(const char *esp_path, const char *source_pat
_cleanup_free_ char *p = NULL; _cleanup_free_ char *p = NULL;
int r, ret = 0; int r, ret = 0;
assert(esp_path);
assert(source_path);
r = chase_and_opendir("/EFI/BOOT", esp_path, CHASE_PREFIX_ROOT|CHASE_PROHIBIT_SYMLINKS, &p, &d); r = chase_and_opendir("/EFI/BOOT", esp_path, CHASE_PREFIX_ROOT|CHASE_PROHIBIT_SYMLINKS, &p, &d);
if (r == -ENOENT) if (r == -ENOENT)
return 0; return 0;
@ -351,6 +348,7 @@ static int update_efi_boot_binaries(const char *esp_path, const char *source_pat
FOREACH_DIRENT(de, d, break) { FOREACH_DIRENT(de, d, break) {
_cleanup_close_ int fd = -EBADF; _cleanup_close_ int fd = -EBADF;
_cleanup_free_ char *v = NULL;
if (!endswith_no_case(de->d_name, ".efi")) if (!endswith_no_case(de->d_name, ".efi"))
continue; continue;
@ -367,14 +365,19 @@ static int update_efi_boot_binaries(const char *esp_path, const char *source_pat
if (r == 0) if (r == 0)
continue; continue;
r = get_file_version(fd, &v);
if (r == -ESRCH)
continue; /* No version information */
if (r < 0)
return r;
if (!startswith(v, "systemd-boot "))
continue;
_cleanup_free_ char *dest_path = path_join(p, de->d_name); _cleanup_free_ char *dest_path = path_join(p, de->d_name);
if (!dest_path) if (!dest_path)
return log_oom(); return log_oom();
r = copy_file_with_version_check(source_path, dest_path, /* force = */ false); RET_GATHER(ret, copy_file_with_version_check(source_path, dest_path, /* force = */ false));
if (IN_SET(r, -ESTALE, -ESRCH))
continue;
RET_GATHER(ret, r);
} }
return ret; return ret;

View File

@ -115,7 +115,7 @@ static void dhcp6_lease_set_lifetime(sd_dhcp6_lease *lease) {
} }
DEFINE_GET_TIME_FUNCTIONS(t1, lifetime_t1); DEFINE_GET_TIME_FUNCTIONS(t1, lifetime_t1);
DEFINE_GET_TIME_FUNCTIONS(t2, lifetime_t2); DEFINE_GET_TIME_FUNCTIONS(t2, lifetime_t1);
DEFINE_GET_TIME_FUNCTIONS(valid_lifetime, lifetime_valid); DEFINE_GET_TIME_FUNCTIONS(valid_lifetime, lifetime_valid);
static void dhcp6_lease_set_server_address(sd_dhcp6_lease *lease, const struct in6_addr *server_address) { static void dhcp6_lease_set_server_address(sd_dhcp6_lease *lease, const struct in6_addr *server_address) {