From f8e9c21bc6f36840b308da7bb1c2d1be79386830 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 24 Oct 1998 07:31:10 +0000 Subject: 1998-04-04 Roland McGrath Add support for a "virtual root directory" specified at startup. * priv.h (_diskfs_chroot_directory): Declare new variable. * opts-std-startup.c (startup_options, parse_startup_opt): New string-valued option -C/--directory/--virtual-root/--chroot sets _diskfs_chroot_directory. * init-startup.c (_diskfs_chroot_directory): New variable. (diskfs_startup_diskfs): If that's set, look up the name and warp us to that as a virtual root directory. * fsys-getroot.c (diskfs_S_fsys_getroot): Initialize new peropen's shadow_root_parent to null, and shadow_root to either null or, if _diskfs_chroot_directory is set, to diskfs_root_node. --- libdiskfs/opts-std-startup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libdiskfs/opts-std-startup.c') diff --git a/libdiskfs/opts-std-startup.c b/libdiskfs/opts-std-startup.c index 13cf8e65..14760ed7 100644 --- a/libdiskfs/opts-std-startup.c +++ b/libdiskfs/opts-std-startup.c @@ -1,6 +1,6 @@ /* Standard startup-time command line parser - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. Written by Miles Bader @@ -46,6 +46,9 @@ startup_options[] = {"device-master-port", OPT_DEVICE_MASTER_PORT, "PORT"}, {"exec-server-task", OPT_EXEC_SERVER_TASK, "PORT"}, {"bootflags", OPT_BOOTFLAGS, "FLAGS"}, + {"directory", 'C', "DIRECTORY"}, + {"virtual-root", 0, 0, OPTION_ALIAS | OPTION_HIDDEN}, + {"chroot", 0, 0, OPTION_ALIAS | OPTION_HIDDEN}, {0} }; @@ -84,6 +87,8 @@ parse_startup_opt (int opt, char *arg, struct argp_state *state) diskfs_exec_server_task = atoi (arg); break; case OPT_BOOTFLAGS: diskfs_boot_flags = arg; break; + case 'C': + _diskfs_chroot_directory = arg; break; case ARGP_KEY_END: diskfs_argv = state->argv; break; -- cgit v1.2.3