as well as a problem with nfsl that I discovered myself.
* NEWS: updated
* conf/autofs/autofs_linux.h (AUTOFS_LINK_FS_FLAGS): remove
FS_ON_AUTOFS
(AUTOFS_LINKX_FS_FLAGS): ditto
* conf/autofs/autofs_solaris_v1.h (AUTOFS_LINK_FS_FLAGS): remove
FS_ON_AUTOFS
(AUTOFS_LINKX_FS_FLAGS): ditto
* conf/autofs/autofs_solaris_v2_v3.h (AUTOFS_LINK_FS_FLAGS): remove
FS_ON_AUTOFS
(AUTOFS_LINKX_FS_FLAGS): ditto
* amd/amfs_generic.c (amfs_lookup_one_mntfs): don't modify the
original opt_fs, instead store the new mount point for autofs in a
temporary variable and pass it around. Fixes a problem with the
link side of nfsl.
+2003-08-26 Ion Badulescu <ionut@buggy.badula.org>
+
+ * NEWS: updated
+
+ * conf/autofs/autofs_linux.h (AUTOFS_LINK_FS_FLAGS): remove
+ FS_ON_AUTOFS
+ (AUTOFS_LINKX_FS_FLAGS): ditto
+
+ * conf/autofs/autofs_solaris_v1.h (AUTOFS_LINK_FS_FLAGS): remove
+ FS_ON_AUTOFS
+ (AUTOFS_LINKX_FS_FLAGS): ditto
+
+ * conf/autofs/autofs_solaris_v2_v3.h (AUTOFS_LINK_FS_FLAGS): remove
+ FS_ON_AUTOFS
+ (AUTOFS_LINKX_FS_FLAGS): ditto
+
+ * amd/amfs_generic.c (amfs_lookup_one_mntfs): don't modify the
+ original opt_fs, instead store the new mount point for autofs in a
+ temporary variable and pass it around. Fixes a problem with the
+ link side of nfsl.
+
2003-08-25 Ion Badulescu <ionut@moisil.badula.org>
* NEWS: updated
proper waiting channels
- bugs fixed:
+ * link mounts with relative targets weren't working on autofs
+ * the link side of the nfsl filesystem wasn't working on autofs
* umount code was accidentally turning all symlinks into directories
- during attempted umounts, causing stale filehandles
+ during attempted umounts, causing stale filehandles
* various minor build fixes for "impossible" configurations
* prevent ldap code from dereferencing a null pointer
* SUCH DAMAGE.
*
*
- * $Id: amfs_generic.c,v 1.15 2003/08/25 23:49:47 ib42 Exp $
+ * $Id: amfs_generic.c,v 1.16 2003/08/26 14:17:27 ib42 Exp $
*
*/
am_opts *fs_opts;
mntfs *new_mf;
char *link_dir;
+ char *mp_dir = 0;
#ifdef HAVE_FS_AUTOFS
int on_autofs = 1;
#endif /* HAVE_FS_AUTOFS */
if (fs_opts->opt_sublink) {
on_autofs = 0;
if (fs_opts->opt_sublink[0] == '/') {
- XFREE(fs_opts->opt_fs);
- fs_opts->opt_fs = strdup(new_mp->am_path);
+ mp_dir = new_mp->am_path;
} else {
/*
* For a relative sublink we need to use a hack with autofs:
* mount the filesystem on the original opt_fs (which is NOT an
* autofs mountpoint) and symlink (or lofs-mount) to it from
- * the autofs dir.
- *
- * In other words, we make no changes here.
+ * the autofs mountpoint.
*/
+ mp_dir = fs_opts->opt_fs;
}
} else {
if (p->autofs_fs_flags & FS_ON_AUTOFS) {
- XFREE(fs_opts->opt_fs);
- fs_opts->opt_fs = strdup(new_mp->am_path);
+ mp_dir = new_mp->am_path;
} else {
+ mp_dir = fs_opts->opt_fs;
on_autofs = 0;
}
}
- }
+ } else
#endif /* HAVE_FS_AUTOFS */
+ mp_dir = fs_opts->opt_fs;
/*
* Find or allocate a filesystem for this node.
*/
new_mf = find_mntfs(p, fs_opts,
- fs_opts->opt_fs,
+ mp_dir,
fs_opts->fs_mtab,
def_opts,
fs_opts->opt_opts,
link_dir = new_mf->mf_fo->opt_sublink;
if (link_dir && link_dir[0] && link_dir[0] != '/') {
- link_dir = str3cat((char *) 0,
- new_mf->mf_fo->opt_fs, "/", link_dir);
+ link_dir = str3cat((char *) 0, mp_dir, "/", link_dir);
normalize_slash(link_dir);
XFREE(new_mf->mf_fo->opt_sublink);
new_mf->mf_fo->opt_sublink = link_dir;
if (mf->mf_fo->fs_mtab) {
plog(XLOG_MAP, "Trying mount of %s on %s fstype %s mount_type %s",
- mf->mf_fo->fs_mtab, mf->mf_fo->opt_fs, p->fs_type,
+ mf->mf_fo->fs_mtab, mf->mf_mount, p->fs_type,
mp->am_flags & AMF_AUTOFS ? "autofs" : "non-autofs");
}
#define AUTOFS_ERROR_FS_FLAGS (FS_DISCARD)
#define AUTOFS_HOST_FS_FLAGS (FS_MKMNT | FS_BACKGROUND | FS_AMQINFO)
#define AUTOFS_INHERIT_FS_FLAGS (FS_DISCARD)
-#define AUTOFS_LINK_FS_FLAGS (FS_MBACKGROUND | FS_ON_AUTOFS)
-#define AUTOFS_LINKX_FS_FLAGS (FS_MBACKGROUND | FS_ON_AUTOFS)
+#define AUTOFS_LINK_FS_FLAGS (FS_MBACKGROUND)
+#define AUTOFS_LINKX_FS_FLAGS (FS_MBACKGROUND)
#define AUTOFS_NFSL_FS_FLAGS (FS_BACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
#define AUTOFS_NFSX_FS_FLAGS (/* FS_UBACKGROUND| */ FS_AMQINFO | FS_ON_AUTOFS)
#define AUTOFS_PROGRAM_FS_FLAGS (FS_BACKGROUND | FS_AMQINFO)
#define AUTOFS_ERROR_FS_FLAGS (FS_DISCARD)
#define AUTOFS_HOST_FS_FLAGS (FS_MKMNT | FS_BACKGROUND | FS_AMQINFO)
#define AUTOFS_INHERIT_FS_FLAGS (FS_DISCARD)
-#define AUTOFS_LINK_FS_FLAGS (FS_MBACKGROUND | FS_ON_AUTOFS)
-#define AUTOFS_LINKX_FS_FLAGS (FS_MBACKGROUND | FS_ON_AUTOFS)
+#define AUTOFS_LINK_FS_FLAGS (FS_MBACKGROUND)
+#define AUTOFS_LINKX_FS_FLAGS (FS_MBACKGROUND)
#define AUTOFS_NFSL_FS_FLAGS (FS_BACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
#define AUTOFS_NFSX_FS_FLAGS (/* FS_UBACKGROUND| */ FS_AMQINFO | FS_ON_AUTOFS)
#define AUTOFS_PROGRAM_FS_FLAGS (FS_MKMNT | FS_BACKGROUND | FS_AMQINFO)
#define AUTOFS_ERROR_FS_FLAGS (FS_DISCARD)
#define AUTOFS_HOST_FS_FLAGS (FS_MKMNT | FS_BACKGROUND | FS_AMQINFO)
#define AUTOFS_INHERIT_FS_FLAGS (FS_DISCARD)
-#define AUTOFS_LINK_FS_FLAGS (FS_MBACKGROUND | FS_ON_AUTOFS)
-#define AUTOFS_LINKX_FS_FLAGS (FS_MBACKGROUND | FS_ON_AUTOFS)
+#define AUTOFS_LINK_FS_FLAGS (FS_MBACKGROUND)
+#define AUTOFS_LINKX_FS_FLAGS (FS_MBACKGROUND)
#define AUTOFS_NFSL_FS_FLAGS (FS_BACKGROUND | FS_AMQINFO | FS_ON_AUTOFS)
#define AUTOFS_NFSX_FS_FLAGS (/* FS_UBACKGROUND| */ FS_AMQINFO | FS_ON_AUTOFS)
#define AUTOFS_PROGRAM_FS_FLAGS (FS_BACKGROUND | FS_AMQINFO)