aboutsummaryrefslogtreecommitdiff
path: root/libfshelp
diff options
context:
space:
mode:
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)