summaryrefslogtreecommitdiff
path: root/utils/settrans.c
AgeCommit message (Collapse)Author
2016-04-17utils/settrans: get an authenticated root node in chroot modeJustus Winter
* 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>
2016-02-05utils/settrans: improve --chroot functionalityJustus Winter
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.
2014-08-19Make settrans return value returned by chroot commandSvante Signell
* utils/settrans.c (main): In case of chroot_command, get status from waitpid() call, and call error() appropriately.
2014-06-15utils/settrans: implement settrans --startJustus Winter
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.
2013-12-10utils/settrans: fix the teardown of chrooted environmentsJustus Winter
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.
2013-11-09utils: implement settrans --pid-fileJustus Winter
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.
2011-02-21Reference TRANSLATOR in `-a' help message.Samuel Thibault
* utils/settrans.c (options): Reference TRANSLATOR in `-a' help message.
2011-02-17Rephrase settrans' --helpSamuel Thibault
* utils/settrans.c (options): Rephrase -a and -p help to be more precise.
2011-02-12Document that -p is the default option in settrans --helpSamuel Thibault
* utils/settrans.c (options): Document that -p is the default option for settrans.
2002-05-282002-05-28 Roland McGrath <roland@frob.com>Roland McGrath
* 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-062002-05-06 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* settrans.c (main): Return 0 instead of using break (which only gets us out of the while loop).
2002-05-042002-05-04 Roland McGrath <roland@frob.com>Roland McGrath
* 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-162001-06-15 Neal H Walfield <neal@cs.uml.edu>Roland McGrath
* settrans.c (options): New option `--orphan'. Fix other comments to aviod confusion. (main): Add FS_TRANS_ORPHAN to ACTIVE_FLAGS if `--orphan' is specified.
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.
1998-10-20Add braces to silence gcc warnings.Roland McGrath
1998-07-201998-07-20 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* 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.
1997-06-20(main):Miles Bader
Print the translated-node name instead of the translator name if the translator startup error is due to opening it.
1997-02-20(argp_program_version): Make const.Miles Bader
1997-02-12(options):Miles Bader
Update to reflect some minor changes in the way argp works.
1996-09-05*** empty log message ***Thomas Bushnell
1996-08-27(doc): Add program description.Miles Bader
1996-07-20(options): Rearrange slightly.Miles Bader
1996-07-08(main): Don't use unsafe MOVE_SEND in call to file_set_translator.Michael I. Bushnell
1996-07-06(argp_program_version): New variable.Miles Bader
1996-05-11(parse_opt): Use ARGP_ERR_UNKNOWN instead of EINVAL.Miles Bader
1996-05-10(main): Remove const cast from first arg to argz_create.Miles Bader
1996-05-09(main) [parse_opt]: Cast first arg to argz_create appropriately.Michael I. Bushnell
1996-05-01(main): Default KILL_ACTIVE to 0.Miles Bader
1996-03-29(options): Add --exclusive option, change descriptions.Miles Bader
(main): Rearrange meanings of arguments somewhat.
1996-03-19(main): Pass new arg to argp_parse. Also use argp_usage correctly.Miles Bader
1996-02-26(main): Don't print a newline after `Pausing...' msg.Miles Bader
1996-02-19(STRINGIFY): Make work. Is this in a header somewhere?Miles Bader
(_STRINGIFY): New macro. Ick.
1996-02-13(options, main): Add --timeout/-t option.Miles Bader
(main): Pass ARGP_IN_ORDER to argp_parse (it's no longer the default), and deal with the fallout.
1996-02-02(options, main): Add --pause option.Miles Bader
1996-01-23(options, main): Make -g/--goaway only apply to active translators.Miles Bader
(options): Rearrange a bit.
1995-12-06(main):Miles Bader
Change uses of the INDEX field in argp_state structures to use NEXT instead.
1995-11-06(main):Miles Bader
Change to use the new wierd callback interface to fshelp_start_translator.
1995-10-31(options):Miles Bader
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.
1995-10-21(args_doc): New variable.Miles Bader
(main): Set ARGZ inside of parse_opt.
1995-10-18(options): Converted to argp format.Miles Bader
(main): Use argp, not getopt. (usage, USAGE, SHORT_OPTIONS): Deleted. Include <argp.h> not <getopt.h>.
1995-09-05(main): Use fshelp_start_translator instead of start_translator from ../lib.Miles Bader
1995-07-07(SHORT_OPTIONS): Remove '?' as getopt usurps it.Miles Bader
(options, main): Use '&' instead of '?' to mean help.
1995-07-06Give an error message instead of dying when no filename argument is given.Miles Bader
1995-04-27Allow options before and immediately after the node name to be rearranged byMiles Bader
getopt without affecting those following the translator name.
1995-04-05Get rid of the `show passive translator' functionality, as this is now doneMiles Bader
by showtrans.
1995-03-31Initial revisionMiles Bader