summaryrefslogtreecommitdiff
path: root/source/smbd/service.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/smbd/service.c')
-rw-r--r--source/smbd/service.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/source/smbd/service.c b/source/smbd/service.c
index c74537c299e..3b499d5cc1d 100644
--- a/source/smbd/service.c
+++ b/source/smbd/service.c
@@ -28,10 +28,11 @@ extern userdom_struct current_user_info;
Load parameters specific to a connection/service.
****************************************************************************/
-BOOL set_current_service(connection_struct *conn,BOOL do_chdir)
+BOOL set_current_service(connection_struct *conn, uint16 flags, BOOL do_chdir)
{
extern char magic_char;
static connection_struct *last_conn;
+ static uint16 last_flags;
int snum;
if (!conn) {
@@ -51,10 +52,24 @@ BOOL set_current_service(connection_struct *conn,BOOL do_chdir)
return(False);
}
- if (conn == last_conn)
+ if ((conn == last_conn) && (last_flags == flags)) {
return(True);
+ }
last_conn = conn;
+ last_flags = flags;
+
+ /* Obey the client case sensitivity requests - only for clients that support it. */
+ if (lp_casesensitive(snum) == Auto) {
+ /* We need this uglyness due to DOS/Win9x clients that lie about case insensitivity. */
+ enum remote_arch_types ra_type = get_remote_arch();
+ if ((ra_type != RA_SAMBA) && (ra_type != RA_CIFSFS)) {
+ /* Client can't support per-packet case sensitive pathnames. */
+ conn->case_sensitive = False;
+ } else {
+ conn->case_sensitive = !(flags & FLAG_CASELESS_PATHNAMES);
+ }
+ }
magic_char = lp_magicchar(snum);
return(True);
@@ -347,7 +362,13 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
conn->dirptr = NULL;
/* Case options for the share. */
- conn->case_sensitive = lp_casesensitive(snum);
+ if (lp_casesensitive(snum) == Auto) {
+ /* We will be setting this per packet. Set to be case insensitive for now. */
+ conn->case_sensitive = False;
+ } else {
+ conn->case_sensitive = (BOOL)lp_casesensitive(snum);
+ }
+
conn->case_preserve = lp_preservecase(snum);
conn->short_case_preserve = lp_shortpreservecase(snum);
@@ -499,6 +520,20 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
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)) {
+ pstring s;
+ pstrcpy(s,conn->connectpath);
+ canonicalize_path(conn, s);
+ string_set(&conn->connectpath,s);
+ }
+
/* ROOT Activities: */
/* check number of connections */
if (!claim_connection(conn,