return res;
}
-/****************************************************************************
- Perform a NetWkstaUserLogoff.
-****************************************************************************/
-
-bool cli_NetWkstaUserLogoff(struct cli_state *cli, const char *user, const char *workstation)
-{
- char *rparam = NULL;
- char *rdata = NULL;
- char *p;
- unsigned int rdrcnt,rprcnt;
- char param[WORDSIZE /* api number */
- +sizeof(RAP_NetWkstaUserLogoff_REQ) /* req string */
- +sizeof(RAP_USER_LOGOFF_INFO_L1) /* return string */
- +RAP_USERNAME_LEN+1 /* user name+pad */
- +RAP_MACHNAME_LEN /* wksta name */
- +WORDSIZE /* buffer size */
- +WORDSIZE]; /* buffer size? */
- char upperbuf[MAX(RAP_USERNAME_LEN,RAP_MACHNAME_LEN)];
- int res = -1;
- char *tmp = NULL;
-
- memset(param, 0, sizeof(param));
-
- /* send a SMBtrans command with api NetWkstaUserLogoff */
- p = make_header(param, RAP_WWkstaUserLogoff,
- RAP_NetWkstaUserLogoff_REQ, RAP_USER_LOGOFF_INFO_L1);
- PUTDWORD(p, 0); /* Null pointer */
- PUTDWORD(p, 0); /* Null pointer */
- strlcpy(upperbuf, user, sizeof(upperbuf));
- if (!strupper_m(upperbuf)) {
- return false;
- }
- tmp = upperbuf;
- PUTSTRINGF(p, tmp, RAP_USERNAME_LEN);
- p++; /* strange format, but ok */
- strlcpy(upperbuf, workstation, sizeof(upperbuf));
- if (!strupper_m(upperbuf)) {
- return false;
- }
- tmp = upperbuf;
- PUTSTRINGF(p, tmp, RAP_MACHNAME_LEN);
- PUTWORD(p, CLI_BUFFER_SIZE);
- PUTWORD(p, CLI_BUFFER_SIZE);
-
- if (cli_api(cli,
- param, PTR_DIFF(p,param),1024, /* param, length, max */
- NULL, 0, CLI_BUFFER_SIZE, /* data, length, max */
- &rparam, &rprcnt, /* return params, return size */
- &rdata, &rdrcnt /* return data, return size */
- )) {
- char *endp = rparam + rprcnt;
- res = GETRES(rparam,endp);
- cli->rap_error = res;
-
- if (cli->rap_error != 0) {
- DEBUG(4,("NetwkstaUserLogoff gave error %d\n", cli->rap_error));
- }
- }
-
- SAFE_FREE(rparam);
- SAFE_FREE(rdata);
- return (cli->rap_error == 0);
-}
-
int cli_NetPrintQEnum(struct cli_state *cli,
void (*qfn)(const char*,uint16_t,uint16_t,uint16_t,const char*,const char*,const char*,const char*,const char*,uint16_t,uint16_t),
void (*jfn)(uint16_t,const char*,const char*,const char*,const char*,uint16_t,uint16_t,const char*,unsigned int,unsigned int,const char*))
bool cli_get_pdc_name(struct cli_state *cli, const char *workgroup, char **pdc_name);
bool cli_get_server_name(TALLOC_CTX *mem_ctx, struct cli_state *cli,
char **servername);
-bool cli_NetWkstaUserLogoff(struct cli_state *cli, const char *user, const char *workstation);
int cli_NetPrintQEnum(struct cli_state *cli,
void (*qfn)(const char*,uint16_t,uint16_t,uint16_t,const char*,const char*,const char*,const char*,const char*,uint16_t,uint16_t),
void (*jfn)(uint16_t,const char*,const char*,const char*,const char*,uint16_t,uint16_t,const char*,unsigned int,unsigned int,const char*));