46#define SMB_LMAPI_SLOT "\\PIPE\\LANMAN"
47#define SMB_LMAPI_SUPW_DESC "zb16b16WW"
50 char *oldpass,
char *newpass,
int *apiStatus)
54 int param_len, i, pkt_len, pad_api_name =
FALSE;
71 if (pkt_len & 0x0001) {
72 pkt_len = pkt_len + 1;
76 pkt_len = pkt_len + param_len;
120 if (pad_api_name ==
TRUE)
137 p = p + strlen(user) + 1;
139 strncpy(p, oldpass, 16);
143 strncpy(p, newpass, 16);
148 SSVAL(p, 2, strlen(newpass));
152 if (
RFCNB_Send(tree -> con -> Trans_Connect, pkt, pkt_len) < 0) {
155 fprintf(stderr,
"Error sending Trans request\n");
166 if (
RFCNB_Recv(tree -> con -> Trans_Connect, pkt, pkt_len) < 0) {
169 fprintf(stderr,
"Error receiving response to Trans request\n");
183 fprintf(stderr,
"SMB_trans failed with errorclass = %i, Error Code = %i\n",
204#define SMB_LMAPI_SUI_DESC "zWsTPWW"
205#define SMB_LMAPI_SUI_DATA_DESC "B16"
210 char *newpass,
int *apiStatus)
214 int param_len, i, pkt_len, data_len, pad_api_name =
FALSE;
215 int pad_params =
FALSE;
232 if (pkt_len & 0x0001) {
238 if (param_len & 0x0001) {
244 pkt_len = pkt_len + param_len + data_len;
246 if (pad_api_name ==
TRUE) pkt_len = pkt_len + 1;
247 if (pad_params ==
TRUE) pkt_len = pkt_len + 1;
292 if (pad_api_name ==
TRUE)
310 p = p + strlen(user) + 1;
318 SSVAL(p, 4, strlen(newpass));
324 if (pad_params ==
TRUE)
331 if (
RFCNB_Send(tree -> con -> Trans_Connect, pkt, pkt_len) < 0) {
334 fprintf(stderr,
"Error sending Trans SetUserInfo request\n");
345 if (
RFCNB_Recv(tree -> con -> Trans_Connect, pkt, pkt_len) < 0) {
348 fprintf(stderr,
"Error receiving response to Trans SetUserInfo request\n");
362 fprintf(stderr,
"SMB_trans SetUserInfo failed with errorclass = %i, Error Code = %i\n",
386 int *shares_returned,
int *shares_total)
#define SIVAL(buf, pos, val)
#define SSVAL(buf, pos, val)
struct RFCNB_Pkt * RFCNB_Alloc_Pkt(int n)
void RFCNB_Free_Pkt(struct RFCNB_Pkt *pkt)
int RFCNB_Send(struct RFCNB_Con *Con_Handle, struct RFCNB_Pkt *udata, int Length)
int RFCNB_Recv(void *Con_Handle, struct RFCNB_Pkt *Data, int Length)
int SMBapi_NetUserPasswordSet(SMB_Tree_Handle tree, char *user, char *oldpass, char *newpass, int *apiStatus)
#define SMB_LMAPI_SUI_DESC
int SMBapi_NetSetUserInfo(SMB_Tree_Handle tree, char *user, char *newpass, int *apiStatus)
int SMBapi_NetShareEnum(SMB_Tree_Handle tree, char *enum_buf, int bufsiz, int *shares_returned, int *shares_total)
#define SMB_LMAPI_SUPW_DESC
#define SMB_LMAPI_SUI_DATA_DESC
SMB_Tree_Handle SMBapi_Tree
#define SMBlibE_SendFailed
#define SMBlibE_RecvFailed
#define SMB_trans_mdc_offset
#define SMB_trans_pbo_offset
#define SMB_trans_pbc_offset
#define SMB_hdr_rcls_offset
#define SMB_hdr_wct_offset
#define SMB_LMapi_SetUserInfo
#define SMB_trans_tmo_offset
#define SMB_trans_msc_offset
#define SMB_trans_dbc_offset
#define SMB_hdr_err_offset
#define SMB_trans_tpc_offset
#define SMB_LMapi_UserPasswordSet
#define SMB_hdr_mid_offset
#define SMB_trans_dbo_offset
#define SMB_hdr_idf_offset
#define SMB_trans_mpc_offset
#define SMB_hdr_uid_offset
#define SMB_transr_pbo_offset
#define SMB_hdr_pid_offset
#define SMB_hdr_tid_offset
#define SMB_trans_tdc_offset
#define SMB_hdr_com_offset
#define SMB_trans_flg_offset