X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fsecure-mount.c;h=87cc596f94a360c645c536c2dc29d80c3146e9fa;hb=06f0081406da031cdcaf12064fcc988e27990b0f;hp=dab02d24618ca137f4fdc92dd74838ac6a9cc0c0;hpb=857b87386bf0e9d20fe56cf70ad36a763e2d429d;p=util-vserver.git diff --git a/src/secure-mount.c b/src/secure-mount.c index dab02d2..87cc596 100644 --- a/src/secure-mount.c +++ b/src/secure-mount.c @@ -52,6 +52,7 @@ #include #include #include +#include #define ENSC_WRAPPERS_FCNTL 1 #define ENSC_WRAPPERS_UNISTD 1 @@ -461,6 +462,8 @@ static bool transformOptionList(struct MountInfo *info, size_t UNUSED *col) { char const * ptr = info->data; + char * data = malloc(strlen(info->data)); + char * dst = data; do { char const * pos = strchr(ptr, ','); @@ -475,6 +478,13 @@ transformOptionList(struct MountInfo *info, size_t UNUSED *col) info->mask |= opt->mask; info->xflag |= opt->xflag; } + else { + if (dst != data) + *(dst++) = ','; + strncpy(dst, ptr, pos-ptr); + dst += pos - ptr; + *dst = '\0'; + } if (*pos!='\0') ptr = pos+1; @@ -483,6 +493,7 @@ transformOptionList(struct MountInfo *info, size_t UNUSED *col) } while (*ptr!='\0'); + info->data = data; return true; } @@ -645,7 +656,7 @@ int main(int argc, char *argv[]) .src = 0, .dst = 0, .type = 0, - .flag = 0, + .flag = MS_NODEV, .xflag = 0, .data = 0, }; @@ -685,7 +696,7 @@ int main(int argc, char *argv[]) default : WRITE_MSG(2, "Try '"); WRITE_STR(2, argv[0]); - WRITE_MSG(2, " --help\" for more information.\n"); + WRITE_MSG(2, " --help' for more information.\n"); return EXIT_FAILURE; break; }