summaryrefslogtreecommitdiff
path: root/source3/rpcclient/cmd_srvsvc.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-10-01 18:11:57 +0000
committerLuke Leighton <lkcl@samba.org>1999-10-01 18:11:57 +0000
commit860688f6e71fca58fee50e364224ee0f6e4f4da4 (patch)
tree60c13a2b42fedb4b1470e671b470954af051df6c /source3/rpcclient/cmd_srvsvc.c
parent0db243bacb356ce4787c1de7e12832942b55e9e1 (diff)
downloadsamba-860688f6e71fca58fee50e364224ee0f6e4f4da4.tar.gz
samba-860688f6e71fca58fee50e364224ee0f6e4f4da4.tar.bz2
samba-860688f6e71fca58fee50e364224ee0f6e4f4da4.zip
error-code checking in lsa_lookup_sids. anonymous connections for
domain info. adjusting net_srv_get_info function. (This used to be commit 42eb916fae0d377f8908dfc42b332e6a53c4e2d9)
Diffstat (limited to 'source3/rpcclient/cmd_srvsvc.c')
-rw-r--r--source3/rpcclient/cmd_srvsvc.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c
index c433908e20..547b39b2b8 100644
--- a/source3/rpcclient/cmd_srvsvc.c
+++ b/source3/rpcclient/cmd_srvsvc.c
@@ -41,43 +41,54 @@ extern FILE* out_hnd;
/****************************************************************************
server get info query
****************************************************************************/
-void cmd_srv_query_info(struct client_info *info)
+BOOL net_srv_get_info(struct client_info *info,
+ uint32 info_level,
+ SRV_INFO_CTR *ctr)
{
uint16 nt_pipe_fnum;
fstring dest_srv;
- fstring tmp;
- SRV_INFO_CTR ctr;
- uint32 info_level = 101;
BOOL res = True;
- bzero(&ctr, sizeof(ctr));
-
fstrcpy(dest_srv, "\\\\");
fstrcat(dest_srv, info->dest_host);
strupper(dest_srv);
- if (next_token(NULL, tmp, NULL, sizeof(tmp)-1))
- {
- info_level = (uint32)strtol(tmp, (char**)NULL, 10);
- }
-
- DEBUG(4,("cmd_srv_query_info: server:%s info level: %d\n",
+ DEBUG(4,("net_srv_get_info: server:%s info level: %d\n",
dest_srv, (int)info_level));
- DEBUG(5, ("cmd_srv_query_info: smb_cli->fd:%d\n", smb_cli->fd));
-
/* open LSARPC session. */
res = res ? cli_nt_session_open(smb_cli, PIPE_SRVSVC, &nt_pipe_fnum) : False;
/* send info level: receive requested info. hopefully. */
res = res ? do_srv_net_srv_get_info(smb_cli, nt_pipe_fnum,
- dest_srv, info_level, &ctr) : False;
+ dest_srv, info_level, ctr) : False;
/* close the session */
cli_nt_session_close(smb_cli, nt_pipe_fnum);
- if (res)
+ return res;
+}
+
+/****************************************************************************
+server get info query
+****************************************************************************/
+void cmd_srv_query_info(struct client_info *info)
+{
+ uint32 info_level = 101;
+ SRV_INFO_CTR ctr;
+ fstring tmp;
+
+ bzero(&ctr, sizeof(ctr));
+
+ if (next_token(NULL, tmp, NULL, sizeof(tmp)-1))
+ {
+ info_level = (uint32)strtol(tmp, (char**)NULL, 10);
+ }
+
+ DEBUG(5, ("cmd_srv_query_info: smb_cli->fd:%d\n", smb_cli->fd));
+
+ if (net_srv_get_info(info, info_level, &ctr))
{
DEBUG(5,("cmd_srv_query_info: query succeeded\n"));