Make one QIP infolevel specify a sid hf field and update the embryonic sid snooping...
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 21 May 2003 10:39:19 +0000 (10:39 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 21 May 2003 10:39:19 +0000 (10:39 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7709 f5534014-38df-0310-8fa8-9805f1628bb7

packet-dcerpc-lsa.c
packet-dcerpc-samr.c
packet-smb-sidsnooping.c

index 4c0255f50ce7d6124e90d2c6bca14de71ef3f191..934db8e2f4651c72fa45dbea6d09ee90dcee7503 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright 2001,2003 Tim Potter <tpot@samba.org>
  *  2002  Added LSA command dissectors  Ronnie Sahlberg
  *
- * $Id: packet-dcerpc-lsa.c,v 1.79 2003/05/21 10:06:29 sahlberg Exp $
+ * $Id: packet-dcerpc-lsa.c,v 1.80 2003/05/21 10:39:19 sahlberg Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -71,6 +71,7 @@ static int hf_lsa_size_needed = -1;
 static int hf_lsa_max_count = -1;
 static int hf_lsa_index = -1;
 static int hf_lsa_domain = -1;
+static int hf_lsa_domain_sid = -1;
 static int hf_lsa_acct = -1;
 static int hf_lsa_server_role = -1;
 static int hf_lsa_source = -1;
@@ -784,7 +785,7 @@ lsa_dissect_POLICY_PRIMARY_DOMAIN_INFO(tvbuff_t *tvb, int offset,
 
        /* sid */
        offset = dissect_ndr_nt_PSID(tvb, offset,
-               pinfo, tree, drep, -1);
+               pinfo, tree, drep, hf_lsa_domain_sid);
 
        proto_item_set_len(item, offset-old_offset);
        return offset;
@@ -4247,6 +4248,10 @@ proto_register_dcerpc_lsa(void)
                { "Domain", "lsa.domain", FT_STRING, BASE_NONE,
                NULL, 0x0, "Domain", HFILL }},
 
+       { &hf_lsa_domain_sid,
+               { "Domain SID", "lsa.domain_sid", FT_STRING, BASE_NONE,
+               NULL, 0x0, "The Domain SID", HFILL }},
+
        { &hf_lsa_acct,
                { "Account", "lsa.acct", FT_STRING, BASE_NONE,
                NULL, 0x0, "Account", HFILL }},
index 1f8937e5321d80a6b83412af470f179bf7a373f4..d1b8fe2e3abb989afb72193cb88f3e9c7d5f3434 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright 2001,2003 Tim Potter <tpot@samba.org>
  *   2002 Added all command dissectors  Ronnie Sahlberg
  *
- * $Id: packet-dcerpc-samr.c,v 1.89 2003/05/21 10:16:09 sahlberg Exp $
+ * $Id: packet-dcerpc-samr.c,v 1.90 2003/05/21 10:39:19 sahlberg Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -478,7 +478,13 @@ dissect_ndr_nt_SID(tvbuff_t *tvb, int offset, packet_info *pinfo,
        dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
        dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
        char *sid_str;
+       char *name;
 
+       if(di->hf_index!=-1){
+               name=proto_registrar_get_name(di->hf_index);
+       } else {
+               name="Domain";
+       }
        if(di->conformant_run){
                /* just a run to handle conformant arrays, no scalars to dissect */
                return offset;
@@ -490,7 +496,7 @@ dissect_ndr_nt_SID(tvbuff_t *tvb, int offset, packet_info *pinfo,
        offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
                        hf_samr_count, NULL);
 
-       offset = dissect_nt_sid(tvb, offset, tree, "Domain", &sid_str, hf_sid);
+       offset = dissect_nt_sid(tvb, offset, tree, name, &sid_str, hf_sid);
 
        dcv->private_data = sid_str;
 
index 270968deba3084f7614f46b66e0bb8c020fd0cfd..f6c71b7e14a261d0c20920387f23a7412c1b9328 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for snooping SID to name mappings
  * Copyright 2003, Ronnie Sahlberg
  *
- * $Id: packet-smb-sidsnooping.c,v 1.3 2003/04/23 08:20:01 guy Exp $
+ * $Id: packet-smb-sidsnooping.c,v 1.4 2003/05/21 10:39:19 sahlberg Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -41,7 +41,7 @@
 static int hf_lsa = -1;
 static int hf_lsa_opnum = -1;
 static int hf_lsa_domain = -1;
-static int hf_smb_sid = -1;
+static int hf_lsa_domain_sid = -1;
 
 
 
@@ -109,7 +109,7 @@ lsa_QueryInfoPolicy_l3_reply(void *dummy _U_, packet_info *pinfo _U_, epan_disse
        fi=gp_domain->pdata[0];
        domain=fi->value->value.string;
 
-       gp_sid=proto_get_finfo_ptr_array(edt->tree, hf_smb_sid);
+       gp_sid=proto_get_finfo_ptr_array(edt->tree, hf_lsa_domain_sid);
        if(!gp_sid || gp_sid->len!=1){
                return 0;
        }
@@ -198,9 +198,9 @@ sid_snooping_init(void)
                hf_lsa_opnum=hfi->id;
        }
 
-       hfi=proto_registrar_get_byname("smb.sid");
+       hfi=proto_registrar_get_byname("lsa.domain_sid");
        if(hfi){
-               hf_smb_sid=hfi->id;
+               hf_lsa_domain_sid=hfi->id;
        }
 
        hfi=proto_registrar_get_byname("lsa.domain");
@@ -210,7 +210,7 @@ sid_snooping_init(void)
 
 
 
-       error_string=register_tap_listener("dcerpc", lsa_QueryInfoPolicy_l3_reply, "dcerpc.pkt_type==2 and lsa.opnum==7 and lsa.info.level==3 and lsa.domain and smb.sid", NULL, lsa_QueryInfoPolicy_l3_reply, NULL);
+       error_string=register_tap_listener("dcerpc", lsa_QueryInfoPolicy_l3_reply, "dcerpc.pkt_type==2 and lsa.opnum==7 and lsa.info.level==3 and lsa.domain and lsa.domain_sid", NULL, lsa_QueryInfoPolicy_l3_reply, NULL);
        if(error_string){
                /* error, we failed to attach to the tap. clean up */