X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fsecure-mount.c;h=db8dd7c6c873e740c7e84f4bfa8e03fab7ec126f;hb=93c4a7d40d5bedb16f2cdc9f8fb7629418275a9f;hp=b56ff4fe2011a45ef6db48713df7d9964c2e7612;hpb=12b0a4cfbc4834f585a4b71aad2cf03c7de7f94e;p=util-vserver.git diff --git a/src/secure-mount.c b/src/secure-mount.c index b56ff4f..db8dd7c 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; }