aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>1998-04-02 05:59:57 +0000
committerH. Peter Anvin <hpa@zytor.com>1998-04-02 05:59:57 +0000
commit362fa62b7fc8f38e9153f8ee35ebdfe73d44a2e5 (patch)
tree10222d855d69ad0ac9088d16b554d24b39ca005f /modules
parent37f630a44389febaac421b2c3d3a96bc3b916a51 (diff)
downloadautofs3-362fa62b7fc8f38e9153f8ee35ebdfe73d44a2e5.tar.gz
autofs3-362fa62b7fc8f38e9153f8ee35ebdfe73d44a2e5.tar.xz
autofs3-362fa62b7fc8f38e9153f8ee35ebdfe73d44a2e5.zip
Okay, I think recursive autofs mounts should work now.
Diffstat (limited to 'modules')
-rw-r--r--modules/mount_autofs.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/modules/mount_autofs.c b/modules/mount_autofs.c
index 239fa73..1f52eca 100644
--- a/modules/mount_autofs.c
+++ b/modules/mount_autofs.c
@@ -41,6 +41,10 @@ int mount_mount(const char *root, const char *name, int name_len,
char *options, *p;
pid_t slave, wp;
+ syslog(LOG_DEBUG, MODPREFIX "starting...");
+ syslog(LOG_DEBUG, MODPREFIX "root = %s, name = %s, c_options = %s",
+ root, name, c_options);
+
fullpath = alloca(strlen(root)+name_len+2);
if ( !fullpath ) {
syslog(LOG_ERR, MODPREFIX "alloca: %m");
@@ -48,12 +52,16 @@ int mount_mount(const char *root, const char *name, int name_len,
}
sprintf(fullpath, "%s/%s", root, name);
- options = alloca(strlen(c_options)+1);
- if ( !options ) {
- syslog(LOG_ERR, MODPREFIX "alloca: %m");
- return 1;
+ if ( c_options ) {
+ options = alloca(strlen(c_options)+1);
+ if ( !options ) {
+ syslog(LOG_ERR, MODPREFIX "alloca: %m");
+ return 1;
+ }
+ strcpy(options, c_options);
+ } else {
+ options = NULL;
}
- strcpy(options, c_options);
syslog(LOG_DEBUG, MODPREFIX "calling mkdir %s", fullpath);
if ( mkdir(fullpath, 0555) && errno != EEXIST ) {
@@ -86,6 +94,7 @@ int mount_mount(const char *root, const char *name, int name_len,
goto error;
}
+ *p++ = '\0';
argv[argc++] = p;
if ( options ) {