cgroup-util: add remoteness checks to all cg_pidref_get_xyz() calls

This commit is contained in:
Lennart Poettering
2025-01-06 09:54:41 +01:00
parent 1740d3e04b
commit dd445d6e99
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -839,6 +839,8 @@ int cg_pidref_get_path(const char *controller, const PidRef *pidref, char **ret_
if (!pidref_is_set(pidref))
return -ESRCH;
if (pidref_is_remote(pidref))
return -EREMOTE;
r = cg_pid_get_path(controller, pidref->pid, &path);
if (r < 0)
@@ -1204,6 +1206,8 @@ int cg_pidref_get_unit(const PidRef *pidref, char **ret) {
if (!pidref_is_set(pidref))
return -ESRCH;
if (pidref_is_remote(pidref))
return -EREMOTE;
r = cg_pid_get_unit(pidref->pid, &unit);
if (r < 0)