patch for rpcclient
Luke Kenneth Casson Leighton
lkcl at switchboard.net
Mon Mar 8 19:15:09 GMT 1999
todd, patch looks good. btw this is a [cvs -t] diff -u -w -b -B it's
_much_ simpler and shorter! the -w -b -B options i used to remove most of
the formatting changes you made, however that of course meant that it
looks a bit silly: you added an indentation for an if (res) { ... } so
just diff -u is best.
question. why change sid being queried from domain sid to
sid-that-m/c-is-responsible-for?
you sure that 3e4 (whatever) flag is "buffer size"? tried it with small
value (e.g 50 bytes) what happens?
thx ver much, cmd_samr enum is a good point.
luke
? f
? g
? cmds
? regtest
? regout
? log.client
? client-new.c
? patch
? samba-latest.tar
? rpcclient.patch
? mysqlsam.patch
? f1
? .f.swp
Index: rpc_parse/parse_samr.c
===================================================================
RCS file: /data/cvs/samba/source/rpc_parse/parse_samr.c,v
retrieving revision 1.50
diff -u -w -b -B -r1.50 parse_samr.c
--- parse_samr.c 1999/02/24 01:51:37 1.50
+++ parse_samr.c 1999/03/08 18:47:26
@@ -1128,9 +1128,9 @@
prs_align(ps);
- prs_uint32("num_entries4", ps, depth, &(r_u->num_entries4));
}
+ prs_uint32("num_entries4", ps, depth, &(r_u->num_entries4));
prs_uint32("status", ps, depth, &(r_u->status));
}
@@ -2524,10 +2524,9 @@
}
prs_align(ps);
-
- prs_uint32("num_entries4", ps, depth, &(r_u->num_entries4));
}
+ prs_uint32("num_entries4", ps, depth, &(r_u->num_entries4));
prs_uint32("status", ps, depth, &(r_u->status));
}
@@ -2658,10 +2657,9 @@
}
prs_align(ps);
-
- prs_uint32("num_entries4", ps, depth, &(r_u->num_entries4));
}
+ prs_uint32("num_entries4", ps, depth, &(r_u->num_entries4));
prs_uint32("status", ps, depth, &(r_u->status));
}
Index: rpcclient/cmd_samr.c
===================================================================
RCS file: /data/cvs/samba/source/rpcclient/cmd_samr.c,v
retrieving revision 1.38
diff -u -w -b -B -r1.38 cmd_samr.c
--- cmd_samr.c 1999/02/24 01:51:45 1.38
+++ cmd_samr.c 1999/03/08 18:47:26
@@ -1093,7 +1093,7 @@
uint16 unk_0 = 0x0;
uint16 acb_mask = 0;
uint16 unk_1 = 0x0;
- uint32 flags = 0x304; /* absolutely no idea. */
+ uint32 flags = 0x02000000; /* maximum allowed. */
fstring tmp;
int i;
@@ -1191,6 +1191,8 @@
fprintf(out_hnd, "No users\n");
}
+ if (res)
+ {
/* query all the users */
for (user_idx = 0; res && user_idx < info->dom.num_sam_entries; user_idx++)
{
@@ -1296,6 +1298,7 @@
}
}
}
+ }
res1 = res1 ? samr_close(smb_cli, fnum,
&info->dom.samr_pol_open_builtindom) : False;
@@ -1510,12 +1513,12 @@
DOM_SID sid1;
BOOL res = True;
BOOL request_member_info = False;
- uint32 flags = 0x200003f3; /* absolutely no idea. */
+ uint32 flags = 0x02000000; /* maximum allowed. */
fstring tmp;
uint32 alias_idx;
- sid_to_string(sid, &info->dom.level3_sid);
- fstrcpy(domain, info->dom.level3_dom);
+ sid_to_string(sid, &info->dom.level5_sid);
+ fstrcpy(domain, info->dom.level5_dom);
#if 0
fstrcpy(sid , "S-1-5-20");
#endif
@@ -1566,8 +1569,9 @@
{
fprintf(out_hnd, "No aliases\n");
}
-
+ if (res)
+ {
for (alias_idx = 0; alias_idx < info->dom.num_sam_entries; alias_idx++)
{
uint32 alias_rid = info->dom.sam[alias_idx].rid;
@@ -1650,6 +1654,7 @@
}
}
}
+ }
res = res ? samr_close(smb_cli, fnum,
&info->dom.samr_pol_connect) : False;
@@ -1687,11 +1692,11 @@
DOM_SID sid1;
BOOL res = True;
BOOL request_member_info = False;
- uint32 flags = 0x200003f3; /* absolutely no idea. */
+ uint32 flags = 0x02000000; /* maximum allowed. */
fstring tmp;
uint32 group_idx;
- sid_copy(&sid1, &info->dom.level3_sid);
+ sid_copy(&sid1, &info->dom.level5_sid);
if (sid1.num_auths == 0)
{
@@ -1743,6 +1748,8 @@
}
+ if (res)
+ {
for (group_idx = 0; group_idx < info->dom.num_sam_entries; group_idx++)
{
uint32 group_rid = info->dom.sam[group_idx].rid;
@@ -1780,6 +1787,7 @@
}
}
}
+ }
res = res ? samr_close(smb_cli, fnum,
&info->dom.samr_pol_open_domain) : False;
<a href="mailto:lkcl at samba.org" > Luke Kenneth Casson Leighton </a>
<a href="http://www.cb1.com/~lkcl"> Samba and Network Development </a>
<a href="http://samba.org" > Samba Web site </a>
=====================================================================
Luke Kenneth Casson Leighton | Direct Dial : (678) 443-6183
Systems Engineer / ISS XForce Team | ISS Front Desk: (678) 443-6000
Internet Security Systems, Inc. | ISS Fax : (678) 443-6477
http://www.iss.net/ *Adaptive Network Security for the Enterprise*
ISS Connect - International User Conference - May '99
=====================================================================
More information about the samba-technical
mailing list