summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-09-21 21:04:03 +0000
committerLuke Leighton <lkcl@samba.org>1999-09-21 21:04:03 +0000
commit0a6eac0b79dd818ca747423c228eca876faf10af (patch)
tree4486d7820f6ec848632e874fabb57c898e6c8037 /source3
parent701f9ed2c97ad50a4258e278a3674b8f5a747d8e (diff)
downloadsamba-0a6eac0b79dd818ca747423c228eca876faf10af.tar.gz
samba-0a6eac0b79dd818ca747423c228eca876faf10af.tar.bz2
samba-0a6eac0b79dd818ca747423c228eca876faf10af.zip
testing for attempts to get more info levels into samr_query_userinfo
(This used to be commit cc19d5cc5c20665beb3b7c5fcf7787d54e37ea71)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h10
-rw-r--r--source3/include/rpc_samr.h2
-rw-r--r--source3/rpc_client/cli_samr.c10
-rw-r--r--source3/rpc_parse/parse_samr.c50
4 files changed, 60 insertions, 12 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index a12f76b66d..7f4ec9cc7e 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -558,6 +558,12 @@ void reset_globals_after_fork(void);
char *client_name(int fd);
char *client_addr(int fd);
+/*The following definitions come from lib/util_status.c */
+
+BOOL get_connection_status(struct connect_record **crec,
+ uint32 *connection_count);
+BOOL get_session_count(struct connect_record **srec,uint32 *session_count);
+
/*The following definitions come from lib/util_str.c */
void set_first_token(char *ptr);
@@ -1854,7 +1860,7 @@ BOOL get_samr_query_aliasmem(struct cli_state *cli, uint16 fnum,
BOOL get_samr_query_userinfo(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain,
uint32 info_level,
- uint32 user_rid, SAM_USER_INFO_21 *usr);
+ uint32 user_rid, void *usr);
BOOL get_samr_query_groupinfo(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain,
uint32 info_level,
@@ -2668,7 +2674,7 @@ void make_sam_user_info11(SAM_USER_INFO_11 *usr,
uint32 rid_group,
uint16 acct_ctrl);
void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth);
-void make_sam_user_info_24(SAM_USER_INFO_24 *usr,
+void make_sam_user_info24(SAM_USER_INFO_24 *usr,
char newpass[516]);
void make_sam_user_info23(SAM_USER_INFO_23 *usr,
diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h
index 8c38571198..ddf359b181 100644
--- a/source3/include/rpc_samr.h
+++ b/source3/include/rpc_samr.h
@@ -1166,6 +1166,8 @@ typedef struct r_samr_query_user_info
SAM_USER_INFO_10 *id10; /* auth-level 0x10 */
SAM_USER_INFO_11 *id11; /* auth-level 0x11 */
SAM_USER_INFO_21 *id21; /* auth-level 21 */
+ SAM_USER_INFO_23 *id23; /* auth-level 0x17 */
+ SAM_USER_INFO_24 *id24; /* auth-level 0x18 */
void* id; /* to make typecasting easy */
} info;
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index 57ee3d58c7..7071786499 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -309,14 +309,12 @@ do a SAMR query user info
BOOL get_samr_query_userinfo(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain,
uint32 info_level,
- uint32 user_rid, SAM_USER_INFO_21 *usr)
+ uint32 user_rid, void *usr)
{
POLICY_HND pol_open_user;
BOOL ret = True;
- if (pol_open_domain == NULL || usr == NULL) return False;
-
- bzero(usr, sizeof(*usr));
+ if (pol_open_domain == NULL) return False;
/* send open domain (on user sid) */
if (!samr_open_user(cli, fnum,
@@ -330,7 +328,7 @@ BOOL get_samr_query_userinfo(struct cli_state *cli, uint16 fnum,
/* send user info query */
if (!samr_query_userinfo(cli, fnum,
&pol_open_user,
- info_level, (void*)usr))
+ info_level, usr))
{
DEBUG(5,("samr_query_userinfo: error in query user info, level 0x%x\n",
info_level));
@@ -2329,7 +2327,7 @@ BOOL samr_query_userinfo(struct cli_state *cli, uint16 fnum,
DEBUG(4,("SAMR Query User Info. level: %d\n", switch_value));
- if (pol == NULL || usr == NULL || switch_value == 0) return False;
+ if (pol == NULL || switch_value == 0) return False;
/* create and send a MSRPC command with api SAMR_QUERY_USERINFO */
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c
index 2cd818aa0d..ccc9cdc183 100644
--- a/source3/rpc_parse/parse_samr.c
+++ b/source3/rpc_parse/parse_samr.c
@@ -4146,7 +4146,7 @@ void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int
unknown_6 = 0x0000 04ec
*************************************************************************/
-void make_sam_user_info_24(SAM_USER_INFO_24 *usr,
+void make_sam_user_info24(SAM_USER_INFO_24 *usr,
char newpass[516])
{
memcpy(usr->pass, newpass, sizeof(usr->pass));
@@ -4155,7 +4155,7 @@ void make_sam_user_info_24(SAM_USER_INFO_24 *usr,
/*******************************************************************
reads or writes a structure.
********************************************************************/
-static void sam_io_user_info_24(char *desc, SAM_USER_INFO_24 *usr, prs_struct *ps, int depth)
+static void sam_io_user_info24(char *desc, SAM_USER_INFO_24 *usr, prs_struct *ps, int depth)
{
if (usr == NULL) return;
@@ -4569,6 +4569,22 @@ void make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u,
break;
}
+ case 23:
+ {
+ r_u->ptr = 1;
+ r_u->info.id23 = (SAM_USER_INFO_23*)info;
+
+ break;
+ }
+
+ case 24:
+ {
+ r_u->ptr = 1;
+ r_u->info.id24 = (SAM_USER_INFO_24*)info;
+
+ break;
+ }
+
default:
{
DEBUG(4,("make_samr_r_query_userinfo: unsupported switch level\n"));
@@ -4596,7 +4612,7 @@ void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struc
prs_uint16("switch_value", ps, depth, &(r_u->switch_value));
prs_align(ps);
- if (r_u->ptr != 0 && r_u->switch_value != 0)
+ if (r_u->ptr != 0 && r_u->switch_value != 0 && r_u->info.id != NULL)
{
switch (r_u->switch_value)
{
@@ -4641,6 +4657,32 @@ void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struc
}
break;
}
+ case 23:
+ {
+ if (r_u->info.id23 != NULL)
+ {
+ sam_io_user_info23("", r_u->info.id23, ps, depth);
+ }
+ else
+ {
+ DEBUG(2,("samr_io_r_query_userinfo: info pointer not initialised\n"));
+ return;
+ }
+ break;
+ }
+ case 24:
+ {
+ if (r_u->info.id24 != NULL)
+ {
+ sam_io_user_info24("", r_u->info.id24, ps, depth);
+ }
+ else
+ {
+ DEBUG(2,("samr_io_r_query_userinfo: info pointer not initialised\n"));
+ return;
+ }
+ break;
+ }
default:
{
DEBUG(2,("samr_io_r_query_userinfo: unknown switch level\n"));
@@ -4727,7 +4769,7 @@ void samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps
DEBUG(2,("samr_io_q_query_userinfo: info pointer not initialised\n"));
return;
}
- sam_io_user_info_24("", q_u->info.id24, ps, depth);
+ sam_io_user_info24("", q_u->info.id24, ps, depth);
break;
}
case 23: