diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2015-03-10 12:25:05 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2015-03-10 12:25:05 +0000 |
commit | 61d75c3229a411f7cdc51cd73f6238fdd9adbb5f (patch) | |
tree | 150c627837688127c9da11c88fae5d490a2bc630 /usr.sbin/autofs/automount.c | |
parent | 12f1f00c3001ac11d4a03add13c1f0cfa1ed82f6 (diff) | |
download | src-61d75c3229a411f7cdc51cd73f6238fdd9adbb5f.tar.gz src-61d75c3229a411f7cdc51cd73f6238fdd9adbb5f.zip |
Properly pass options for direct maps.
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Notes
Notes:
svn path=/head/; revision=279846
Diffstat (limited to 'usr.sbin/autofs/automount.c')
-rw-r--r-- | usr.sbin/autofs/automount.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/usr.sbin/autofs/automount.c b/usr.sbin/autofs/automount.c index 0c42ffd664b7..8a7c91a59b21 100644 --- a/usr.sbin/autofs/automount.c +++ b/usr.sbin/autofs/automount.c @@ -141,8 +141,8 @@ mount_autofs(const char *from, const char *fspath, const char *options, } static void -mount_if_not_already(const struct node *n, const char *map, - const struct statfs *mntbuf, int nitems) +mount_if_not_already(const struct node *n, const char *map, const char *options, + const char *prefix, const struct statfs *mntbuf, int nitems) { const struct statfs *sb; char *mountpoint; @@ -175,7 +175,7 @@ mount_if_not_already(const struct node *n, const char *map, mountpoint); } - mount_autofs(from, mountpoint, n->n_options, n->n_key); + mount_autofs(from, mountpoint, options, prefix); free(from); free(mountpoint); } @@ -184,7 +184,7 @@ static void mount_unmount(struct node *root) { struct statfs *mntbuf; - struct node *n, *n2, *n3; + struct node *n, *n2; int i, nitems; nitems = getmntinfo(&mntbuf, MNT_WAIT); @@ -216,15 +216,14 @@ mount_unmount(struct node *root) TAILQ_FOREACH(n, &root->n_children, n_next) { if (!node_is_direct_map(n)) { - mount_if_not_already(n, n->n_map, mntbuf, nitems); + mount_if_not_already(n, n->n_map, n->n_options, + n->n_key, mntbuf, nitems); continue; } TAILQ_FOREACH(n2, &n->n_children, n_next) { - TAILQ_FOREACH(n3, &n2->n_children, n_next) { - mount_if_not_already(n3, n->n_map, - mntbuf, nitems); - } + mount_if_not_already(n2, n->n_map, n->n_options, + "/", mntbuf, nitems); } } } |