1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-21 20:23:50 +03:00

added rpcclient program

This commit is contained in:
Luke Leighton
-
parent 78b5c15121
commit aa38f39d67
23 changed files with 2856 additions and 89 deletions

View File

@@ -403,42 +403,20 @@ typedef struct cred_info
UTIME timestamp; /* credential time-stamp */
} DOM_CRED;
struct cli_state {
int fd;
int cnum;
int pid;
int mid;
int uid;
int protocol;
int sec_mode;
int rap_error;
int privilages;
fstring eff_name;
fstring desthost;
char cryptkey[8];
uint32 sesskey;
int serverzone;
uint32 servertime;
int readbraw_supported;
int writebraw_supported;
int timeout;
int max_xmit;
char *outbuf;
char *inbuf;
int bufsize;
int initialised;
/*
* Only used in NT domain calls.
*/
uint32 nt_error; /* NT RPC error code. */
uint16 nt_pipe_fnum; /* Pipe handle. */
unsigned char sess_key[16]; /* Current session key. */
DOM_CRED clnt_cred; /* Client credential. */
fstring mach_acct; /* MYNAME$. */
fstring srv_name_slash; /* \\remote server. */
fstring clnt_name_slash; /* \\local client. */
};
struct pwd_info
{
BOOL null_pwd;
BOOL cleartext;
BOOL crypted;
fstring password;
uchar smb_lm_pwd[16];
uchar smb_nt_pwd[16];
uchar smb_lm_owf[24];
uchar smb_nt_owf[24];
};
typedef struct
{
@@ -1601,6 +1579,161 @@ extern int unix_ERR_code;
__FILE__, __LINE__)), smb_panic("assert failed")))
#define SMB_ASSERT_ARRAY(a,n) SMB_ASSERT((sizeof(a)/sizeof((a)[0])) >= (n))
#include "ntdomain.h"
/* A netbios name structure. */
struct nmb_name {
char name[17];
char scope[64];
unsigned int name_type;
};
struct cli_state {
int fd;
int cnum;
int pid;
int mid;
int uid;
int protocol;
int sec_mode;
int rap_error;
int privilages;
fstring eff_name;
fstring desthost;
fstring user_name;
fstring domain;
fstring share;
fstring dev;
struct nmb_name called;
struct nmb_name calling;
fstring full_dest_host_name;
struct in_addr dest_ip;
struct pwd_info pwd;
char cryptkey[8];
uint32 sesskey;
int serverzone;
uint32 servertime;
int readbraw_supported;
int writebraw_supported;
int timeout;
int max_xmit;
char *outbuf;
char *inbuf;
int bufsize;
int initialised;
/*
* Only used in NT domain calls.
*/
uint32 nt_error; /* NT RPC error code. */
uint16 nt_pipe_fnum; /* Pipe handle. */
unsigned char sess_key[16]; /* Current session key. */
DOM_CRED clnt_cred; /* Client credential. */
fstring mach_acct; /* MYNAME$. */
fstring srv_name_slash; /* \\remote server. */
fstring clnt_name_slash; /* \\local client. */
};
struct acct_info
{
fstring acct_name; /* account name */
uint32 smb_userid; /* domain-relative RID */
};
struct nt_client_info
{
/************* \PIPE\NETLOGON stuff ******************/
fstring mach_acct;
uint8 sess_key[16];
DOM_CRED clnt_cred;
DOM_CRED rtn_cred;
NET_ID_INFO_CTR ctr;
NET_USER_INFO_3 user_info3;
/************** \PIPE\lsarpc stuff ********************/
POLICY_HND lsa_info_pol;
/* domain member */
fstring level3_dom;
fstring level3_sid;
/* domain controller */
fstring level5_dom;
fstring level5_sid;
/************** \PIPE\samr stuff ********************/
POLICY_HND samr_pol_connect;
POLICY_HND samr_pol_open_domain;
POLICY_HND samr_pol_open_user;
struct acct_info *sam;
int num_sam_entries;
};
struct tar_client_info
{
int blocksize;
BOOL inc;
BOOL reset;
BOOL excl;
char type;
int attrib;
char **cliplist;
int clipn;
int tp;
int num_files;
int buf_size;
int bytes_written;
char *buf;
int handle;
int print_mode;
char *file_mode;
};
struct client_info
{
struct in_addr dest_ip;
fstring dest_host;
fstring query_host;
uint8 name_type;
fstring myhostname;
fstring mach_acct;
pstring cur_dir;
pstring base_dir;
pstring file_sel;
fstring service;
fstring share;
fstring svc_type;
time_t newer_than;
int archive_level;
int dir_total;
int put_total_time_ms;
int put_total_size;
int get_total_time_ms;
int get_total_size;
int print_mode;
BOOL translation;
BOOL recurse_dir;
BOOL prompt;
BOOL lowercase;
BOOL abort_mget;
struct tar_client_info tar;
struct nt_client_info dom;
};
/*
* Size of new password account encoding string. DO NOT CHANGE.
*/
@@ -1609,6 +1742,4 @@ extern int unix_ERR_code;
#endif /* _SMB_H */
#include "ntdomain.h"
/* _SMB_H */