Unverified Commit cebba721 by Christian Brauner Committed by Stéphane Graber

conf: cull_mntent_opt()

non-functional changes Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent d9cda2c1
...@@ -1762,28 +1762,27 @@ skipremount: ...@@ -1762,28 +1762,27 @@ skipremount:
return 0; return 0;
} }
/* /* Remove "optional", "create=dir", and "create=file" from mntopt */
* Remove 'optional', 'create=dir', and 'create=file' from mntopt
*/
static void cull_mntent_opt(struct mntent *mntent) static void cull_mntent_opt(struct mntent *mntent)
{ {
int i; int i;
char *list[] = {"create=dir", "create=file", "optional", NULL};
for (i = 0; list[i]; i++) {
char *p, *p2; char *p, *p2;
char *list[] = {"create=dir",
"create=file",
"optional",
NULL };
for (i=0; list[i]; i++) { p = strstr(mntent->mnt_opts, list[i]);
if (!(p = strstr(mntent->mnt_opts, list[i]))) if (!p)
continue; continue;
p2 = strchr(p, ','); p2 = strchr(p, ',');
if (!p2) { if (!p2) {
/* no more mntopts, so just chop it here */ /* no more mntopts, so just chop it here */
*p = '\0'; *p = '\0';
continue; continue;
} }
memmove(p, p2+1, strlen(p2+1)+1);
memmove(p, p2 + 1, strlen(p2 + 1) + 1);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment