From f2d2335da3dcc2cb700af4c41c2365d5771cbf7b Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Tue, 10 Feb 2004 14:21:35 +0000 Subject: [PATCH] implemented '--rbind' git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@869 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/src/secure-mount.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/util-vserver/src/secure-mount.c b/util-vserver/src/secure-mount.c index 8b72ace..81fee1f 100644 --- a/util-vserver/src/secure-mount.c +++ b/util-vserver/src/secure-mount.c @@ -48,6 +48,7 @@ #include #include #include +#include #define MNTPOINT "/etc" @@ -77,6 +78,7 @@ struct Options { #define OPTION_FSTAB 1027 #define OPTION_CHROOT 1028 #define OPTION_SECURE 1029 +#define OPTION_RBIND 1030 static struct option const CMDLINE_OPTIONS[] = { @@ -88,6 +90,7 @@ CMDLINE_OPTIONS[] = { { "fstab", required_argument, 0, OPTION_FSTAB }, { "chroot", required_argument, 0, OPTION_CHROOT }, { "secure", no_argument, 0, OPTION_SECURE }, + { "rbind", no_argument, 0, OPTION_RBIND }, { 0, 0, 0, 0 } }; @@ -119,10 +122,12 @@ static struct FstabOptions { static void showHelp(int fd, char const *cmd, int res) { + VSERVER_DECLARE_CMD(cmd); + WRITE_MSG(fd, "Usage: "); WRITE_STR(fd, cmd); WRITE_MSG(fd, - " [--help] [--version] [--bind] [--move] [-t ] [-n]\n" + " [--help] [--version] [--bind] [--move] [--rbind] [-t ] [-n]\n" " [--mtab ] [--fstab ] [--chroot ] \n" " [--secure] -a|([-o ] [--] )\n\n" "Executes mount-operations in the given chroot-dir: it assumes sources in the\n" @@ -576,6 +581,7 @@ int main(int argc, char *argv[]) case 'n' : opt.ignore_mtab = true; break; case 'a' : opt.mount_all = true; break; case 'o' : mnt.data = optarg; break; + case OPTION_RBIND : mnt.flags |= MS_REC; /*@fallthrough@*/ case OPTION_BIND : mnt.flags |= MS_BIND; break; case OPTION_MOVE : mnt.flags |= MS_MOVE; break; case OPTION_MTAB : opt.mtab = optarg; break; -- 1.8.1.5