The branch, master has been updated via a6f402a... Remove lp_safe_widelinks() -> convert to just lp_widelinks. Suggestion from Volker. from 4ff7f6e... s3 test: Make the netbios name test pass again
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit a6f402ad87ff0ae14d57d97278d67d0ceaaa1d82 Author: Jeremy Allison <j...@samba.org> Date: Thu Feb 11 15:16:23 2010 -0800 Remove lp_safe_widelinks() -> convert to just lp_widelinks. Suggestion from Volker. Create widelinks_warning(int snum) to cover the message needed in make_connection. Jeremy. ----------------------------------------------------------------------- Summary of changes: source3/include/proto.h | 2 +- source3/param/loadparm.c | 21 ++++++++++++++++++--- source3/smbd/filename.c | 2 +- source3/smbd/service.c | 9 +++++---- source3/smbd/vfs.c | 2 +- 5 files changed, 26 insertions(+), 10 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/proto.h b/source3/include/proto.h index 3549ea6..c10a885 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4393,7 +4393,7 @@ void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val); int lp_min_receive_file_size(void); char* lp_perfcount_module(void); void lp_set_passdb_backend(const char *backend); -bool lp_safe_widelinks(int snum); +void widelinks_warning(int snum); /* The following definitions come from param/util.c */ diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4b6fa83..579f847 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -5676,7 +5676,6 @@ FN_LOCAL_BOOL(lp_oplocks, bOpLocks) 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) @@ -9898,12 +9897,28 @@ void lp_set_passdb_backend(const char *backend) even after a configuration file reload. ********************************************************************/ -bool lp_safe_widelinks(int snum) +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(snum); + return lp_widelinks_internal(snum); } diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 73a3c36..ab79dfd 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -854,7 +854,7 @@ NTSTATUS check_name(connection_struct *conn, const char *name) } } - if (!lp_safe_widelinks(SNUM(conn)) || !lp_symlinks(SNUM(conn))) { + if (!lp_widelinks(SNUM(conn)) || !lp_symlinks(SNUM(conn))) { NTSTATUS status = check_reduced_name(conn,name); if (!NT_STATUS_IS_OK(status)) { DEBUG(5,("check_name: name %s failed with %s\n",name, diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 45df7c1..7dddff5 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -857,10 +857,11 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, conn); } -/* ROOT Activities: */ - /* explicitly check with lp_widelinks() instead of using - * lp_safe_widelinks() here so that we can correctly warn +/* ROOT Activities: */ + /* explicitly check widelinks here so that we can correctly warn * in the logs. */ + widelinks_warning(snum); + if (lp_unix_extensions() && lp_widelinks(snum)) { DEBUG(0,("Share '%s' has wide links and unix extensions enabled. " "These parameters are incompatible. " @@ -973,7 +974,7 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn, * 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_safe_widelinks(snum)) { + if (!lp_widelinks(snum)) { if (!canonicalize_connect_path(conn)) { DEBUG(0, ("canonicalize_connect_path failed " "for service %s, path %s\n", diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index b575800..94bdb1f 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -928,7 +928,7 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname) } /* Check for widelinks allowed. */ - if (!lp_safe_widelinks(SNUM(conn))) { + if (!lp_widelinks(SNUM(conn))) { const char *conn_rootdir; conn_rootdir = SMB_VFS_CONNECTPATH(conn, fname); -- Samba Shared Repository