summaryrefslogtreecommitdiff
path: root/libfshelp/start-translator-long.c
AgeCommit message (Collapse)Author
2023-12-17Update hurd code to handle the new ABI for sending inlined port rights.Flavio Cruz
2023-12-03Revert "Update hurd code to handle the new ABI for sending inlined port rights."Samuel Thibault
This reverts commit 33c30b4ff76ca22bdedce4aa41d05736a546d86b.
2023-12-03Update hurd code to handle the new ABI for sending inlined port rights.Flavio Cruz
Message-ID: <20231124213041.952886-3-flaviocruz@gmail.com>
2023-11-19libfshelp: type check messages using the full mach_msg_type_t so that it ↵Flavio Cruz
works on x86_64. Message-ID: <ZVlHm2xuVaS8SItY@jupiter.tail36e24.ts.net>
2023-05-10libfshelp: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-5-bugaevc@gmail.com>
2023-05-04Use designated initializers when building mach_msg_type_tFlavio Cruz
Message-Id: <ZFLcIs0iwiC9kQDf@jupiter.tail36e24.ts.net>
2022-08-10Rename proc_complete_reauthentication to proc_reauthenticate_completeSamuel Thibault
For coherency with the existing RPCs
2022-08-10Make proc_reauthenticate () recreate proc portSergey Bugaev
And add proc_complete_reauthentication ()
2022-08-10Remove the concept of process ownerSergey Bugaev
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.
2022-08-10libfshelp: Handle proc port in fshelp_start_translator_long ()Sergey Bugaev
While fshelp_start_translator_long () has been calling proc_setowner () on the task it creates, it has never reauthenticated its process. This meant that the translator, once started, could access processes authenticated same as the process that called fshelp_start_translator_long (). In particular, this means that any unprivileged translator started by a privileged parent translator had in fact had a privileged proc port, and could access other processes through it. With this change, fshelp_start_translator_long () will now reauthenticate the process it creates. Moreover, it will now respect a custom proc server port passed in the given ports.
2022-08-10libfshelp: Cosmetic cleanupsSergey Bugaev
2022-08-10libfshelp: Simplify fshelp_start_translator_long () a bitSergey Bugaev
It only really supports ports_len > INIT_PORT_BOOTSTRAP, ports_type == MACH_MSG_TYPE_COPY_SEND, fds_type == MACH_MSG_TYPE_COPY_SEND. Make that explicit, and remove the branches that tried to handle the other cases.
2022-08-10libfshelp: Update some commentsSergey Bugaev
2018-03-05Fix warningsSamuel Thibault
* libdiskfs/boot-start.c (diskfs_start_bootstrap): Fix printf format. * libfshelp/delegate.c: Include <alloca.h> and <stdlib.h>. * libfshelp/start-translator-long.c: Include <stdlib.h>. * libshouldbeinlibc/ugids-verify-auth.c (server_verify_make_auth): Fix prototypes for password_check_group and password_check_user. * libstore/argp.c: Include <stdlib.h>. * libstore/task.c: Include <stdlib.h>. * exec/exec.c: Include <mach/vm_param.h>. * libbpf/bpf_impl.c: Include <stdlib.h>. * proc/info.c (S_proc_getloginpids): Remove local variables leader_task and leader_sub. * proc/main.c (main): Remove local variable original_argv. * boot/boot.c (task_died, S_mach_notify_new_task): Fix printf format. * exec/elfcore.c: Include <alloca.h> and <mach/vm_param.h>. * trans/crash.c: Include <hurd/msg.h>. * trans/random.c: Include <signal.h>. * utils/login.c: Include <signal.h>. * utils/id.c: Include <hurd/msg.h>. * utils/devprobe.c: Include <stdlib.h>. * utils/addauth.c: Include <hurd/msg.h>. * utils/frobauth-mod.c: Include <hurd/msg.h>. * utils/storeread.c: Include <stdlib.h>. * utils/msgport.c: Include <hurd/msg.h>. * sutils/clookup.c (file_name_lookup_carefully): Fix lookup function prototype, make head and tail const. * utils/rpcscan.c: Include <stdlib.h>. * sutils/bless.c: Include <stdlib.h>. * fstests/fstests.c: Include <stdlib.h>. * startup/startup.c (argz_task_insert_right): Fix printf format. * init/init.c: Include <stdlib.h>.
2018-01-08Add a file_exec_file_name RPCEmilio Pozuelo Monfort
* hurd/fs.defs (file_exec): Deprecate in favor of... (file_exec_paths): ...this new RPC. * TODO: Update. * doc/hurd.texi: Update RPC name. * hurd/hurd_types.h: Update RPC name. * libdiskfs/boot-start.c: Update RPC name. * configure.ac: Check for presence of RPC stubs file_exec_paths exec_exec_paths. * exec/hashexec.c (check_hashbang): When file_exec_paths is available, use it instead of file_exec. * startup/startup.c (run, run_for_real, start_child): Likewise. * utils/login.c (main): Likewise. * libfshelp/start-translator-long.c (fshelp_start_translator_long): Likewise. * libdiskfs/file-exec.c (diskfs_S_file_exec): Move code to new function diskfs_S_file_exec_paths and call it. (diskfs_S_file_exec_paths): New function, use exec_exec_paths when available instead of exec_exec * libnetfs/file-exec.c (netfs_S_file_exec, netfs_S_file_exec_paths): Likewise. * trans/fakeroot.c (netfs_S_file_exec, netfs_S_file_exec_paths): Likewise. * libtrivfs/file-exec.c (trivfs_S_file_exec_paths): New function.
2017-08-05Use our own variant of 'assert' and 'assert_perror'.Justus Winter
Our variants print stack traces on failures. This will make locating errors much easier.
2016-04-04Use posix types for mig definitions.Flavio Cruz
* hurd/hurd_types.defs: Use posix types. * libfshelp/start-translator-long.c: Use uint32_t instead of unsigned32_t.
2015-01-17libfshelp: improve error handlingJustus Winter
* libfshelp/start-translator-long.c (fshelp_start_translator_long): Once we have a task, go to `lose_task' so that we do not leave hosed tasks around.
2013-11-28libfshelp: improve error handling in fshelp_start_translator_longJustus Winter
Properly deallocate all ports and terminate the started translator if an error occurs. * libfshelp/start-translator-long.c (fshelp_start_translator_long): Improve error handling.
2013-05-31Reset task priority when spawning a passive translatorRichard Braun
Server threads spawned by libports attempt to adjust their priority and succeed when the server is privileged. This priority is currently inherited by child tasks, which could be passive translators owned by unprivileged users. Reset the priority of the task used for translator instantiation. * libfshelp/start-translator-long.c (fshelp_start_translator_long): Set new task priority to 25 (BASEPRI_USER).
2004-02-112004-02-10 Roland McGrath <roland@frob.com>Roland McGrath
* start-translator-long.c (service_fsys_startup): Move mach_msg_type_t const variables inside the function, make them auto so they are optimized away to integer constants. Use a union instead of casts to do efficient type checking.
2002-01-022002-01-02 Roland McGrath <roland@frob.com>Roland McGrath
* start-translator-long.c (fshelp_start_translator_long) [KERN_INVALID_LEDGER]: Pass extra args to task_create for OSF variant.
2001-01-30daemons/Marcus Brinkmann
2001-01-17 Neal H Walfield <neal@cs.uml.edu> * console-run.c (open_console): Conform to new fshelp_start_translator semantics. init/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * init.c (open_console): Conform to new fshelp_start_translator semantics. libfshelp/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * fshelp.h: Add two new parameters to fshelp_open_fn_t: a port to the new task and a cookie. Add a new parameter, cookie, to fshelp_start_translator and fshelp_start_translator_long that will be passed to fshelp_open_fn_t. * fetch-root.c (fshelp_fetch_root): Conform to new fshelp_start_translator_long semantics. * start-translator-long.c (service_fsys_startup): Likewise. (fshelp_start_translator_long): Likewise. * start-translator.c (fshelp_start_translator): Likewise. libtreefs/ Conform to new fshelp_start_translator semantics. trans/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * pump.c (start_pfinet): Conform to new fshelp_start_translator semantics. utils/ 2001-01-17 Neal H Walfield <neal@cs.uml.edu> * mount.c (do_mount): Conform to new fshelp_start_translator semantics. * settrans.c (main): Conform to new fshelp_start_translator semantics therby allowing us to print the pid of the an active translator.
2000-03-142000-03-13 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* start-translator-long.c (service_fsys_startup): If mach_msg fails with MACH_SEND_INTERRUPTED, clean up the send right in the pseudo-received request message.
1999-10-071999-10-07 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* start-translator-long.c (fshelp_start_translator_long): Doc fix. * fshelp.h (fshelp_start_translator_long): Document OWNER_UID.
1999-10-071999-10-07 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* start-translator-long.c (fshelp_start_translator_long): Take new argument OWNER_UID. Get child's proc port and do proc_setowner on it. * fshelp.h: Update decl. * start-translator.c (fshelp_start_translator): Pass new arg to fshelp_start_translator_long with value from geteuid (). * fetch-root.c (fshelp_fetch_root): Pass UID as new arg to fshelp_start_translator_long.
1999-03-06Sat Mar 6 17:03:02 1999 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* start-translator-long.c (service_fsys_startup): Doc fixes, and omit unused member `dead' from REQUEST.
1996-04-27(service_fsys_startup):Miles Bader
Make the mach_msg call sending the startup reply interruptible.
1996-04-27(service_fsys_startup):Miles Bader
Make the mach_msg call waiting for the startup message interruptible.
1996-02-15(fshelp_start_translator_long): Terminate TASK if the exec fails.Miles Bader
1995-11-06(service_fsys_startup):Miles Bader
Don't pass the address of reply.realnodeType.msgt_name -- it's not really an int, although the compiler pretends it is.
1995-11-02(fshelp_start_translator_long, service_fsys_startup):Miles Bader
Change to use a callback function instead of passing the actual node. (service_fsys_startup): Support the open flags coming from the translator. (struct fsys_startup_request): Add the flags field. (flagsCheck): New variable.
1995-10-13(fshelp_start_translator_long): Undo last change to file_exec args.Miles Bader
1995-10-11(fshelp_start_translator_long):Miles Bader
Add values for the dealloc parameters to file_exec (all false). Give away our send right to TASK when we do file_exec. Initialize BOOTSTRAP & TASK so the cleanup code doesn't get confused.
1995-07-11(fshelp_start_translator_long): If PORTS_TYPE isMichael I. Bushnell
MACH_MSG_TYPE_COPY_SEND, then drop our right on bootstrap after the call, because we are pretending we haven't changed the calling user's state. For the same reason, save the old BOOTSTRAP port value, and restore it after the call.
1995-06-23(service_fsys_startup): Parenthesize construction of flags argMichael I. Bushnell
correctly.
1995-06-14Initial revisionMichael I. Bushnell