]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Change lp_set_posix_pathnames() to take a newval parameter and return the...
authorJeremy Allison <jra@samba.org>
Wed, 20 Jul 2016 18:25:20 +0000 (11:25 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 3 Aug 2016 09:19:13 +0000 (11:19 +0200)
Currently only used in one place, but we'll need to use it to
temporarily change pathname processing to fix bug 12021.

This (hack) is only needed for 4.4.x and below, it is fixed
correctly in 4.5.x.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12021

Signed-off-by: Jeremy Allison <jra@samba.org>
source3/include/proto.h
source3/param/loadparm.c
source3/smbd/trans2.c

index 88be15aeb53148688df7644744c526e223e31b6d..afa43d262eacb998c149140c0af18dee8e2f9c67 100644 (file)
@@ -1054,7 +1054,7 @@ bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state);
 void set_use_sendfile(int snum, bool val);
 void lp_set_mangling_method(const char *new_method);
 bool lp_posix_pathnames(void);
-void lp_set_posix_pathnames(void);
+bool lp_set_posix_pathnames(bool newval);
 enum brl_flavour lp_posix_cifsu_locktype(files_struct *fsp);
 void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val);
 int lp_min_receive_file_size(void);
index 4d6f0665f3f8fd76d3fa61ff282c1a748f1843af..62186e59f1beeffe6470b7194d2cb9ec54e114a4 100644 (file)
@@ -4344,13 +4344,14 @@ bool lp_posix_pathnames(void)
 }
 
 /*******************************************************************
- Change everything needed to ensure POSIX pathname processing (currently
- not much).
+ Set posix pathnames to new value. Returns old value.
 ********************************************************************/
 
-void lp_set_posix_pathnames(void)
+bool lp_set_posix_pathnames(bool newval)
 {
-       posix_pathnames = true;
+       bool oldval = posix_pathnames;
+       posix_pathnames = newval;
+       return oldval;
 }
 
 /*******************************************************************
index 6d50dd3f4ae9f1fb0381892fb94d4c27b91940b7..87aab59ff72ea1474f431a76fa146a8908901c16 100644 (file)
@@ -4093,7 +4093,7 @@ static void call_trans2setfsinfo(connection_struct *conn,
 
                        /* Here is where we must switch to posix pathname processing... */
                        if (xconn->smb1.unix_info.client_cap_low & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
-                               lp_set_posix_pathnames();
+                               (void)lp_set_posix_pathnames(true);
                                mangle_change_to_posix();
                        }