s3:smbd: Move lp_posix_pathnames() out of ea_list_has_invalid_name().
authorJeremy Allison <jra@samba.org>
Tue, 15 Mar 2016 18:43:32 +0000 (11:43 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 24 Mar 2016 21:57:16 +0000 (22:57 +0100)
External uses will be replaced by checks on struct smb_filename flags.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/lib/filename_util.c
source3/smbd/nttrans.c
source3/smbd/smb2_create.c
source3/smbd/trans2.c

index 6ee91eca247dcf2e1aa922825cdfb921d4d2eb7d..61a5f012ed0d5c9e56fbbfb5bbcce53546f9f548 100644 (file)
@@ -267,10 +267,6 @@ bool is_invalid_windows_ea_name(const char *name)
 
 bool ea_list_has_invalid_name(struct ea_list *ea_list)
 {
-       if (lp_posix_pathnames()) {
-               return false;
-       }
-
        for (;ea_list; ea_list = ea_list->next) {
                if (is_invalid_windows_ea_name(ea_list->ea.name)) {
                        return true;
index 095128083866be04c0e10512fb24011d2a1a103c..be5994a2f89e20b13ee4e3db36e53f95eb5acb52 100644 (file)
@@ -1178,7 +1178,8 @@ static void call_nt_transact_create(connection_struct *conn,
                        goto out;
                }
 
-               if (ea_list_has_invalid_name(ea_list)) {
+               if (!lp_posix_pathnames() &&
+                               ea_list_has_invalid_name(ea_list)) {
                        /* Realloc the size of parameters and data we will return */
                        if (flags & EXTENDED_RESPONSE_REQUIRED) {
                                /* Extended response is 32 more byyes. */
index 9dbed68ecdeaa7601249c7c8ff28135af3025238..ab37be0fb174355fa48c3aa3a1453c86d2c6df28 100644 (file)
@@ -716,7 +716,8 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
                                return tevent_req_post(req, ev);
                        }
 
-                       if (ea_list_has_invalid_name(ea_list)) {
+                       if (!lp_posix_pathnames() &&
+                                       ea_list_has_invalid_name(ea_list)) {
                                tevent_req_nterror(req, STATUS_INVALID_EA_NAME);
                                return tevent_req_post(req, ev);
                        }
index 9c77a6764ccdf7448b54f2e43dfa6be9e5ae9b0c..e23b8932948cca68442135df55d855b05f97425b 100644 (file)
@@ -717,7 +717,7 @@ NTSTATUS set_ea(connection_struct *conn, files_struct *fsp,
         * we set *any* of them.
         */
 
-       if (ea_list_has_invalid_name(ea_list)) {
+       if (!lp_posix_pathnames() && ea_list_has_invalid_name(ea_list)) {
                return STATUS_INVALID_EA_NAME;
        }
 
@@ -1297,7 +1297,8 @@ static void call_trans2open(connection_struct *conn,
                        goto out;
                }
 
-               if (ea_list_has_invalid_name(ea_list)) {
+               if (!lp_posix_pathnames() &&
+                               ea_list_has_invalid_name(ea_list)) {
                        int param_len = 30;
                        *pparams = (char *)SMB_REALLOC(*pparams, param_len);
                        if(*pparams == NULL ) {