traffic_packets: replace level 102 to 101 for packet_srvsvc_21
authorJoe Guo <joeg@catalyst.net.nz>
Thu, 26 Apr 2018 23:27:59 +0000 (11:27 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 12 May 2018 00:09:28 +0000 (02:09 +0200)
Level 102 will cause WERR_ACCESS_DENIED error against Windows, because:

    > If the level is 102 or 502, the Windows implementation checks whether
    > the caller is a member of one of the groups previously mentioned or
    > is a member of the Power Users local group.

It passed against Samba since this check is not implemented by Samba yet.

refer to:

    https://msdn.microsoft.com/en-us/library/cc247297.aspx#Appendix_A_80

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/emulate/traffic_packets.py

index 390041b95137667fe739464d54b10eea4243c45e..2f1691d8568a07efff9838d1888b61f9642d19af 100644 (file)
@@ -935,9 +935,25 @@ def packet_srvsvc_16(packet, conversation, context):
 
 
 def packet_srvsvc_21(packet, conversation, context):
-    # NetSrvGetInfo
+    """NetSrvGetInfo
+
+    FIXME: Level changed from 102 to 101 here, to bypass Windows error.
+
+    Level 102 will cause WERR_ACCESS_DENIED error against Windows, because:
+
+        > If the level is 102 or 502, the Windows implementation checks whether
+        > the caller is a member of one of the groups previously mentioned or
+        > is a member of the Power Users local group.
+
+    It passed against Samba since this check is not implemented by Samba yet.
+
+    refer to:
+
+        https://msdn.microsoft.com/en-us/library/cc247297.aspx#Appendix_A_80
+
+    """
     srvsvc = context.get_srvsvc_connection()
     server_unc = "\\\\" + context.server
-    level = 102
+    level = 101
     srvsvc.NetSrvGetInfo(server_unc, level)
     return True