diff options
author | Tim Potter <tpot@samba.org> | 2002-05-29 01:43:44 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-05-29 01:43:44 +0000 |
commit | 568deecbf0bcda46fd9c927ad10b76d748b8c64d (patch) | |
tree | d4fbc740caa88be5608001dcde47c0d58ead43ea /source3/libsmb/cli_srvsvc.c | |
parent | 43b35364ffda5c779452fb41c015b280fefc6ab6 (diff) | |
download | samba-568deecbf0bcda46fd9c927ad10b76d748b8c64d.tar.gz samba-568deecbf0bcda46fd9c927ad10b76d748b8c64d.tar.bz2 samba-568deecbf0bcda46fd9c927ad10b76d748b8c64d.zip |
Added netremotetod to try and figure out which srvsvc commands are denied
when using restrictanonymous.
(This used to be commit 0c65978ed07903af808da5f32cc29531aef23225)
Diffstat (limited to 'source3/libsmb/cli_srvsvc.c')
-rw-r--r-- | source3/libsmb/cli_srvsvc.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/source3/libsmb/cli_srvsvc.c b/source3/libsmb/cli_srvsvc.c index f3d012434e..9e2f5a3686 100644 --- a/source3/libsmb/cli_srvsvc.c +++ b/source3/libsmb/cli_srvsvc.c @@ -188,3 +188,48 @@ WERROR cli_srvsvc_net_share_enum(struct cli_state *cli, TALLOC_CTX *mem_ctx, return result; } + +WERROR cli_srvsvc_net_remote_tod(struct cli_state *cli, TALLOC_CTX *mem_ctx, + char *server, TIME_OF_DAY_INFO *tod) +{ + prs_struct qbuf, rbuf; + SRV_Q_NET_REMOTE_TOD q; + SRV_R_NET_REMOTE_TOD r; + WERROR result = W_ERROR(ERRgeneral); + + ZERO_STRUCT(q); + ZERO_STRUCT(r); + + /* Initialise parse structures */ + + prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL); + prs_init(&rbuf, 0, mem_ctx, UNMARSHALL); + + /* Initialise input parameters */ + + init_srv_q_net_remote_tod(&q, cli->srv_name_slash); + + /* Marshall data and send request */ + + if (!srv_io_q_net_remote_tod("", &q, &qbuf, 0) || + !rpc_api_pipe_req(cli, SRV_NET_REMOTE_TOD, &qbuf, &rbuf)) + goto done; + + /* Unmarshall response */ + + r.tod = tod; + + if (!srv_io_r_net_remote_tod("", &r, &rbuf, 0)) + goto done; + + result = r.status; + + if (!W_ERROR_IS_OK(result)) + goto done; + + done: + prs_mem_free(&qbuf); + prs_mem_free(&rbuf); + + return result; +} |