s3: smbd: streams - Ensure share mode validation ignores internal opens (op_mid ...
authorVolker Lendecke <vl@samba.org>
Tue, 9 Sep 2014 10:53:52 +0000 (10:53 +0000)
committerVolker Lendecke <vl@samba.org>
Fri, 12 Sep 2014 10:16:10 +0000 (12:16 +0200)
Fixes bug 10797 - smbd panic at find_oplock_types

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index f077210a96b837147316a783dc0664217dd7adc9..7626b58b0947035e990d25325cd3db165871b234 100644 (file)
@@ -1110,7 +1110,7 @@ static void validate_my_share_entries(struct smbd_server_connection *sconn,
                return;
        }
 
-       if (share_entry->share_file_id == 0) {
+       if (share_entry->op_mid == 0) {
                /* INTERNAL_OPEN_ONLY */
                return;
        }
@@ -1291,6 +1291,11 @@ static bool validate_oplock_types(struct share_mode_lock *lck)
                        continue;
                }
 
+               if (e->op_mid == 0) {
+                       /* INTERNAL_OPEN_ONLY */
+                       continue;
+               }
+
                if (e->op_type == NO_OPLOCK && is_stat_open(e->access_mask)) {
                        /* We ignore stat opens in the table - they
                           always have NO_OPLOCK and never get or