438d165fb9c9d1ffd72be1d9feaf3f89f9a00059
[util-vserver.git] / nomtab.patch
1 commit 34ab12c667eb08336e8e9b0f414ba26d3ad19a08
2 Author: Daniel Hokka Zakrisson <daniel@hozac.com>
3 Date:   Tue Mar 8 20:04:29 2011 +0100
4
5     Add nomtab option.
6
7 diff --git a/src/secure-mount.c b/src/secure-mount.c
8 index ae0650f..53863e3 100644
9 --- a/src/secure-mount.c
10 +++ b/src/secure-mount.c
11 @@ -98,6 +98,7 @@ struct Options {
12  
13  #define XFLAG_NOAUTO   0x01
14  #define XFLAG_FILE     0x02
15 +#define XFLAG_NOMTAB   0x04
16  
17  static struct option const
18  CMDLINE_OPTIONS[] = {
19 @@ -173,6 +174,7 @@ static struct FstabOption {
20    { "private",    MS_PRIVATE,     MS_PRIVATE,      0, false },
21    { "slave",      MS_SLAVE,       MS_SLAVE,        0, false },
22    { "shared",     MS_SHARED,      MS_SHARED,       0, false },
23 +  { "nomtab",     0,              0,               XFLAG_NOMTAB, false },
24  };
25  
26  int                    wrapper_exit_code = 1;
27 @@ -488,7 +490,7 @@ mountSingle(struct MountInfo const *mnt, struct Options *opt)
28    else if (!callExternalMount(mnt))
29      return false;
30  
31 -  if (!opt->ignore_mtab &&
32 +  if (!opt->ignore_mtab && (mnt->xflag & XFLAG_NOMTAB)==0 &&
33        updateMtab(mnt, opt)==-1) {
34      WRITE_MSG(2, "Failed to update mtab-file\n");
35        // no error