FN_LOCAL_BOOL(lp_level2_oplocks, bLevel2OpLocks)
FN_LOCAL_BOOL(lp_onlyuser, bOnlyUser)
FN_LOCAL_PARM_BOOL(lp_manglednames, bMangledNames)
-FN_LOCAL_BOOL(lp_widelinks, bWidelinks)
FN_LOCAL_BOOL(lp_symlinks, bSymlinks)
FN_LOCAL_BOOL(lp_syncalways, bSyncAlways)
FN_LOCAL_BOOL(lp_strict_allocate, bStrictAllocate)
}
return Globals.szSocketAddress;
}
+
+/*******************************************************************
+ Safe wide links checks.
+ This helper function always verify the validity of wide links,
+ even after a configuration file reload.
+********************************************************************/
+
+static bool lp_widelinks_internal(int snum)
+{
+ return (bool)(LP_SNUM_OK(snum)? ServicePtrs[(snum)]->bWidelinks :
+ sDefault.bWidelinks);
+}
+
+void widelinks_warning(int snum)
+{
+ if (lp_unix_extensions() && lp_widelinks_internal(snum)) {
+ DEBUG(0,("Share '%s' has wide links and unix extensions enabled. "
+ "These parameters are incompatible. "
+ "Wide links will be disabled for this share.\n",
+ lp_servicename(snum) ));
+ }
+}
+
+bool lp_widelinks(int snum)
+{
+ /* wide links is always incompatible with unix extensions */
+ if (lp_unix_extensions()) {
+ return false;
+ }
+
+ return lp_widelinks_internal(snum);
+}
return NULL;
}
- /*
- * If widelinks are disallowed we need to canonicalise the connect
- * path here to ensure we don't have any symlinks in the
- * connectpath. We will be checking all paths on this connection are
- * below this directory. We must do this after the VFS init as we
- * depend on the realpath() pointer in the vfs table. JRA.
- */
- if (!lp_widelinks(snum)) {
- if (!canonicalize_connect_path(conn)) {
- DEBUG(0, ("canonicalize_connect_path failed "
- "for service %s, path %s\n",
- lp_servicename(snum),
- conn->connectpath));
- conn_free(conn);
- *pstatus = NT_STATUS_BAD_NETWORK_NAME;
- return NULL;
- }
- }
-
if ((!conn->printer) && (!conn->ipc)) {
conn->notify_ctx = notify_init(conn, server_id_self(),
smbd_messaging_context(),
conn);
}
-/* ROOT Activities: */
+/* ROOT Activities: */
+ /* explicitly check widelinks here so that we can correctly warn
+ * in the logs. */
+ widelinks_warning(snum);
+
/*
* Enforce the max connections parameter.
*/
return NULL;
}
+ /*
+ * Fix compatibility issue pointed out by Volker.
+ * We pass the conn->connectpath to the preexec
+ * scripts as a parameter, so attempt to canonicalize
+ * it here before calling the preexec scripts.
+ * We ignore errors here, as it is possible that
+ * the conn->connectpath doesn't exist yet and
+ * the preexec scripts will create them.
+ */
+
+ (void)canonicalize_connect_path(conn);
+
/* Preexecs are done here as they might make the dir we are to ChDir
* to below */
/* execute any "root preexec = " line */
}
}
+ /*
+ * If widelinks are disallowed we need to canonicalise the connect
+ * path here to ensure we don't have any symlinks in the
+ * connectpath. We will be checking all paths on this connection are
+ * below this directory. We must do this after the VFS init as we
+ * depend on the realpath() pointer in the vfs table. JRA.
+ */
+ if (!lp_widelinks(snum)) {
+ if (!canonicalize_connect_path(conn)) {
+ DEBUG(0, ("canonicalize_connect_path failed "
+ "for service %s, path %s\n",
+ lp_servicename(snum),
+ conn->connectpath));
+ *pstatus = NT_STATUS_BAD_NETWORK_NAME;
+ goto err_root_exit;
+ }
+ }
+
#ifdef WITH_FAKE_KASERVER
if (lp_afs_share(snum)) {
afs_login(conn);
}
#endif
- if (lp_unix_extensions() && lp_widelinks(snum)) {
- DEBUG(0,("Share '%s' has wide links and unix extensions enabled. "
- "These parameters are incompatible. "
- "Disabling wide links for this share.\n",
- lp_servicename(snum) ));
- lp_do_parameter(snum, "wide links", "False");
- }
-
/* Figure out the characteristics of the underlying filesystem. This
* assumes that all the filesystem mounted withing a share path have
* the same characteristics, which is likely but not guaranteed.