When dissecting specific rights, pass a name string down so the

proto item says "foo specific rights" instead of just "specific
rights".

svn path=/trunk/; revision=7401
This commit is contained in:
Tim Potter 2003-04-03 05:43:59 +00:00
parent dea1bf4adb
commit 795926735d
5 changed files with 54 additions and 37 deletions

View 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.72 2003/02/08 09:41:43 guy Exp $
* $Id: packet-dcerpc-lsa.c,v 1.73 2003/04/03 05:43:58 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -364,7 +364,8 @@ lsa_dissect_LSA_SECURITY_DESCRIPTOR_data(tvbuff_t *tvb, int offset,
hf_lsa_sd_size, &len);
dissect_nt_sec_desc(
tvb, offset, pinfo, tree, drep, len, lsa_specific_rights);
tvb, offset, pinfo, tree, drep, len, lsa_specific_rights,
"LSA");
offset += len;
@ -444,7 +445,7 @@ lsa_dissect_ACCESS_MASK(tvbuff_t *tvb, int offset,
{
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_lsa_access_mask,
lsa_specific_rights);
lsa_specific_rights, "LSA");
return offset;
}

View 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.82 2003/03/11 22:51:51 guy Exp $
* $Id: packet-dcerpc-samr.c,v 1.83 2003/04/03 05:43:58 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -1140,7 +1140,7 @@ samr_dissect_connect2_rqst(tvbuff_t *tvb, int offset,
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_samr_access,
specific_rights_connect);
specific_rights_connect, "SAMR connect");
return offset;
}
@ -1161,7 +1161,7 @@ samr_dissect_connect4_rqst(tvbuff_t *tvb, int offset,
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_samr_access,
specific_rights_connect);
specific_rights_connect, "SAMR connect");
return offset;
}
@ -1350,7 +1350,7 @@ samr_dissect_open_domain_rqst(tvbuff_t *tvb, int offset,
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_samr_access,
specific_rights_domain);
specific_rights_domain, "SAMR domain");
offset = dissect_ndr_pointer_cb(
tvb, offset, pinfo, tree, drep, dissect_ndr_nt_SID,
@ -1470,7 +1470,7 @@ samr_dissect_create_alias_in_domain_rqst(tvbuff_t *tvb, int offset,
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_samr_access,
specific_rights_alias);
specific_rights_alias, "SAMR alias");
return offset;
}
@ -2011,7 +2011,7 @@ samr_dissect_create_user2_in_domain_rqst(tvbuff_t *tvb, int offset,
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_samr_access,
specific_rights_user);
specific_rights_user, "SAMR user");
return offset;
}
@ -2030,7 +2030,7 @@ samr_dissect_create_user2_in_domain_reply(tvbuff_t *tvb, int offset,
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_samr_access_granted,
specific_rights_user);
specific_rights_user, "SAMR user");
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_samr_rid, NULL);
@ -4518,7 +4518,7 @@ samr_dissect_open_group_rqst(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_samr_access,
specific_rights_group);
specific_rights_group, "SAMR group");
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_samr_rid, &rid);
@ -4573,7 +4573,7 @@ samr_dissect_open_alias_rqst(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_samr_access,
specific_rights_alias);
specific_rights_alias, "SAMR alias");
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_samr_rid, &rid);
@ -4657,7 +4657,7 @@ samr_dissect_create_group_in_domain_rqst(tvbuff_t *tvb, int offset,
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_samr_access,
specific_rights_group);
specific_rights_group, "SAMR group");
return offset;
}

View File

@ -2,7 +2,7 @@
* Routines for SMB \PIPE\spoolss packet disassembly
* Copyright 2001-2003, Tim Potter <tpot@samba.org>
*
* $Id: packet-dcerpc-spoolss.c,v 1.92 2003/02/25 02:08:05 tpot Exp $
* $Id: packet-dcerpc-spoolss.c,v 1.93 2003/04/03 05:43:58 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -2243,7 +2243,7 @@ static int dissect_PRINTER_INFO_2(tvbuff_t *tvb, int offset,
dissect_nt_sec_desc(
tvb, secdesc_offset, pinfo, tree, drep,
tvb_length_remaining(tvb, secdesc_offset),
spoolss_specific_rights);
spoolss_specific_rights, "SPOOLSS");
offset = dissect_printer_attributes(tvb, offset, pinfo, tree, drep);
@ -2292,7 +2292,8 @@ static int dissect_PRINTER_INFO_3(tvbuff_t *tvb, int offset,
offset = dissect_nt_sec_desc(
tvb, offset, pinfo, tree, drep,
tvb_length_remaining(tvb, offset), spoolss_specific_rights);
tvb_length_remaining(tvb, offset),
spoolss_specific_rights, "SPOOLSS");
return offset;
}
@ -2475,7 +2476,7 @@ static int SpoolssOpenPrinterEx_q(tvbuff_t *tvb, int offset,
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_access_required,
spoolss_specific_rights);
spoolss_specific_rights, "SPOOLSS");
offset = dissect_USER_LEVEL_CTR(tvb, offset, pinfo, tree, drep);
@ -3317,7 +3318,7 @@ dissect_SEC_DESC_BUF(tvbuff_t *tvb, int offset, packet_info *pinfo,
dissect_nt_sec_desc(
tvb, offset, pinfo, subtree, drep, len,
spoolss_specific_rights);
spoolss_specific_rights, "SPOOLSS");
offset += len;
@ -4463,7 +4464,7 @@ dissect_spoolss_JOB_INFO_2(tvbuff_t *tvb, int offset, packet_info *pinfo,
dissect_nt_sec_desc(
tvb, secdesc_offset, pinfo, subtree, drep,
tvb_length_remaining(tvb, secdesc_offset),
spoolss_specific_rights);
spoolss_specific_rights, "SPOOLSS");
offset = dissect_job_status(tvb, offset, pinfo, subtree, drep);

View File

@ -2,7 +2,7 @@
* Routines for SMB packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
* $Id: packet-smb-common.h,v 1.19 2003/04/03 02:57:48 tpot Exp $
* $Id: packet-smb-common.h,v 1.20 2003/04/03 05:43:59 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -64,12 +64,14 @@ typedef void (nt_access_mask_fn_t)(tvbuff_t *tvb, gint offset,
int
dissect_nt_access_mask(tvbuff_t *tvb, gint offset, packet_info *pinfo,
proto_tree *tree, char *drep, int hfindex,
nt_access_mask_fn_t *specific_rights_fn);
nt_access_mask_fn_t *specific_rights_fn,
char *specific_rights_name);
int
dissect_nt_sec_desc(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *parent_tree, char *drep, int len,
nt_access_mask_fn_t *specific_rights_fn);
nt_access_mask_fn_t *specific_rights_fn,
char *specific_rights_name);
extern const value_string share_type_vals[];

View File

@ -3,7 +3,7 @@
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
* 2001 Rewrite by Ronnie Sahlberg and Guy Harris
*
* $Id: packet-smb.c,v 1.315 2003/03/25 09:41:41 sahlberg Exp $
* $Id: packet-smb.c,v 1.316 2003/04/03 05:43:59 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -7281,7 +7281,8 @@ static int hf_access_specific_0 = -1;
int
dissect_nt_access_mask(tvbuff_t *tvb, gint offset, packet_info *pinfo,
proto_tree *tree, char *drep, int hfindex,
nt_access_mask_fn_t *specific_rights_fn)
nt_access_mask_fn_t *specific_rights_fn,
char *specific_rights_name)
{
proto_item *item;
proto_tree *subtree, *generic, *standard, *specific;
@ -7379,9 +7380,15 @@ dissect_nt_access_mask(tvbuff_t *tvb, gint offset, packet_info *pinfo,
pointer if we have one, otherwise just display bits 0-15 in
boring fashion. */
item = proto_tree_add_text(subtree, tvb, offset - 4, 4,
"Specific rights: 0x%08x",
access & SPECIFIC_RIGHTS_MASK);
if (specific_rights_name)
item = proto_tree_add_text(subtree, tvb, offset - 4, 4,
"%s specific rights: 0x%08x",
specific_rights_name,
access & SPECIFIC_RIGHTS_MASK);
else
item = proto_tree_add_text(subtree, tvb, offset - 4, 4,
"Specific rights: 0x%08x",
access & SPECIFIC_RIGHTS_MASK);
specific = proto_item_add_subtree(item, ett_nt_access_mask_specific);
@ -7462,7 +7469,8 @@ static int hf_smb_access_mask = -1;
static int
dissect_nt_v2_ace(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *parent_tree, char *drep,
nt_access_mask_fn_t *specific_rights_fn)
nt_access_mask_fn_t *specific_rights_fn,
char *specific_rights_name)
{
proto_item *item = NULL;
proto_tree *tree = NULL;
@ -7494,7 +7502,7 @@ dissect_nt_v2_ace(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* access mask */
offset = dissect_nt_access_mask(
tvb, offset, pinfo, tree, drep, hf_smb_access_mask,
specific_rights_fn);
specific_rights_fn, specific_rights_name);
/* SID */
offset = dissect_nt_sid(tvb, offset, tree, "ACE", &sid_str);
@ -7517,7 +7525,8 @@ dissect_nt_v2_ace(tvbuff_t *tvb, int offset, packet_info *pinfo,
static int
dissect_nt_acl(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *parent_tree, char *drep, char *name,
nt_access_mask_fn_t *specific_rights_fn)
nt_access_mask_fn_t *specific_rights_fn,
char *specific_rights_name)
{
proto_item *item = NULL;
proto_tree *tree = NULL;
@ -7552,7 +7561,8 @@ dissect_nt_acl(tvbuff_t *tvb, int offset, packet_info *pinfo,
while(num_aces--){
offset=dissect_nt_v2_ace(
tvb, offset, pinfo, tree, drep, specific_rights_fn);
tvb, offset, pinfo, tree, drep, specific_rights_fn,
specific_rights_name);
}
}
@ -7663,7 +7673,8 @@ dissect_nt_sec_desc_type(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
int
dissect_nt_sec_desc(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *parent_tree, char *drep, int len,
nt_access_mask_fn_t *specific_rights_fn)
nt_access_mask_fn_t *specific_rights_fn,
char *specific_rights_name)
{
proto_item *item = NULL;
proto_tree *tree = NULL;
@ -7729,13 +7740,15 @@ dissect_nt_sec_desc(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* sacl */
if(sacl_offset){
dissect_nt_acl(tvb, old_offset+sacl_offset, pinfo, tree,
drep, "System (SACL)", specific_rights_fn);
drep, "System (SACL)", specific_rights_fn,
specific_rights_name);
}
/* dacl */
if(dacl_offset){
dissect_nt_acl(tvb, old_offset+dacl_offset, pinfo, tree,
drep, "User (DACL)", specific_rights_fn);
drep, "User (DACL)", specific_rights_fn,
specific_rights_name);
}
}
@ -7822,7 +7835,7 @@ dissect_nt_trans_data_request(tvbuff_t *tvb, packet_info *pinfo, int offset, pro
if(ntd->sd_len){
offset = dissect_nt_sec_desc(
tvb, offset, pinfo, tree, NULL, ntd->sd_len,
NULL);
NULL, NULL);
}
/* extended attributes */
@ -7840,7 +7853,7 @@ dissect_nt_trans_data_request(tvbuff_t *tvb, packet_info *pinfo, int offset, pro
break;
case NT_TRANS_SSD:
offset = dissect_nt_sec_desc(
tvb, offset, pinfo, tree, NULL, bc, NULL);
tvb, offset, pinfo, tree, NULL, bc, NULL, NULL);
break;
case NT_TRANS_NOTIFY:
break;
@ -8342,7 +8355,7 @@ dissect_nt_trans_data_response(tvbuff_t *tvb, packet_info *pinfo,
* somewhere.
*/
offset = dissect_nt_sec_desc(
tvb, offset, pinfo, tree, NULL, len, NULL);
tvb, offset, pinfo, tree, NULL, len, NULL, NULL);
break;
}
case NT_TRANS_GET_USER_QUOTA: