summaryrefslogtreecommitdiff
path: root/libfshelp
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2021-05-29 18:08:52 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-10 22:15:31 +0200
commit2e3a1e0f028ae5498d96a4a3618a3533e062d2eb (patch)
tree9db11a0c0e5743069106e83bd2a9d3639dd40e38 /libfshelp
parentffead1cbcaa1db5db525403043e27d618af8752b (diff)
Remove the concept of process owner
Now that it's completely unused. procinfo.owner is now simply set to the first UID that a process has. proc_setowner () is kept for compatibility, but now does nothing. The clients still try to call it, though, for compatibility with older proc server versions.
Diffstat (limited to 'libfshelp')
-rw-r--r--libfshelp/exec-reauth.c9
-rw-r--r--libfshelp/start-translator-long.c12
2 files changed, 15 insertions, 6 deletions
diff --git a/libfshelp/exec-reauth.c b/libfshelp/exec-reauth.c
index 9b6087c7..7b87d576 100644
--- a/libfshelp/exec-reauth.c
+++ b/libfshelp/exec-reauth.c
@@ -131,9 +131,12 @@ fshelp_exec_reauth (int suid, uid_t uid, int sgid, gid_t gid,
/* Re-authenticate the exec parameters. */
exec_reauth (newauth, _secure, 0, ports, num_ports, fds, num_fds);
- proc_setowner (ports[INIT_PORT_PROC],
- eff_uids->num > 0 ? eff_uids->ids[0] : 0,
- !eff_uids->num);
+ /* Try proc_setowner () for compatibility with older proc server. */
+ err = proc_setowner (ports[INIT_PORT_PROC],
+ eff_uids->num > 0 ? eff_uids->ids[0] : 0,
+ !eff_uids->num);
+ if (err == EOPNOTSUPP)
+ err = 0;
abandon_suid:
if (eff_uids)
diff --git a/libfshelp/start-translator-long.c b/libfshelp/start-translator-long.c
index af893ba2..1bbf310a 100644
--- a/libfshelp/start-translator-long.c
+++ b/libfshelp/start-translator-long.c
@@ -267,9 +267,15 @@ fshelp_start_translator_long (fshelp_open_fn_t underlying_open_fn,
proc_child (proc, task);
err = proc_task2proc (proc, task, &ports[INIT_PORT_PROC]);
if (!err)
- err = proc_setowner (ports[INIT_PORT_PROC],
- owner_uid,
- owner_uid == (uid_t) -1);
+ {
+ /* Try proc_setowner () for compatibility with
+ older proc server. */
+ err = proc_setowner (ports[INIT_PORT_PROC],
+ owner_uid,
+ owner_uid == (uid_t) -1);
+ if (err == EOPNOTSUPP)
+ err = 0;
+ }
if (deallocate_proc)
mach_port_deallocate (mach_task_self (), proc);
if (err)