aboutsummaryrefslogtreecommitdiff
path: root/utils/settrans.c
Commit message (Collapse)AuthorAgeFilesLines
* settrans: get rid of translator that couldn't be attachedSergey Bugaev2021-05-081-1/+5
| | | | | * utils/settrans.c (main): When file_set_translator fails, make the just-started translator go away.
* Use our own variant of 'assert' and 'assert_perror'.Justus Winter2017-08-051-2/+2
| | | | | Our variants print stack traces on failures. This will make locating errors much easier.
* utils/settrans: implement active translator stackingJustus Winter2016-05-191-1/+20
| | | | | | | | * utils/settrans.c (OPT_STACK): New macro. (options): New option. (main): Handle new option. (open_node): Use different flags for the lookup of the underlying node.
* utils/settrans: add option to specify the underlying nodeJustus Winter2016-04-171-1/+22
| | | | | | * utils/settrans.c (options): Add '--underlying'. (main): Handle new option. (open_node): Open the node if given.
* utils/settrans: get an authenticated root node in chroot modeJustus Winter2016-04-171-1/+44
| | | | | | | | * utils/settrans.c (get_credentials): New function. (main): Get an authenticated root node for the process we are chrooting. Signed-off-by: Justus Winter <justus@gnupg.org>
* utils/settrans: improve --chroot functionalityJustus Winter2016-02-051-2/+30
| | | | | | | | | | | | | | | | | Add an option '--chroot-chdir' to settrans and make it chdir to this directory before executing the target program. Also, look up the executable in PATH. With these changes we no longer need to use the shell inside the chroot in the convenience scripts, and hence do not require it to be installed inside the chroot. * utils/fakeroot.sh: Simplify using the new option. * utils/remap.sh: Likewise. * utils/settrans.c (OPT_CHROOT_CHDIR): New constant. (options): New option 'chroot-chdir'. (main): Handle new option. Search for target executable in PATH. * utils/fakeauth.c (main): Likewise.
* Make settrans return value returned by chroot commandSvante Signell2014-08-191-4/+12
| | | | | * utils/settrans.c (main): In case of chroot_command, get status from waitpid() call, and call error() appropriately.
* utils/settrans: implement settrans --startJustus Winter2014-06-151-1/+31
| | | | | | | | | | | | Start the translator specified by the NODE's passive translator record and set it as NODE's active translator. This is the equivalent of doing: % settrans --active /node $(showtrans /node) * utils/settrans.c (argp_option): Add --start. (parse_opt): Handle --start. (main): Retrieve the passive translator record if --start is given.
* utils/settrans: fix the teardown of chrooted environmentsJustus Winter2013-12-101-25/+44
| | | | | | | | | | | | | | | | | | | | | Previously, settrans --chroot would just exec the target. Create a new process for that purpose. Wait for its completion, then ask the translator (nicely by default) to go away. If it refuses with EBUSY, it might be because some process has daemonized inside the chrooted environment. This fixes the following bug when settrans is used with fakeroot: % fakeroot-hurd /bin/true 2>&1 | tee <hangs> Here, fakeroot-hurd execs settrans with --chroot, settrans execs /hurd/fakeauth which will eventually exec the target /bin/true. When true terminates, it will close its stdout and stderr. But /hurd/fakeroot's stderr is also connected to tee's stdin, preventing tee from exiting. * utils/settrans.c (main): Fix the teardown of chrooted environments.
* utils: implement settrans --pid-fileJustus Winter2013-11-091-1/+21
| | | | | | | | | | | This switch makes settrans write the pid file of the active translator it starts to a file. This makes the pid easily retrievable for test suites. * utils/settrans.c (options): Add --pid-file. (main): Add variable pid_file. (parse_opt): Handle --pid-file switch. (open_node): Write pid file.
* Reference TRANSLATOR in `-a' help message.Samuel Thibault2011-02-211-1/+1
| | | | * utils/settrans.c (options): Reference TRANSLATOR in `-a' help message.
* Rephrase settrans' --helpSamuel Thibault2011-02-171-2/+2
| | | | * utils/settrans.c (options): Rephrase -a and -p help to be more precise.
* Document that -p is the default option in settrans --helpSamuel Thibault2011-02-121-1/+1
| | | | | * utils/settrans.c (options): Document that -p is the default option for settrans.
* 2002-05-28 Roland McGrath <roland@frob.com>Roland McGrath2002-05-281-1/+1
| | | | | | | | | | | | | | | | * pids.c (add_fn_pids): unsigned -> size_t * w.c (add_utmp_procs): Likewise. * login.c (add_canonical_host): Likewise. * ps.c (main): Likewise. * login.c (add_entry, main): Likewise. * settrans.c (main): int -> size_t * showtrans.c (main): Likewise. * fsysopts.c (main): Likewise. * vmstat.c (main): Use int for FWIDTHS. * ping.c (main): size_t -> socklen_t * fakeauth.c (S_auth_getids, S_auth_makeauth, S_auth_server_authenticate): u_int -> size_t * showtrans.c (main): Cast field width/precision args to int.
* 2002-05-06 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann2002-05-061-1/+1
| | | | | * settrans.c (main): Return 0 instead of using break (which only gets us out of the while loop).
* 2002-05-04 Roland McGrath <roland@frob.com>Roland McGrath2002-05-041-14/+81
| | | | | | * settrans.c (options): Add --chroot/-C option. (main_opt): Parse that option, take following args until "--" as a command to exec chroot'd to the translated node.
* 2001-06-15 Neal H Walfield <neal@cs.uml.edu>Roland McGrath2001-06-161-7/+13
| | | | | | | * settrans.c (options): New option `--orphan'. Fix other comments to aviod confusion. (main): Add FS_TRANS_ORPHAN to ACTIVE_FLAGS if `--orphan' is specified.
* daemons/Marcus Brinkmann2001-01-301-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add braces to silence gcc warnings.Roland McGrath1998-10-201-7/+9
|
* 1998-07-20 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1998-07-201-3/+3
| | | | | | | | | | | * ps.c (main): Fix return type to int, and use return. * ids.c (main): Likewise. * w.c (main): Likewise. * login.c (main): Likewise. * settrans.c (main): Likewise. * showtrans.c (main): Likewise. * fsysopts.c (main): Likewise. * storeinfo.c (main): Likewise.
* (main):Miles Bader1997-06-201-2/+11
| | | | | Print the translated-node name instead of the translator name if the translator startup error is due to opening it.
* (argp_program_version): Make const.Miles Bader1997-02-201-1/+1
|
* (options):Miles Bader1997-02-121-5/+5
| | | | Update to reflect some minor changes in the way argp works.
* *** empty log message ***Thomas Bushnell1996-09-051-1/+2
|
* (doc): Add program description.Miles Bader1996-08-271-1/+2
|
* (options): Rearrange slightly.Miles Bader1996-07-201-4/+4
|
* (main): Don't use unsafe MOVE_SEND in call to file_set_translator.Michael I. Bushnell1996-07-081-1/+1
|
* (argp_program_version): New variable.Miles Bader1996-07-061-0/+2
|
* (parse_opt): Use ARGP_ERR_UNKNOWN instead of EINVAL.Miles Bader1996-05-111-1/+1
|
* (main): Remove const cast from first arg to argz_create.Miles Bader1996-05-101-2/+1
|
* (main) [parse_opt]: Cast first arg to argz_create appropriately.Michael I. Bushnell1996-05-091-1/+2
|
* (main): Default KILL_ACTIVE to 0.Miles Bader1996-05-011-1/+1
|
* (options): Add --exclusive option, change descriptions.Miles Bader1996-03-291-15/+27
| | | | (main): Rearrange meanings of arguments somewhat.
* (main): Pass new arg to argp_parse. Also use argp_usage correctly.Miles Bader1996-03-191-5/+8
|
* (main): Don't print a newline after `Pausing...' msg.Miles Bader1996-02-261-1/+1
|
* (STRINGIFY): Make work. Is this in a header somewhere?Miles Bader1996-02-191-1/+2
| | | | (_STRINGIFY): New macro. Ick.
* (options, main): Add --timeout/-t option.Miles Bader1996-02-131-8/+24
| | | | | (main): Pass ARGP_IN_ORDER to argp_parse (it's no longer the default), and deal with the fallout.
* (options, main): Add --pause option.Miles Bader1996-02-021-2/+10
|
* (options, main): Make -g/--goaway only apply to active translators.Miles Bader1996-01-231-11/+14
| | | | (options): Rearrange a bit.
* (main):Miles Bader1995-12-061-2/+2
| | | | Change uses of the INDEX field in argp_state structures to use NEXT instead.
* (main):Miles Bader1995-11-061-6/+21
| | | | Change to use the new wierd callback interface to fshelp_start_translator.
* (options):Miles Bader1995-10-311-16/+21
| | | | | | | | Change --force/-f to --goaway/-g. Add flags for killing translators: --recurse/-r, --force/-f, --nosync/-S. (doc): New variable. (main): Support new flags. Have some of the options update flag words instead of setting variables.
* (args_doc): New variable.Miles Bader1995-10-211-17/+13
| | | | (main): Set ARGZ inside of parse_opt.
* (options): Converted to argp format.Miles Bader1995-10-181-68/+43
| | | | | | (main): Use argp, not getopt. (usage, USAGE, SHORT_OPTIONS): Deleted. Include <argp.h> not <getopt.h>.
* (main): Use fshelp_start_translator instead of start_translator from ../lib.Miles Bader1995-09-051-2/+4
|
* (SHORT_OPTIONS): Remove '?' as getopt usurps it.Miles Bader1995-07-071-3/+3
| | | | (options, main): Use '&' instead of '?' to mean help.
* Give an error message instead of dying when no filename argument is given.Miles Bader1995-07-061-0/+3
|
* Allow options before and immediately after the node name to be rearranged byMiles Bader1995-04-271-18/+19
| | | | getopt without affecting those following the translator name.
* Get rid of the `show passive translator' functionality, as this is now doneMiles Bader1995-04-051-45/+26
| | | | by showtrans.
* Initial revisionMiles Bader1995-03-311-0/+180