Fixes for claude review report (#42152)
This commit is contained in:
@@ -804,7 +804,7 @@ static int executable_is_good(const char *executable) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return !PATH_IN_SET(d, "true"
|
||||
return !PATH_IN_SET(d, "true",
|
||||
"/bin/true",
|
||||
"/usr/bin/true",
|
||||
"/dev/null");
|
||||
|
||||
@@ -123,19 +123,20 @@ static int property_get_cpu_affinity(
|
||||
_cleanup_(cpu_set_done) CPUSet s = {};
|
||||
_cleanup_free_ uint8_t *array = NULL;
|
||||
size_t allocated;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
assert(reply);
|
||||
|
||||
if (c->cpu_affinity_from_numa) {
|
||||
int r;
|
||||
|
||||
r = numa_to_cpu_set(&c->numa_policy, &s);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
(void) cpu_set_to_dbus(c->cpu_affinity_from_numa ? &s : &c->cpu_set, &array, &allocated);
|
||||
r = cpu_set_to_dbus(c->cpu_affinity_from_numa ? &s : &c->cpu_set, &array, &allocated);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return sd_bus_message_append_array(reply, 'y', array, allocated);
|
||||
}
|
||||
|
||||
@@ -5119,6 +5119,7 @@ static int manager_dispatch_pidref_transport_fd(sd_event_source *source, int fd,
|
||||
|
||||
if (n != sizeof(child_pid)) {
|
||||
log_warning("Got pidref message of unexpected size %zi (expected %zu), ignoring.", n, sizeof(child_pid));
|
||||
cmsg_close_all(&msghdr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5138,6 +5139,8 @@ static int manager_dispatch_pidref_transport_fd(sd_event_source *source, int fd,
|
||||
}
|
||||
}
|
||||
|
||||
/* From this point on, the fds are owned by our local variables. Call cmsg_close_all no more. */
|
||||
|
||||
/* Verify and set parent pidref. */
|
||||
if (!ucred || !pid_is_valid(ucred->pid)) {
|
||||
log_warning("Received pidref message without valid credentials. Ignoring.");
|
||||
|
||||
@@ -57,7 +57,7 @@ int coredump_send(CoredumpContext *context) {
|
||||
* what we want to send, and the second one contains
|
||||
* the trailing dots. */
|
||||
copy[0] = *iovec;
|
||||
copy[1] = IOVEC_MAKE(((const char[]){'.', '.', '.'}), 3);
|
||||
copy[1] = IOVEC_MAKE_STRING("...");
|
||||
|
||||
mh.msg_iov = copy;
|
||||
mh.msg_iovlen = 2;
|
||||
|
||||
@@ -244,7 +244,7 @@ int userns_restrict_put_by_inode(
|
||||
|
||||
if (n_try == 0)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EEXIST),
|
||||
"Stillcan't create inode entry in BPF map after 10 tries.");
|
||||
"Still cannot create inode entry in BPF map after 10 tries.");
|
||||
|
||||
r = sym_bpf_map_lookup_elem(outer_map_fd, &ino, &innermap_id);
|
||||
if (r >= 0) {
|
||||
|
||||
+2
-2
@@ -3442,8 +3442,8 @@ static int context_copy_from_one(Context *context, const char *src) {
|
||||
if (!np->copy_blocks_path)
|
||||
return log_oom();
|
||||
|
||||
np->copy_blocks_fd = fcntl(fd, F_DUPFD_CLOEXEC, 3);
|
||||
if (np->copy_blocks_fd < 0)
|
||||
np->copy_blocks_fd = r = RET_NERRNO(fcntl(fd, F_DUPFD_CLOEXEC, 3));
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to duplicate file descriptor of %s: %m", src);
|
||||
|
||||
np->copy_blocks_offset = start;
|
||||
|
||||
@@ -420,7 +420,7 @@ int pattern_match(const char *pattern, const char *s, InstanceMetadata *ret) {
|
||||
}
|
||||
|
||||
default:
|
||||
assert_se("unexpected pattern element");
|
||||
assert_not_reached();
|
||||
}
|
||||
|
||||
p = n;
|
||||
|
||||
Reference in New Issue
Block a user