summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>2000-03-06 05:13:26 +0000
committerLuke Leighton <lkcl@samba.org>2000-03-06 05:13:26 +0000
commita39a289a7d555ca2b81daa82ca5ed7ebf4933969 (patch)
treefbc011433b6c3a896e143d12ad69a01eb2de061e
parenta5c9742fc4df8019acc882c413008f97a31f1ccf (diff)
downloadsamba-a39a289a7d555ca2b81daa82ca5ed7ebf4933969.tar.gz
turns out that POLICY_HND actually contains an RPC_UUID. only found this
out by receiving little-endian DCE/RPC packets and sending big-endian DCE/RPC packets, of course the POLICY_HND was wrong...
-rw-r--r--source/include/lib_smb_proto.h136
-rw-r--r--source/include/proto.h1320
-rw-r--r--source/include/rpc_dce.h3
-rw-r--r--source/include/rpc_lsa.h2
-rw-r--r--source/include/rpc_misc.h5
-rw-r--r--source/include/rpc_parse_proto.h6
-rw-r--r--source/include/winbindd_proto.h560
-rw-r--r--source/lib/util_hnd.c27
-rw-r--r--source/libsmb/clientgen.c1
-rw-r--r--source/rpc_client/cli_eventlog.c2
-rw-r--r--source/rpc_client/cli_lsarpc.c16
-rw-r--r--source/rpc_client/cli_reg.c15
-rw-r--r--source/rpc_client/cli_samr.c15
-rw-r--r--source/rpc_client/cli_spoolss.c15
-rw-r--r--source/rpc_client/cli_svcctl.c15
-rw-r--r--source/rpc_parse/parse_lsa.c5
-rw-r--r--source/rpc_parse/parse_misc.c3
-rw-r--r--source/rpc_parse/parse_rpc.c40
-rw-r--r--source/rpc_parse/parse_spoolss.c69
19 files changed, 1097 insertions, 1158 deletions
diff --git a/source/include/lib_smb_proto.h b/source/include/lib_smb_proto.h
index 0a9a595805d..ede2cc101f8 100644
--- a/source/include/lib_smb_proto.h
+++ b/source/include/lib_smb_proto.h
@@ -23,74 +23,6 @@ void MD5Update(struct MD5Context *ctx, uchar const *buf, unsigned len);
void MD5Final(uchar digest[16], struct MD5Context *ctx);
void MD5Transform(uint32 buf[4], const uchar inext[64]);
-/*The following definitions come from lib/util_hnd.c */
-
-struct policy_cache *get_global_hnd_cache(void);
-struct policy_cache *init_policy_cache(int num_pol_hnds);
-void free_policy_cache(struct policy_cache *cache);
-BOOL policy_hnd_set_name(struct policy_cache *cache,
- POLICY_HND *hnd, const char *name);
-const char *policy_hnd_get_name(struct policy_cache *cache,
- const POLICY_HND *hnd);
-BOOL dup_policy_hnd(struct policy_cache *cache,
- POLICY_HND *hnd,
- const POLICY_HND *from);
-BOOL register_policy_hnd(struct policy_cache *cache,
- const vuser_key *key,
- POLICY_HND *hnd,
- uint32 access_mask);
-BOOL open_policy_hnd(struct policy_cache *cache,
- const vuser_key *key,
- POLICY_HND *hnd,
- uint32 access_mask);
-BOOL open_policy_hnd_link(struct policy_cache *cache,
- const POLICY_HND *parent_hnd,
- POLICY_HND *hnd,
- uint32 access_mask);
-int find_policy_by_hnd(struct policy_cache *cache, const POLICY_HND *hnd);
-BOOL set_policy_state(struct policy_cache *cache, POLICY_HND *hnd,
- void(*fn)(void*), void *dev);
-void *get_policy_state_info(struct policy_cache *cache, const POLICY_HND *hnd);
-BOOL policy_hnd_set_state_type(struct policy_cache *cache,
- POLICY_HND *hnd, int type);
-int policy_hnd_get_state_type(struct policy_cache *cache,
- const POLICY_HND *hnd);
-BOOL policy_hnd_check_state_type(struct policy_cache *cache,
- const POLICY_HND *hnd, int type);
-BOOL close_policy_hnd(struct policy_cache *cache, POLICY_HND *hnd);
-BOOL policy_link_key(struct policy_cache *cache, const POLICY_HND *hnd,
- POLICY_HND *to);
-const vuser_key *get_policy_vuser_key(struct policy_cache *cache,
- const POLICY_HND *hnd);
-BOOL pol_get_usr_sesskey(struct policy_cache *cache, const POLICY_HND *hnd,
- uchar usr_sess_key[16]);
-
-/*The following definitions come from lib/vuser.c */
-
-BOOL is_valid_user_struct(const vuser_key * key);
-user_struct *get_valid_user_struct(const vuser_key * key);
-void invalidate_vuid(vuser_key * key);
-BOOL validated_username(vuser_key * key, char *name, size_t len);
-uint16 create_vuid(pid_t pid,
- uid_t uid, gid_t gid,
- int n_groups, gid_t * groups,
- const char *unix_name,
- const char *requested_name,
- const char *real_name,
- BOOL guest, const NET_USER_INFO_3 * info3);
-uint16 register_vuid(pid_t pid, uid_t uid, gid_t gid,
- const char *unix_name,
- const char *requested_name,
- BOOL guest, const NET_USER_INFO_3 * info3);
-BOOL check_vuser_ok(struct uid_cache *cache, user_struct * vuser, int snum);
-
-/*The following definitions come from lib/vuser_db.c */
-
-BOOL tdb_delete_vuid( const vuser_key *uk);
-BOOL tdb_lookup_vuid( const vuser_key *uk, user_struct **usr);
-BOOL tdb_store_vuid( const vuser_key *uk, user_struct *usr);
-BOOL vuid_init_db(void);
-
/*The following definitions come from libsmb/clientgen.c */
int cli_set_port(struct cli_state *cli, int port);
@@ -308,6 +240,74 @@ BOOL smb_safe_err_msg(uint8 class, uint32 num, char *ret, size_t len);
BOOL smb_safe_errstr(char *inbuf, char *msg, size_t len);
char *smb_errstr(char *inbuf);
+/*The following definitions come from lib/util_hnd.c */
+
+struct policy_cache *get_global_hnd_cache(void);
+struct policy_cache *init_policy_cache(int num_pol_hnds);
+void free_policy_cache(struct policy_cache *cache);
+BOOL policy_hnd_set_name(struct policy_cache *cache,
+ POLICY_HND *hnd, const char *name);
+const char *policy_hnd_get_name(struct policy_cache *cache,
+ const POLICY_HND *hnd);
+BOOL dup_policy_hnd(struct policy_cache *cache,
+ POLICY_HND *hnd,
+ const POLICY_HND *from);
+BOOL register_policy_hnd(struct policy_cache *cache,
+ const vuser_key *key,
+ POLICY_HND *hnd,
+ uint32 access_mask);
+BOOL open_policy_hnd(struct policy_cache *cache,
+ const vuser_key *key,
+ POLICY_HND *hnd,
+ uint32 access_mask);
+BOOL open_policy_hnd_link(struct policy_cache *cache,
+ const POLICY_HND *parent_hnd,
+ POLICY_HND *hnd,
+ uint32 access_mask);
+int find_policy_by_hnd(struct policy_cache *cache, const POLICY_HND *hnd);
+BOOL set_policy_state(struct policy_cache *cache, POLICY_HND *hnd,
+ void(*fn)(void*), void *dev);
+void *get_policy_state_info(struct policy_cache *cache, const POLICY_HND *hnd);
+BOOL policy_hnd_set_state_type(struct policy_cache *cache,
+ POLICY_HND *hnd, int type);
+int policy_hnd_get_state_type(struct policy_cache *cache,
+ const POLICY_HND *hnd);
+BOOL policy_hnd_check_state_type(struct policy_cache *cache,
+ const POLICY_HND *hnd, int type);
+BOOL close_policy_hnd(struct policy_cache *cache, POLICY_HND *hnd);
+BOOL policy_link_key(struct policy_cache *cache, const POLICY_HND *hnd,
+ POLICY_HND *to);
+const vuser_key *get_policy_vuser_key(struct policy_cache *cache,
+ const POLICY_HND *hnd);
+BOOL pol_get_usr_sesskey(struct policy_cache *cache, const POLICY_HND *hnd,
+ uchar usr_sess_key[16]);
+
+/*The following definitions come from lib/vuser.c */
+
+BOOL is_valid_user_struct(const vuser_key * key);
+user_struct *get_valid_user_struct(const vuser_key * key);
+void invalidate_vuid(vuser_key * key);
+BOOL validated_username(vuser_key * key, char *name, size_t len);
+uint16 create_vuid(pid_t pid,
+ uid_t uid, gid_t gid,
+ int n_groups, gid_t * groups,
+ const char *unix_name,
+ const char *requested_name,
+ const char *real_name,
+ BOOL guest, const NET_USER_INFO_3 * info3);
+uint16 register_vuid(pid_t pid, uid_t uid, gid_t gid,
+ const char *unix_name,
+ const char *requested_name,
+ BOOL guest, const NET_USER_INFO_3 * info3);
+BOOL check_vuser_ok(struct uid_cache *cache, user_struct * vuser, int snum);
+
+/*The following definitions come from lib/vuser_db.c */
+
+BOOL tdb_delete_vuid( const vuser_key *uk);
+BOOL tdb_lookup_vuid( const vuser_key *uk, user_struct **usr);
+BOOL tdb_store_vuid( const vuser_key *uk, user_struct *usr);
+BOOL vuid_init_db(void);
+
/*The following definitions come from rpc_parse/parse_creds.c */
BOOL make_creds_unix(CREDS_UNIX *r_u, const char* user_name,
diff --git a/source/include/proto.h b/source/include/proto.h
index bf94f976a3b..abac275bcb2 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -388,10 +388,269 @@ void CatchChildLeaveStatus(void);
int vslprintf(char *str, int n, char *format, va_list ap);
+/*The following definitions come from libsmb/clientgen.c */
+
+int cli_set_port(struct cli_state *cli, int port);
+char *cli_errstr(struct cli_state *cli);
+void cli_safe_smb_errstr(struct cli_state *cli, char *msg, size_t len);
+BOOL get_safe_rap_errstr(int rap_error, char *err_msg, size_t msglen);
+void cli_safe_errstr(struct cli_state *cli, char *err_msg, size_t msglen);
+BOOL cli_send_trans(struct cli_state *cli, int trans,
+ char *name, int pipe_name_len,
+ int fid, int flags,
+ uint16 *setup, int lsetup, int msetup,
+ char *param, int lparam, int mparam,
+ char *data, int ldata, int mdata);
+BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len,
+ uint16 *setup, uint32 setup_count, uint32 max_setup_count,
+ char *params, uint32 param_count, uint32 max_param_count,
+ char *data, uint32 data_count, uint32 max_data_count,
+ char **rparam, uint32 *rparam_count,
+ char **rdata, uint32 *rdata_count);
+BOOL cli_api(struct cli_state *cli,
+ char *param, int prcnt, int mprcnt,
+ char *data, int drcnt, int mdrcnt,
+ char **rparam, int *rprcnt,
+ char **rdata, int *rdrcnt);
+BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
+BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, const char *));
+BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
+ void (*fn)(const char *, uint32, const char *));
+BOOL cli_session_setup_x(struct cli_state *cli,
+ char *user,
+ char *pass, int passlen,
+ char *ntpass, int ntpasslen,
+ char *user_domain);
+BOOL cli_session_setup(struct cli_state *cli,
+ char *myhostname, char *user,
+ char *pass, int passlen,
+ char *ntpass, int ntpasslen,
+ char *user_domain);
+BOOL cli_ulogoff(struct cli_state *cli);
+BOOL cli_send_tconX(struct cli_state *cli,
+ char *share, char *dev, char *pass, int passlen);
+BOOL cli_tdis(struct cli_state *cli);
+BOOL cli_rename(struct cli_state *cli, char *fname_src, char *fname_dst);
+BOOL cli_unlink(struct cli_state *cli, char *fname);
+BOOL cli_mkdir(struct cli_state *cli, char *dname);
+BOOL cli_rmdir(struct cli_state *cli, char *dname);
+int cli_nt_create(struct cli_state *cli, const char *fname);
+int cli_open(struct cli_state *cli, const char *fname,
+ int flags, int share_mode);
+BOOL cli_close(struct cli_state *cli, int fnum);
+BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
+BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
+size_t cli_read_one(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size);
+size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size, BOOL overlap);
+ssize_t cli_write(struct cli_state *cli,
+ int fnum, uint16 write_mode,
+ char *buf, off_t offset, size_t size, size_t bytes_left);
+BOOL cli_getattrE(struct cli_state *cli, int fd,
+ uint16 *attr, size_t *size,
+ time_t *c_time, time_t *a_time, time_t *m_time);
+BOOL cli_getatr(struct cli_state *cli, char *fname,
+ uint16 *attr, size_t *size, time_t *t);
+BOOL cli_setatr(struct cli_state *cli, char *fname, uint16 attr, time_t t);
+BOOL cli_qpathinfo(struct cli_state *cli, const char *fname,
+ time_t *c_time, time_t *a_time, time_t *m_time,
+ size_t *size, uint16 *mode);
+BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname,
+ time_t *c_time, time_t *a_time, time_t *m_time,
+ time_t *w_time, size_t *size, uint16 *mode,
+ SMB_INO_T *ino);
+BOOL cli_qfileinfo(struct cli_state *cli, int fnum,
+ uint16 *mode, size_t *size,
+ time_t *c_time, time_t *a_time, time_t *m_time,
+ time_t *w_time, SMB_INO_T *ino);
+int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
+ void (*fn)(file_info *, const char *));
+BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
+ const char *old_password);
+BOOL cli_negprot(struct cli_state *cli);
+BOOL cli_session_request(struct cli_state *cli,
+ struct nmb_name *calling, struct nmb_name *called);
+BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip);
+void cli_init_creds(struct cli_state *cli, const struct ntuser_creds *usr);
+struct cli_state *cli_initialise(struct cli_state *cli);
+void cli_close_socket(struct cli_state *cli);
+void cli_shutdown(struct cli_state *cli);
+int cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num);
+void cli_sockopt(struct cli_state *cli, char *options);
+uint16 cli_setpid(struct cli_state *cli, uint16 pid);
+BOOL cli_reestablish_connection(struct cli_state *cli);
+BOOL cli_establish_connection(struct cli_state *cli,
+ const char *dest_host, struct in_addr *dest_ip,
+ struct nmb_name *calling, struct nmb_name *called,
+ char *service, char *service_type,
+ BOOL do_shutdown, BOOL do_tcon);
+BOOL cli_connect_auth(struct cli_state *cli,
+ const char* desthost,
+ struct in_addr *dest_ip,
+ const struct ntuser_creds *usr);
+BOOL cli_connect_servers_auth(struct cli_state *cli,
+ char *p,
+ const struct ntuser_creds *usr);
+BOOL cli_connect_serverlist(struct cli_state *cli, char *p);
+int cli_printjob_del(struct cli_state *cli, int job);
+int cli_print_queue(struct cli_state *cli,
+ void (*fn)(struct print_job_info *));
+BOOL cli_chkpath(struct cli_state *cli, char *path);
+BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
+ int *grp);
+BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp);
+BOOL cli_message_end(struct cli_state *cli, int grp);
+BOOL cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
+BOOL get_any_dc_name(const char *domain, char *srv_name);
+
+/*The following definitions come from libsmb/credentials.c */
+
+char *credstr(const uchar *cred);
+void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, const char *pass,
+ uchar session_key[8]);
+void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp,
+ DOM_CHAL *cred);
+int cred_assert(const DOM_CHAL *cred, uchar session_key[8],
+ DOM_CHAL *stored_cred, UTIME timestamp);
+BOOL clnt_deal_with_creds(uchar sess_key[8],
+ DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred);
+BOOL deal_with_creds(uchar sess_key[8],
+ DOM_CRED *sto_clnt_cred,
+ const DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred);
+
+/*The following definitions come from libsmb/namequery.c */
+
+BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
+ struct in_addr to_ip,char *master,char *rname,
+ void (*fn)(struct packet_struct *));
+struct in_addr *name_query(int fd,const char *name,int name_type, BOOL bcast,BOOL recurse,
+ struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *));
+FILE *startlmhosts(char *fname);
+BOOL getlmhostsent( FILE *fp, pstring name, int *name_type, struct in_addr *ipaddr);
+void endlmhosts(FILE *fp);
+BOOL is_ip_address(const char *name);
+BOOL resolve_name(const char *name, struct in_addr *return_ip, int name_type);
+BOOL resolve_srv_name(const char* srv_name, fstring dest_host,
+ struct in_addr *ip);
+BOOL find_master_ip(char *group, struct in_addr *master_ip);
+
+/*The following definitions come from libsmb/nmblib.c */
+
+void debug_nmb_packet(struct packet_struct *p);
+char *nmb_namestr(struct nmb_name *n);
+void nmb_safe_namestr(struct nmb_name *n, char *str, size_t len);
+struct packet_struct *copy_packet(struct packet_struct *packet);
+void free_packet(struct packet_struct *packet);
+struct packet_struct *read_packet(int fd,enum packet_type packet_type);
+void make_nmb_name( struct nmb_name *n, const char *name, int type, const char *this_scope );
+BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
+BOOL send_packet(struct packet_struct *p);
+struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
+void sort_query_replies(char *data, int n, struct in_addr ip);
+BOOL read_nmb_sock(int c, struct nmb_state *con);
+int get_nmb_sock(void);
+char *dns_to_netbios_name(char *dns_name);
+int name_mangle( char *In, char *Out, char name_type );
+int name_extract(char *buf,int ofs,char *name);
+int name_len(char *s1);
+
+/*The following definitions come from libsmb/nterr.c */
+
+BOOL get_safe_nt_error_msg(uint32 nt_code, char *msg, size_t len);
+const char *get_nt_error_msg(uint32 nt_code);
+
+/*The following definitions come from libsmb/passchange.c */
+
+BOOL remote_password_change(const char *remote_machine, const char *user_name,
+ const char *old_passwd, const char *new_passwd,
+ char *err_str, size_t err_str_len);
+
+/*The following definitions come from libsmb/pwd_cache.c */
+
+void pwd_init(struct pwd_info *pwd);
+BOOL pwd_is_nullpwd(const struct pwd_info *pwd);
+void pwd_obfuscate_key(struct pwd_info *pwd, uint32 int_key, char *str_key);
+BOOL pwd_compare(const struct pwd_info *_pwd1, const struct pwd_info *_pwd2);
+void pwd_read(struct pwd_info *pwd, char *passwd_report, BOOL do_encrypt);
+void pwd_set_nullpwd(struct pwd_info *pwd);
+void pwd_set_cleartext(struct pwd_info *pwd, char *clr);
+void pwd_get_cleartext(struct pwd_info *pwd, char *clr);
+void pwd_set_lm_nt_16(struct pwd_info *pwd,
+ const uchar lm_pwd[16],
+ const uchar nt_pwd[16]);
+void pwd_get_lm_nt_16(const struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]);
+void pwd_make_lm_nt_16(struct pwd_info *pwd, char *clr);
+void pwd_make_lm_nt_owf2(struct pwd_info *pwd, const uchar srv_key[8],
+ const char *user, const char *server, const char *domain,
+ uchar sess_key[16]);
+void pwd_make_lm_nt_owf(struct pwd_info *pwd, uchar cryptkey[8],
+ uchar sess_key[16]);
+void pwd_get_lm_nt_owf(struct pwd_info *pwd, uchar lm_owf[24],
+ uchar *nt_owf, size_t *nt_owf_len);
+
/*The following definitions come from lib/smbrun.c */
int smbrun(char *cmd,char *outfile,BOOL shared);
+/*The following definitions come from libsmb/smbdes.c */
+
+void smbhash(uchar *out, const uchar *in, const uchar *key, int forw);
+void E_P16(uchar *p14,uchar *p16);
+void E_P24(const uchar *p21, const uchar *c8, uchar *p24);
+void D_P16(const uchar *p14, const uchar *in, uchar *out);
+void E_old_pw_hash( const uchar *p14, const uchar *in, uchar *out);
+void cred_hash1(uchar *out, const uchar *in, const uchar *key);
+void cred_hash2(uchar *out,uchar *in,uchar *key);
+void cred_hash3(uchar *out, const uchar *in,uchar *key, int forw);
+void SamOEMhash( uchar *data, const uchar *key, int val);
+void sam_pwd_hash(uint32 rid, const uchar *in, uchar *out, int forw);
+
+/*The following definitions come from libsmb/smbencrypt.c */
+
+void SMBencrypt(uchar * pwrd, uchar * c8, uchar * p24);
+void SMBNTencrypt(uchar * pwrd, uchar * c8, uchar * p24);
+void E_md4hash(uchar * pwrd, uchar * p16);
+void lm_owf_genW(const UNISTR2 * pwd, uchar p16[16]);
+void lm_owf_gen(const char *pwd, uchar p16[16]);
+void nt_owf_genW(const UNISTR2 * pwd, uchar nt_p16[16]);
+void nt_owf_gen(const char *pwd, uchar nt_p16[16]);
+void nt_lm_owf_genW(const UNISTR2 * pwd, uchar nt_p16[16], uchar lm_p16[16]);
+void nt_lm_owf_gen(const char *pwd, uchar nt_p16[16], uchar lm_p16[16]);
+void SMBOWFencrypt(const uchar pwrd[16], const uchar * c8, uchar p24[24]);
+void SMBOWFencrypt_ntv2(const uchar kr[16],
+ const uchar * srv_chal, int srv_chal_len,
+ const uchar * cli_chal, int cli_chal_len,
+ char resp_buf[16]);
+void SMBsesskeygen_ntv2(const uchar kr[16],
+ const uchar * nt_resp, char sess_key[16]);
+void SMBsesskeygen_ntv1(const uchar kr[16],
+ const uchar * nt_resp, char sess_key[16]);
+void SMBgenclientchals(char *lm_cli_chal,
+ char *nt_cli_chal, int *nt_cli_chal_len,
+ const char *srv, const char *dom);
+void ntv2_owf_gen(const uchar owf[16],
+ const char *user_n, const char *domain_n, uchar kr_buf[16]);
+void NTLMSSPOWFencrypt(const uchar pwrd[8], const uchar * ntlmchalresp,
+ uchar p24[24]);
+BOOL make_oem_passwd_hash(uchar data[516],
+ const char *pwrd, int new_pw_len,
+ const uchar old_pw_hash[16], BOOL unicode);
+BOOL nt_encrypt_string2(STRING2 * out, const STRING2 * in, const uchar * key);
+BOOL nt_decrypt_string2(STRING2 * out, const STRING2 * in, const uchar * key);
+void create_ntlmssp_resp(struct pwd_info *pwd,
+ char *domain, char *user_name, char *my_name,
+ uint32 ntlmssp_cli_flgs, prs_struct * auth_resp);
+BOOL decode_pw_buffer(const char buffer[516], char *new_pwrd,
+ int new_pwrd_size, uint32 * new_pw_len);
+BOOL encode_pw_buffer(char buffer[516], const char *new_pass,
+ int new_pw_len, BOOL nt_pass_set);
+
+/*The following definitions come from libsmb/smberr.c */
+
+char *smb_err_msg(uint8 class, uint32 num);
+BOOL smb_safe_err_msg(uint8 class, uint32 num, char *ret, size_t len);
+BOOL smb_safe_errstr(char *inbuf, char *msg, size_t len);
+char *smb_errstr(char *inbuf);
+
/*The following definitions come from lib/snprintf.c */
@@ -401,11 +660,6 @@ void become_root(BOOL save_dir);
void unbecome_root(BOOL restore_dir);
const vuser_key *get_sec_ctx(void);
-/*The following definitions come from lib/surs.c */
-
-BOOL surs_sam_sid_to_unixid(DOM_SID *sid, uint32 type, uint32 *id, BOOL create);
-BOOL surs_unixid_to_sam_sid(uint32 id, uint32 type, DOM_SID *sid, BOOL create);
-
/*The following definitions come from lib/sursalgdomonly.c */
BOOL surs_algdomonly_sam_sid_to_unixid(DOM_SID *sid, uint32 type, uint32 *id,
@@ -420,6 +674,11 @@ BOOL surs_nt5ldap_sam_sid_to_unixid(LDAPDB *hds, DOM_SID * sid, uint32 type,
BOOL surs_nt5ldap_unixid_to_sam_sid(LDAPDB *hds, uint32 id, uint32 type,
DOM_SID * sid, BOOL create);
+/*The following definitions come from lib/surs.c */
+
+BOOL surs_sam_sid_to_unixid(DOM_SID *sid, uint32 type, uint32 *id, BOOL create);
+BOOL surs_unixid_to_sam_sid(uint32 id, uint32 type, DOM_SID *sid, BOOL create);
+
/*The following definitions come from lib/surstdb.c */
BOOL surs_tdb_sam_sid_to_unixid(DOM_SID * sid, uint32 type, uint32 * id,
@@ -492,6 +751,25 @@ const struct passwd *Get_Pwnam(char *user,BOOL allow_change);
BOOL user_ok(char *user,int snum);
BOOL user_in_list(char *user,char *list);
+/*The following definitions come from lib/util_array.c */
+
+void free_void_array(uint32 num_entries, void **entries,
+ void(free_item)(void*));
+void* add_copy_to_array(uint32 *len, void ***array, const void *item,
+ void*(item_dup)(const void*), BOOL alloc_anyway);
+void* add_item_to_array(uint32 *len, void ***array, void *item);
+void free_use_info_array(uint32 num_entries, struct use_info **entries);
+struct use_info* add_use_info_to_array(uint32 *len, struct use_info ***array,
+ const struct use_info *name);
+void free_char_array(uint32 num_entries, char **entries);
+char* add_chars_to_array(uint32 *len, char ***array, const char *name);
+void free_uint32_array(uint32 num_entries, uint32 **entries);
+uint32* add_uint32s_to_array(uint32 *len, uint32 ***array, const uint32 *name);
+void free_unistr_array(uint32 num_entries, UNISTR2 **entries);
+UNISTR2* add_unistr_to_array(uint32 *len, UNISTR2 ***array, UNISTR2 *name);
+void free_sid_array(uint32 num_entries, DOM_SID **entries);
+DOM_SID* add_sid_to_array(uint32 *len, DOM_SID ***array, const DOM_SID *sid);
+
/*The following definitions come from lib/util.c */
BOOL init_myworkgroup(void);
@@ -599,25 +877,6 @@ char *passdb_path(char *name);
char *lock_path(char *name);
const char *get_sid_name_use_str(uint32 sid_name_use);
-/*The following definitions come from lib/util_array.c */
-
-void free_void_array(uint32 num_entries, void **entries,
- void(free_item)(void*));
-void* add_copy_to_array(uint32 *len, void ***array, const void *item,
- void*(item_dup)(const void*), BOOL alloc_anyway);
-void* add_item_to_array(uint32 *len, void ***array, void *item);
-void free_use_info_array(uint32 num_entries, struct use_info **entries);
-struct use_info* add_use_info_to_array(uint32 *len, struct use_info ***array,
- const struct use_info *name);
-void free_char_array(uint32 num_entries, char **entries);
-char* add_chars_to_array(uint32 *len, char ***array, const char *name);
-void free_uint32_array(uint32 num_entries, uint32 **entries);
-uint32* add_uint32s_to_array(uint32 *len, uint32 ***array, const uint32 *name);
-void free_unistr_array(uint32 num_entries, UNISTR2 **entries);
-UNISTR2* add_unistr_to_array(uint32 *len, UNISTR2 ***array, UNISTR2 *name);
-void free_sid_array(uint32 num_entries, DOM_SID **entries);
-DOM_SID* add_sid_to_array(uint32 *len, DOM_SID ***array, const DOM_SID *sid);
-
/*The following definitions come from lib/util_file.c */
BOOL do_file_lock(int fd, int waitsecs, int type);
@@ -851,265 +1110,6 @@ BOOL tdb_lookup_vuid( const vuser_key *uk, user_struct **usr);
BOOL tdb_store_vuid( const vuser_key *uk, user_struct *usr);
BOOL vuid_init_db(void);
-/*The following definitions come from libsmb/clientgen.c */
-
-int cli_set_port(struct cli_state *cli, int port);
-char *cli_errstr(struct cli_state *cli);
-void cli_safe_smb_errstr(struct cli_state *cli, char *msg, size_t len);
-BOOL get_safe_rap_errstr(int rap_error, char *err_msg, size_t msglen);
-void cli_safe_errstr(struct cli_state *cli, char *err_msg, size_t msglen);
-BOOL cli_send_trans(struct cli_state *cli, int trans,
- char *name, int pipe_name_len,
- int fid, int flags,
- uint16 *setup, int lsetup, int msetup,
- char *param, int lparam, int mparam,
- char *data, int ldata, int mdata);
-BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len,
- uint16 *setup, uint32 setup_count, uint32 max_setup_count,
- char *params, uint32 param_count, uint32 max_param_count,
- char *data, uint32 data_count, uint32 max_data_count,
- char **rparam, uint32 *rparam_count,
- char **rdata, uint32 *rdata_count);
-BOOL cli_api(struct cli_state *cli,
- char *param, int prcnt, int mprcnt,
- char *data, int drcnt, int mdrcnt,
- char **rparam, int *rprcnt,
- char **rdata, int *rdrcnt);
-BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
-BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, const char *));
-BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
- void (*fn)(const char *, uint32, const char *));
-BOOL cli_session_setup_x(struct cli_state *cli,
- char *user,
- char *pass, int passlen,
- char *ntpass, int ntpasslen,
- char *user_domain);
-BOOL cli_session_setup(struct cli_state *cli,
- char *myhostname, char *user,
- char *pass, int passlen,
- char *ntpass, int ntpasslen,
- char *user_domain);
-BOOL cli_ulogoff(struct cli_state *cli);
-BOOL cli_send_tconX(struct cli_state *cli,
- char *share, char *dev, char *pass, int passlen);
-BOOL cli_tdis(struct cli_state *cli);
-BOOL cli_rename(struct cli_state *cli, char *fname_src, char *fname_dst);
-BOOL cli_unlink(struct cli_state *cli, char *fname);
-BOOL cli_mkdir(struct cli_state *cli, char *dname);
-BOOL cli_rmdir(struct cli_state *cli, char *dname);
-int cli_nt_create(struct cli_state *cli, const char *fname);
-int cli_open(struct cli_state *cli, const char *fname,
- int flags, int share_mode);
-BOOL cli_close(struct cli_state *cli, int fnum);
-BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
-BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
-size_t cli_read_one(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size);
-size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size, BOOL overlap);
-ssize_t cli_write(struct cli_state *cli,
- int fnum, uint16 write_mode,
- char *buf, off_t offset, size_t size, size_t bytes_left);
-BOOL cli_getattrE(struct cli_state *cli, int fd,
- uint16 *attr, size_t *size,
- time_t *c_time, time_t *a_time, time_t *m_time);
-BOOL cli_getatr(struct cli_state *cli, char *fname,
- uint16 *attr, size_t *size, time_t *t);
-BOOL cli_setatr(struct cli_state *cli, char *fname, uint16 attr, time_t t);
-BOOL cli_qpathinfo(struct cli_state *cli, const char *fname,
- time_t *c_time, time_t *a_time, time_t *m_time,
- size_t *size, uint16 *mode);
-BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname,
- time_t *c_time, time_t *a_time, time_t *m_time,
- time_t *w_time, size_t *size, uint16 *mode,
- SMB_INO_T *ino);
-BOOL cli_qfileinfo(struct cli_state *cli, int fnum,
- uint16 *mode, size_t *size,
- time_t *c_time, time_t *a_time, time_t *m_time,
- time_t *w_time, SMB_INO_T *ino);
-int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(file_info *, const char *));
-BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
- const char *old_password);
-BOOL cli_negprot(struct cli_state *cli);
-BOOL cli_session_request(struct cli_state *cli,
- struct nmb_name *calling, struct nmb_name *called);
-BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip);
-void cli_init_creds(struct cli_state *cli, const struct ntuser_creds *usr);
-struct cli_state *cli_initialise(struct cli_state *cli);
-void cli_close_socket(struct cli_state *cli);
-void cli_shutdown(struct cli_state *cli);
-int cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num);
-void cli_sockopt(struct cli_state *cli, char *options);
-uint16 cli_setpid(struct cli_state *cli, uint16 pid);
-BOOL cli_reestablish_connection(struct cli_state *cli);
-BOOL cli_establish_connection(struct cli_state *cli,
- const char *dest_host, struct in_addr *dest_ip,
- struct nmb_name *calling, struct nmb_name *called,
- char *service, char *service_type,
- BOOL do_shutdown, BOOL do_tcon);
-BOOL cli_connect_auth(struct cli_state *cli,
- const char* desthost,
- struct in_addr *dest_ip,
- const struct ntuser_creds *usr);
-BOOL cli_connect_servers_auth(struct cli_state *cli,
- char *p,
- const struct ntuser_creds *usr);
-BOOL cli_connect_serverlist(struct cli_state *cli, char *p);
-int cli_printjob_del(struct cli_state *cli, int job);
-int cli_print_queue(struct cli_state *cli,
- void (*fn)(struct print_job_info *));
-BOOL cli_chkpath(struct cli_state *cli, char *path);
-BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
- int *grp);
-BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp);
-BOOL cli_message_end(struct cli_state *cli, int grp);
-BOOL cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
-BOOL get_any_dc_name(const char *domain, char *srv_name);
-
-/*The following definitions come from libsmb/credentials.c */
-
-char *credstr(const uchar *cred);
-void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, const char *pass,
- uchar session_key[8]);
-void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp,
- DOM_CHAL *cred);
-int cred_assert(const DOM_CHAL *cred, uchar session_key[8],
- DOM_CHAL *stored_cred, UTIME timestamp);
-BOOL clnt_deal_with_creds(uchar sess_key[8],
- DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred);
-BOOL deal_with_creds(uchar sess_key[8],
- DOM_CRED *sto_clnt_cred,
- const DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred);
-
-/*The following definitions come from libsmb/namequery.c */
-
-BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
- struct in_addr to_ip,char *master,char *rname,
- void (*fn)(struct packet_struct *));
-struct in_addr *name_query(int fd,const char *name,int name_type, BOOL bcast,BOOL recurse,
- struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *));
-FILE *startlmhosts(char *fname);
-BOOL getlmhostsent( FILE *fp, pstring name, int *name_type, struct in_addr *ipaddr);
-void endlmhosts(FILE *fp);
-BOOL is_ip_address(const char *name);
-BOOL resolve_name(const char *name, struct in_addr *return_ip, int name_type);
-BOOL resolve_srv_name(const char* srv_name, fstring dest_host,
- struct in_addr *ip);
-BOOL find_master_ip(char *group, struct in_addr *master_ip);
-
-/*The following definitions come from libsmb/nmblib.c */
-
-void debug_nmb_packet(struct packet_struct *p);
-char *nmb_namestr(struct nmb_name *n);
-void nmb_safe_namestr(struct nmb_name *n, char *str, size_t len);
-struct packet_struct *copy_packet(struct packet_struct *packet);
-void free_packet(struct packet_struct *packet);
-struct packet_struct *read_packet(int fd,enum packet_type packet_type);
-void make_nmb_name( struct nmb_name *n, const char *name, int type, const char *this_scope );
-BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
-BOOL send_packet(struct packet_struct *p);
-struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
-void sort_query_replies(char *data, int n, struct in_addr ip);
-BOOL read_nmb_sock(int c, struct nmb_state *con);
-int get_nmb_sock(void);
-char *dns_to_netbios_name(char *dns_name);
-int name_mangle( char *In, char *Out, char name_type );
-int name_extract(char *buf,int ofs,char *name);
-int name_len(char *s1);
-
-/*The following definitions come from libsmb/nterr.c */
-
-BOOL get_safe_nt_error_msg(uint32 nt_code, char *msg, size_t len);
-const char *get_nt_error_msg(uint32 nt_code);
-
-/*The following definitions come from libsmb/passchange.c */
-
-BOOL remote_password_change(const char *remote_machine, const char *user_name,
- const char *old_passwd, const char *new_passwd,
- char *err_str, size_t err_str_len);
-
-/*The following definitions come from libsmb/pwd_cache.c */
-
-void pwd_init(struct pwd_info *pwd);
-BOOL pwd_is_nullpwd(const struct pwd_info *pwd);
-void pwd_obfuscate_key(struct pwd_info *pwd, uint32 int_key, char *str_key);
-BOOL pwd_compare(const struct pwd_info *_pwd1, const struct pwd_info *_pwd2);
-void pwd_read(struct pwd_info *pwd, char *passwd_report, BOOL do_encrypt);
-void pwd_set_nullpwd(struct pwd_info *pwd);
-void pwd_set_cleartext(struct pwd_info *pwd, char *clr);
-void pwd_get_cleartext(struct pwd_info *pwd, char *clr);
-void pwd_set_lm_nt_16(struct pwd_info *pwd,
- const uchar lm_pwd[16],
- const uchar nt_pwd[16]);
-void pwd_get_lm_nt_16(const struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]);
-void pwd_make_lm_nt_16(struct pwd_info *pwd, char *clr);
-void pwd_make_lm_nt_owf2(struct pwd_info *pwd, const uchar srv_key[8],
- const char *user, const char *server, const char *domain,
- uchar sess_key[16]);
-void pwd_make_lm_nt_owf(struct pwd_info *pwd, uchar cryptkey[8],
- uchar sess_key[16]);
-void pwd_get_lm_nt_owf(struct pwd_info *pwd, uchar lm_owf[24],
- uchar *nt_owf, size_t *nt_owf_len);
-
-/*The following definitions come from libsmb/smbdes.c */
-
-void smbhash(uchar *out, const uchar *in, const uchar *key, int forw);
-void E_P16(uchar *p14,uchar *p16);
-void E_P24(const uchar *p21, const uchar *c8, uchar *p24);
-void D_P16(const uchar *p14, const uchar *in, uchar *out);
-void E_old_pw_hash( const uchar *p14, const uchar *in, uchar *out);
-void cred_hash1(uchar *out, const uchar *in, const uchar *key);
-void cred_hash2(uchar *out,uchar *in,uchar *key);
-void cred_hash3(uchar *out, const uchar *in,uchar *key, int forw);
-void SamOEMhash( uchar *data, const uchar *key, int val);
-void sam_pwd_hash(uint32 rid, const uchar *in, uchar *out, int forw);
-
-/*The following definitions come from libsmb/smbencrypt.c */
-
-void SMBencrypt(uchar * pwrd, uchar * c8, uchar * p24);
-void SMBNTencrypt(uchar * pwrd, uchar * c8, uchar * p24);
-void E_md4hash(uchar * pwrd, uchar * p16);
-void lm_owf_genW(const UNISTR2 * pwd, uchar p16[16]);
-void lm_owf_gen(const char *pwd, uchar p16[16]);
-void nt_owf_genW(const UNISTR2 * pwd, uchar nt_p16[16]);
-void nt_owf_gen(const char *pwd, uchar nt_p16[16]);
-void nt_lm_owf_genW(const UNISTR2 * pwd, uchar nt_p16[16], uchar lm_p16[16]);
-void nt_lm_owf_gen(const char *pwd, uchar nt_p16[16], uchar lm_p16[16]);
-void SMBOWFencrypt(const uchar pwrd[16], const uchar * c8, uchar p24[24]);
-void SMBOWFencrypt_ntv2(const uchar kr[16],
- const uchar * srv_chal, int srv_chal_len,
- const uchar * cli_chal, int cli_chal_len,
- char resp_buf[16]);
-void SMBsesskeygen_ntv2(const uchar kr[16],
- const uchar * nt_resp, char sess_key[16]);
-void SMBsesskeygen_ntv1(const uchar kr[16],
- const uchar * nt_resp, char sess_key[16]);
-void SMBgenclientchals(char *lm_cli_chal,
- char *nt_cli_chal, int *nt_cli_chal_len,
- const char *srv, const char *dom);
-void ntv2_owf_gen(const uchar owf[16],
- const char *user_n, const char *domain_n, uchar kr_buf[16]);
-void NTLMSSPOWFencrypt(const uchar pwrd[8], const uchar * ntlmchalresp,
- uchar p24[24]);
-BOOL make_oem_passwd_hash(uchar data[516],
- const char *pwrd, int new_pw_len,
- const uchar old_pw_hash[16], BOOL unicode);
-BOOL nt_encrypt_string2(STRING2 * out, const STRING2 * in, const uchar * key);
-BOOL nt_decrypt_string2(STRING2 * out, const STRING2 * in, const uchar * key);
-void create_ntlmssp_resp(struct pwd_info *pwd,
- char *domain, char *user_name, char *my_name,
- uint32 ntlmssp_cli_flgs, prs_struct * auth_resp);
-BOOL decode_pw_buffer(const char buffer[516], char *new_pwrd,
- int new_pwrd_size, uint32 * new_pw_len);
-BOOL encode_pw_buffer(char buffer[516], const char *new_pass,
- int new_pw_len, BOOL nt_pass_set);
-
-/*The following definitions come from libsmb/smberr.c */
-
-char *smb_err_msg(uint8 class, uint32 num);
-BOOL smb_safe_err_msg(uint8 class, uint32 num, char *ret, size_t len);
-BOOL smb_safe_errstr(char *inbuf, char *msg, size_t len);
-char *smb_errstr(char *inbuf);
-
/*The following definitions come from locking/locking.c */
BOOL is_locked(files_struct *fsp,connection_struct *conn,
@@ -1268,9 +1268,6 @@ BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
struct name_record **n);
void kill_async_dns_child(void);
-/*The following definitions come from nmbd/nmbd.c */
-
-
/*The following definitions come from nmbd/nmbd_become_dmb.c */
void add_domain_names(time_t t);
@@ -1301,6 +1298,9 @@ void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec,
void collect_all_workgroup_names_from_wins_server(time_t t);
void sync_all_dmbs(time_t t);
+/*The following definitions come from nmbd/nmbd.c */
+
+
/*The following definitions come from nmbd/nmbd_elections.c */
void check_master_browser_exists(time_t t);
@@ -2060,11 +2060,6 @@ void init_devicemode(NT_DEVICEMODE *nt_devmode);
BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname);
void pcap_printer_fn(void (*fn)(char *, char *));
-/*The following definitions come from printing/print_svid.c */
-
-void sysv_printer_fn(void (*fn)(char *, char *));
-int sysv_printername_ok(char *name);
-
/*The following definitions come from printing/printing.c */
void lpq_reset(int snum);
@@ -2083,6 +2078,11 @@ uint32 status_printqueue(connection_struct *conn,const vuser_key *key,
int snum,int status);
void load_printers(void);
+/*The following definitions come from printing/print_svid.c */
+
+void sysv_printer_fn(void (*fn)(char *, char *));
+int sysv_printername_ok(char *name);
+
/*The following definitions come from profile/profile.c */
BOOL profile_setup(BOOL rdonly);
@@ -2552,6 +2552,315 @@ void cli_use_wait_keyboard(void);
BOOL wks_query_info( char *srv_name, uint32 switch_value,
WKS_INFO_100 *wks100);
+/*The following definitions come from rpcclient/cmdat.c */
+
+
+/*The following definitions come from rpcclient/cmdat_cmds.c */
+
+void add_at_commands(void);
+
+/*The following definitions come from rpcclient/cmd_atsvc.c */
+
+void cmd_at(struct client_info *info, int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/cmd_brs.c */
+
+void cmd_brs_query_info(struct client_info *info, int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/cmd_eventlog.c */
+
+void cmd_eventlog(struct client_info *info, int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/cmd_lsarpc.c */
+
+void cmd_lsa_enum_trust_dom(struct client_info *info, int argc, char *argv[]);
+void cmd_lsa_query_info(struct client_info *info, int argc, char *argv[]);
+void cmd_lsa_lookup_names(struct client_info *info, int argc, char *argv[]);
+void cmd_lsa_lookup_sids(struct client_info *info, int argc, char *argv[]);
+void cmd_lsa_set_secret(struct client_info *info, int argc, char *argv[]);
+void cmd_lsa_create_secret(struct client_info *info, int argc, char *argv[]);
+void cmd_lsa_query_secret_secobj(struct client_info *info, int argc, char *argv[]);
+void cmd_lsa_query_secret(struct client_info *info, int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/cmd_netlogon.c */
+
+void cmd_netlogon_login_test(struct client_info *info, int argc, char *argv[]);
+void cmd_netlogon_domain_test(struct client_info *info, int argc,
+ char *argv[]);
+void cmd_sam_sync(struct client_info *info, int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/cmd_reg.c */
+
+void split_server_keyname(char *srv_name, char *key, const char* arg);
+BOOL msrpc_reg_enum_key(const char* srv_name, const char* full_keyname,
+ REG_FN(reg_fn),
+ REG_KEY_FN(reg_key_fn),
+ REG_VAL_FN(reg_val_fn));
+void cmd_reg_enum(struct client_info *info, int argc, char *argv[]);
+void cmd_reg_query_info(struct client_info *info, int argc, char *argv[]);
+void cmd_reg_query_key(struct client_info *info, int argc, char *argv[]);
+void cmd_reg_create_val(struct client_info *info, int argc, char *argv[]);
+void cmd_reg_delete_val(struct client_info *info, int argc, char *argv[]);
+void cmd_reg_delete_key(struct client_info *info, int argc, char *argv[]);
+void cmd_reg_create_key(struct client_info *info, int argc, char *argv[]);
+void cmd_reg_test_key_sec(struct client_info *info, int argc, char *argv[]);
+void cmd_reg_get_key_sec(struct client_info *info, int argc, char *argv[]);
+void cmd_reg_shutdown(struct client_info *info, int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/cmd_samr.c */
+
+void cmd_sam_ntchange_pwd(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_test(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_lookup_domain(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_lookup_names(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_lookup_rids(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_del_aliasmem(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_delete_dom_alias(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_add_aliasmem(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_create_dom_trusting(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_create_dom_user(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_create_dom_alias(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_del_groupmem(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_delete_dom_user(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_delete_dom_group(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_add_groupmem(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_create_dom_group(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_enum_users(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_query_groupmem(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_query_group(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_query_sec_obj(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_query_user(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_set_userinfo2(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_set_userinfo(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_query_dispinfo(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_query_dominfo(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_query_aliasmem(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_query_alias(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_enum_aliases(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_enum_groups(struct client_info *info, int argc, char *argv[]);
+void cmd_sam_enum_domains(struct client_info *info, int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/cmd_spoolss.c */
+
+BOOL msrpc_spoolss_enum_printers( const char* srv_name,
+ uint32 level,
+ uint32 *num,
+ void ***ctr,
+ PRINT_INFO_FN(fn));
+void cmd_spoolss_enum_printers(struct client_info *info, int argc, char *argv[]);
+void cmd_spoolss_open_printer_ex(struct client_info *info, int argc, char *argv[]);
+BOOL msrpc_spoolss_enum_jobs( const char* printer_name,
+ const char* station, const char* user_name,
+ uint32 level,
+ uint32 *num,
+ void ***ctr,
+ JOB_INFO_FN(fn));
+void cmd_spoolss_enum_jobs(struct client_info *info, int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/cmd_srvsvc.c */
+
+BOOL net_srv_get_info(struct client_info *info,
+ uint32 info_level,
+ SRV_INFO_CTR *ctr);
+void cmd_srv_query_info(struct client_info *info, int argc, char *argv[]);
+BOOL msrpc_srv_enum_tprt( const char* dest_srv,
+ uint32 info_level,
+ SRV_TPRT_INFO_CTR *ctr,
+ TPRT_INFO_FN(tprt_fn));
+void cmd_srv_enum_tprt(struct client_info *info, int argc, char *argv[]);
+void cmd_srv_enum_conn(struct client_info *info, int argc, char *argv[]);
+void cmd_srv_enum_shares(struct client_info *info, int argc, char *argv[]);
+void cmd_srv_share_get_info(struct client_info *info, int argc, char *argv[]);
+void cmd_srv_enum_sess(struct client_info *info, int argc, char *argv[]);
+void cmd_srv_enum_files(struct client_info *info, int argc, char *argv[]);
+void cmd_time(struct client_info *info, int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/cmd_svcctl.c */
+
+void svc_display_query_svc_cfg(const QUERY_SERVICE_CONFIG *cfg);
+BOOL svc_query_service( POLICY_HND *pol_scm,
+ const char *svc_name,
+ SVC_QUERY_FN(svc_query_fn));
+void cmd_svc_info(struct client_info *info, int argc, char *argv[]);
+BOOL msrpc_svc_enum(const char* srv_name,
+ ENUM_SRVC_STATUS **svcs,
+ uint32 *num_svcs,
+ SVC_INFO_FN(info_fn),
+ SVC_QUERY_FN(query_fn));
+void cmd_svc_enum(struct client_info *info, int argc, char *argv[]);
+void cmd_svc_stop(struct client_info *info, int argc, char *argv[]);
+void cmd_svc_start(struct client_info *info, int argc, char *argv[]);
+void cmd_svc_set(struct client_info *info, int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/cmd_wkssvc.c */
+
+void cmd_wks_query_info(struct client_info *info, int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/display_at.c */
+
+void display_at_enum_info(FILE *out_hnd, enum action_type action,
+ uint32 num_jobs, const AT_ENUM_INFO *const jobs,
+ char *const *const commands);
+void display_at_job_info(FILE *out_hnd, enum action_type action,
+ AT_JOB_INFO *const job, fstring command);
+
+/*The following definitions come from rpcclient/display_event.c */
+
+void display_eventlog_eventrecord(FILE *out_hnd, enum action_type action, EVENTLOGRECORD *const ev);
+
+/*The following definitions come from rpcclient/display_reg.c */
+
+char *get_reg_val_type_str(uint32 type);
+void display_reg_value_info(FILE *out_hnd, enum action_type action,
+ const char *val_name,
+ uint32 val_type, const BUFFER2 *value);
+void display_reg_key_info(FILE *out_hnd, enum action_type action,
+ const char *key_name, time_t key_mod_time);
+
+/*The following definitions come from rpcclient/display_sam.c */
+
+void display_alias_members(FILE *out_hnd, enum action_type action,
+ uint32 num_mem, char *const *const sid_mem,
+ uint32 *const type);
+void display_alias_rid_info(FILE *out_hnd, enum action_type action,
+ DOM_SID *const sid,
+ uint32 num_rids, uint32 *const rid);
+void display_group_members(FILE *out_hnd, enum action_type action,
+ uint32 num_mem, char *const *const name, uint32 *const type);
+void display_group_info1(FILE *out_hnd, enum action_type action, GROUP_INFO1 *const info1);
+void display_group_info4(FILE *out_hnd, enum action_type action, GROUP_INFO4 *const info4);
+void display_group_info_ctr(FILE *out_hnd, enum action_type action,
+ GROUP_INFO_CTR *const ctr);
+void display_group_rid_info(FILE *out_hnd, enum action_type action,
+ uint32 num_gids, DOM_GID *const gid);
+void display_alias_name_info(FILE *out_hnd, enum action_type action,
+ uint32 num_aliases, fstring *const alias_name, const uint32 *const num_als_usrs);
+void display_alias_info3(FILE *out_hnd, enum action_type action, ALIAS_INFO3 *const info3);
+void display_alias_info_ctr(FILE *out_hnd, enum action_type action,
+ ALIAS_INFO_CTR *const ctr);
+void display_sam_user_info_21(FILE *out_hnd, enum action_type action, SAM_USER_INFO_21 *const usr);
+void display_sam_unk_info_2(FILE *out_hnd, enum action_type action,
+ SAM_UNK_INFO_2 *const info2);
+void display_sam_unk_ctr(FILE *out_hnd, enum action_type action,
+ uint32 switch_value, SAM_UNK_CTR *const ctr);
+void display_sam_info_1(FILE *out_hnd, enum action_type action,
+ SAM_ENTRY1 *const e1, SAM_STR1 *const s1);
+void display_sam_info_1_ctr(FILE *out_hnd, enum action_type action,
+ uint32 count, SAM_DISPINFO_1 *const ctr);
+void display_sam_disp_info_ctr(FILE *out_hnd, enum action_type action,
+ uint16 level, uint32 count,
+ SAM_DISPINFO_CTR *const ctr);
+
+/*The following definitions come from rpcclient/display_sec.c */
+
+void display_sec_desc(FILE *out_hnd, enum action_type action, SEC_DESC *const sec);
+
+/*The following definitions come from rpcclient/display_spool.c */
+
+void display_print_info_0(FILE *out_hnd, enum action_type action,
+ PRINTER_INFO_0 *const i0);
+void display_print_info_1(FILE *out_hnd, enum action_type action,
+ PRINTER_INFO_1 *const i1);
+void display_printer_info_0_ctr(FILE *out_hnd, enum action_type action,
+ uint32 count, PRINTER_INFO_0 *const *const ctr);
+void display_printer_info_1_ctr(FILE *out_hnd, enum action_type action,
+ uint32 count, PRINTER_INFO_1 *const *const ctr);
+void display_printer_info_ctr(FILE *out_hnd, enum action_type action,
+ uint32 level, uint32 count,
+ void *const *const ctr);
+void display_job_info_2(FILE *out_hnd, enum action_type action,
+ JOB_INFO_2 *const i2);
+void display_job_info_1(FILE *out_hnd, enum action_type action,
+ JOB_INFO_1 *const i1);
+void display_job_info_2_ctr(FILE *out_hnd, enum action_type action,
+ uint32 count, JOB_INFO_2 *const *const ctr);
+void display_job_info_1_ctr(FILE *out_hnd, enum action_type action,
+ uint32 count, JOB_INFO_1 *const *const ctr);
+void display_job_info_ctr(FILE *out_hnd, enum action_type action,
+ uint32 level, uint32 count,
+ void *const *const ctr);
+
+/*The following definitions come from rpcclient/display_srv.c */
+
+char *get_file_mode_str(uint32 share_mode);
+char *get_file_oplock_str(uint32 op_type);
+char *get_server_type_str(uint32 type);
+void display_srv_info_ctr(FILE *out_hnd, enum action_type action,
+ const SRV_INFO_CTR *ctr);
+void display_conn_info_0(FILE *out_hnd, enum action_type action,
+ CONN_INFO_0 *const info0);
+void display_conn_info_1(FILE *out_hnd, enum action_type action,
+ CONN_INFO_1 *const info1, CONN_INFO_1_STR *const str1);
+void display_srv_conn_info_0_ctr(FILE *out_hnd, enum action_type action,
+ SRV_CONN_INFO_0 *const ctr);
+void display_srv_conn_info_1_ctr(FILE *out_hnd, enum action_type action,
+ SRV_CONN_INFO_1 *const ctr);
+void display_srv_conn_info_ctr(FILE *out_hnd, enum action_type action,
+ SRV_CONN_INFO_CTR *const ctr);
+void display_tprt_info_0(FILE *out_hnd, enum action_type action,
+ TPRT_INFO_0 *const info0, TPRT_INFO_0_STR *const str0);
+void display_srv_tprt_info_0_ctr(FILE *out_hnd, enum action_type action,
+ const SRV_TPRT_INFO_0 *const ctr);
+void display_srv_tprt_info_ctr(FILE *out_hnd, enum action_type action,
+ const SRV_TPRT_INFO_CTR *const ctr);
+void display_srv_share_info_ctr(FILE *out_hnd, enum action_type action,
+ SRV_SHARE_INFO_CTR *const ctr);
+void display_srv_file_info_ctr(FILE *out_hnd, enum action_type action,
+ SRV_FILE_INFO_CTR *const ctr);
+void display_sess_info_0(FILE *out_hnd, enum action_type action,
+ SESS_INFO_0 *const info0, SESS_INFO_0_STR *const str0);
+void display_sess_info_1(FILE *out_hnd, enum action_type action,
+ SESS_INFO_1 *const info1, SESS_INFO_1_STR *const str1);
+void display_srv_sess_info_0_ctr(FILE *out_hnd, enum action_type action,
+ SRV_SESS_INFO_0 *const ctr);
+void display_srv_sess_info_1_ctr(FILE *out_hnd, enum action_type action,
+ SRV_SESS_INFO_1 *const ctr);
+void display_srv_sess_info_ctr(FILE *out_hnd, enum action_type action,
+ SRV_SESS_INFO_CTR *const ctr);
+void display_server(FILE *out_hnd, enum action_type action,
+ char *const sname, uint32 type, char *const comment);
+void display_share(FILE *out_hnd, enum action_type action,
+ char *const sname, uint32 type, char *const comment);
+void display_share2(FILE *out_hnd, enum action_type action,
+ char *const sname, uint32 type, char *const comment,
+ uint32 perms, uint32 max_uses, uint32 num_uses,
+ char *const path, char *const password);
+void display_name(FILE *out_hnd, enum action_type action,
+ char *const sname);
+
+/*The following definitions come from rpcclient/display_svc.c */
+
+char *get_svc_start_type_str(uint32 type);
+void display_query_svc_cfg(FILE *out_hnd, enum action_type action,
+ const QUERY_SERVICE_CONFIG *const cfg);
+void display_svc_info(FILE *out_hnd, enum action_type action,
+ const ENUM_SRVC_STATUS *const svc);
+
+/*The following definitions come from rpcclient/display_sync.c */
+
+void display_sam_sync_ctr(FILE *out_hnd, enum action_type action,
+ SAM_DELTA_HDR *const delta,
+ SAM_DELTA_CTR *const ctr);
+void display_sam_sync(FILE *out_hnd, enum action_type action,
+ SAM_DELTA_HDR *const deltas,
+ SAM_DELTA_CTR *const ctr,
+ uint32 num);
+
+/*The following definitions come from rpcclient/eventlog.c */
+
+int main(int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/eventlog_cmds.c */
+
+void add_evt_commands(void);
+
+/*The following definitions come from rpcclient/lsa.c */
+
+
+/*The following definitions come from rpcclient/lsa_cmds.c */
+
+void add_lsa_commands(void);
+
/*The following definitions come from rpc_client/msrpc_lsarpc.c */
uint32 lookup_lsa_names(const char *srv_name,
@@ -2807,6 +3116,51 @@ BOOL ncalrpc_l_use_del(const char *pipe_name,
void ncalrpc_l_use_enum(uint32 * num_cons, struct use_info ***use);
void ncalrpc_use_wait_keyboard(void);
+/*The following definitions come from rpcclient/net.c */
+
+
+/*The following definitions come from rpcclient/net_cmds.c */
+
+void add_net_commands(void);
+
+/*The following definitions come from rpcclient/netlogon_cmds.c */
+
+void add_ntl_commands(void);
+
+/*The following definitions come from rpcclient/regedit.c */
+
+
+/*The following definitions come from rpcclient/regedit_cmds.c */
+
+void add_reg_commands(void);
+
+/*The following definitions come from rpcclient/rpcclient.c */
+
+
+/*The following definitions come from rpcclient/samedit.c */
+
+
+/*The following definitions come from rpcclient/samedit_cmds.c */
+
+void add_sam_commands(void);
+
+/*The following definitions come from rpcclient/spoolss.c */
+
+int main(int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/spoolss_cmds.c */
+
+void add_spl_commands(void);
+
+/*The following definitions come from rpcclient/svcctrl.c */
+
+int main(int argc, char *argv[]);
+
+/*The following definitions come from rpcclient/svcctrl_cmds.c */
+
+char *complete_svcenum(char *text, int state);
+void add_svc_commands(void);
+
/*The following definitions come from rpc_parse/parse_creds.c */
BOOL make_creds_unix(CREDS_UNIX *r_u, const char* user_name,
@@ -3210,9 +3564,11 @@ BOOL smb_io_rpc_hdr_nack(char *desc, RPC_HDR_NACK * rpc, prs_struct * ps,
int depth);
BOOL smb_io_rpc_hdr_fault(char *desc, RPC_HDR_FAULT * rpc, prs_struct * ps,
int depth);
+BOOL smb_io_rpc_uuid(char *desc, RPC_UUID * uuid, prs_struct * ps,
+ int depth);
BOOL make_rpc_hdr_rb(RPC_HDR_RB * rpc,
uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
- uint32 num_elements, uint16 context_id,
+ uint8 num_elements, uint16 context_id,
uint8 num_syntaxes, RPC_IFACE * abstract,
RPC_IFACE * transfer);
BOOL smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB * rpc, prs_struct * ps,
@@ -3363,368 +3719,14 @@ BOOL api_svcctl_rpc(rpcsrv_struct *p);
BOOL api_wkssvc_rpc(rpcsrv_struct *p);
-/*The following definitions come from rpcclient/cmd_atsvc.c */
-
-void cmd_at(struct client_info *info, int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/cmd_brs.c */
-
-void cmd_brs_query_info(struct client_info *info, int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/cmd_eventlog.c */
-
-void cmd_eventlog(struct client_info *info, int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/cmd_lsarpc.c */
-
-void cmd_lsa_enum_trust_dom(struct client_info *info, int argc, char *argv[]);
-void cmd_lsa_query_info(struct client_info *info, int argc, char *argv[]);
-void cmd_lsa_lookup_names(struct client_info *info, int argc, char *argv[]);
-void cmd_lsa_lookup_sids(struct client_info *info, int argc, char *argv[]);
-void cmd_lsa_set_secret(struct client_info *info, int argc, char *argv[]);
-void cmd_lsa_create_secret(struct client_info *info, int argc, char *argv[]);
-void cmd_lsa_query_secret_secobj(struct client_info *info, int argc, char *argv[]);
-void cmd_lsa_query_secret(struct client_info *info, int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/cmd_netlogon.c */
-
-void cmd_netlogon_login_test(struct client_info *info, int argc, char *argv[]);
-void cmd_netlogon_domain_test(struct client_info *info, int argc,
- char *argv[]);
-void cmd_sam_sync(struct client_info *info, int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/cmd_reg.c */
-
-void split_server_keyname(char *srv_name, char *key, const char* arg);
-BOOL msrpc_reg_enum_key(const char* srv_name, const char* full_keyname,
- REG_FN(reg_fn),
- REG_KEY_FN(reg_key_fn),
- REG_VAL_FN(reg_val_fn));
-void cmd_reg_enum(struct client_info *info, int argc, char *argv[]);
-void cmd_reg_query_info(struct client_info *info, int argc, char *argv[]);
-void cmd_reg_query_key(struct client_info *info, int argc, char *argv[]);
-void cmd_reg_create_val(struct client_info *info, int argc, char *argv[]);
-void cmd_reg_delete_val(struct client_info *info, int argc, char *argv[]);
-void cmd_reg_delete_key(struct client_info *info, int argc, char *argv[]);
-void cmd_reg_create_key(struct client_info *info, int argc, char *argv[]);
-void cmd_reg_test_key_sec(struct client_info *info, int argc, char *argv[]);
-void cmd_reg_get_key_sec(struct client_info *info, int argc, char *argv[]);
-void cmd_reg_shutdown(struct client_info *info, int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/cmd_samr.c */
-
-void cmd_sam_ntchange_pwd(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_test(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_lookup_domain(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_lookup_names(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_lookup_rids(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_del_aliasmem(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_delete_dom_alias(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_add_aliasmem(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_create_dom_trusting(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_create_dom_user(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_create_dom_alias(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_del_groupmem(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_delete_dom_user(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_delete_dom_group(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_add_groupmem(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_create_dom_group(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_enum_users(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_query_groupmem(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_query_group(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_query_sec_obj(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_query_user(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_set_userinfo2(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_set_userinfo(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_query_dispinfo(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_query_dominfo(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_query_aliasmem(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_query_alias(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_enum_aliases(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_enum_groups(struct client_info *info, int argc, char *argv[]);
-void cmd_sam_enum_domains(struct client_info *info, int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/cmd_spoolss.c */
-
-BOOL msrpc_spoolss_enum_printers( const char* srv_name,
- uint32 level,
- uint32 *num,
- void ***ctr,
- PRINT_INFO_FN(fn));
-void cmd_spoolss_enum_printers(struct client_info *info, int argc, char *argv[]);
-void cmd_spoolss_open_printer_ex(struct client_info *info, int argc, char *argv[]);
-BOOL msrpc_spoolss_enum_jobs( const char* printer_name,
- const char* station, const char* user_name,
- uint32 level,
- uint32 *num,
- void ***ctr,
- JOB_INFO_FN(fn));
-void cmd_spoolss_enum_jobs(struct client_info *info, int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/cmd_srvsvc.c */
-
-BOOL net_srv_get_info(struct client_info *info,
- uint32 info_level,
- SRV_INFO_CTR *ctr);
-void cmd_srv_query_info(struct client_info *info, int argc, char *argv[]);
-BOOL msrpc_srv_enum_tprt( const char* dest_srv,
- uint32 info_level,
- SRV_TPRT_INFO_CTR *ctr,
- TPRT_INFO_FN(tprt_fn));
-void cmd_srv_enum_tprt(struct client_info *info, int argc, char *argv[]);
-void cmd_srv_enum_conn(struct client_info *info, int argc, char *argv[]);
-void cmd_srv_enum_shares(struct client_info *info, int argc, char *argv[]);
-void cmd_srv_share_get_info(struct client_info *info, int argc, char *argv[]);
-void cmd_srv_enum_sess(struct client_info *info, int argc, char *argv[]);
-void cmd_srv_enum_files(struct client_info *info, int argc, char *argv[]);
-void cmd_time(struct client_info *info, int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/cmd_svcctl.c */
-
-void svc_display_query_svc_cfg(const QUERY_SERVICE_CONFIG *cfg);
-BOOL svc_query_service( POLICY_HND *pol_scm,
- const char *svc_name,
- SVC_QUERY_FN(svc_query_fn));
-void cmd_svc_info(struct client_info *info, int argc, char *argv[]);
-BOOL msrpc_svc_enum(const char* srv_name,
- ENUM_SRVC_STATUS **svcs,
- uint32 *num_svcs,
- SVC_INFO_FN(info_fn),
- SVC_QUERY_FN(query_fn));
-void cmd_svc_enum(struct client_info *info, int argc, char *argv[]);
-void cmd_svc_stop(struct client_info *info, int argc, char *argv[]);
-void cmd_svc_start(struct client_info *info, int argc, char *argv[]);
-void cmd_svc_set(struct client_info *info, int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/cmd_wkssvc.c */
-
-void cmd_wks_query_info(struct client_info *info, int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/cmdat.c */
-
-
-/*The following definitions come from rpcclient/cmdat_cmds.c */
-
-void add_at_commands(void);
-
-/*The following definitions come from rpcclient/display_at.c */
-
-void display_at_enum_info(FILE *out_hnd, enum action_type action,
- uint32 num_jobs, const AT_ENUM_INFO *const jobs,
- char *const *const commands);
-void display_at_job_info(FILE *out_hnd, enum action_type action,
- AT_JOB_INFO *const job, fstring command);
-
-/*The following definitions come from rpcclient/display_event.c */
-
-void display_eventlog_eventrecord(FILE *out_hnd, enum action_type action, EVENTLOGRECORD *const ev);
-
-/*The following definitions come from rpcclient/display_reg.c */
-
-char *get_reg_val_type_str(uint32 type);
-void display_reg_value_info(FILE *out_hnd, enum action_type action,
- const char *val_name,
- uint32 val_type, const BUFFER2 *value);
-void display_reg_key_info(FILE *out_hnd, enum action_type action,
- const char *key_name, time_t key_mod_time);
-
-/*The following definitions come from rpcclient/display_sam.c */
-
-void display_alias_members(FILE *out_hnd, enum action_type action,
- uint32 num_mem, char *const *const sid_mem,
- uint32 *const type);
-void display_alias_rid_info(FILE *out_hnd, enum action_type action,
- DOM_SID *const sid,
- uint32 num_rids, uint32 *const rid);
-void display_group_members(FILE *out_hnd, enum action_type action,
- uint32 num_mem, char *const *const name, uint32 *const type);
-void display_group_info1(FILE *out_hnd, enum action_type action, GROUP_INFO1 *const info1);
-void display_group_info4(FILE *out_hnd, enum action_type action, GROUP_INFO4 *const info4);
-void display_group_info_ctr(FILE *out_hnd, enum action_type action,
- GROUP_INFO_CTR *const ctr);
-void display_group_rid_info(FILE *out_hnd, enum action_type action,
- uint32 num_gids, DOM_GID *const gid);
-void display_alias_name_info(FILE *out_hnd, enum action_type action,
- uint32 num_aliases, fstring *const alias_name, const uint32 *const num_als_usrs);
-void display_alias_info3(FILE *out_hnd, enum action_type action, ALIAS_INFO3 *const info3);
-void display_alias_info_ctr(FILE *out_hnd, enum action_type action,
- ALIAS_INFO_CTR *const ctr);
-void display_sam_user_info_21(FILE *out_hnd, enum action_type action, SAM_USER_INFO_21 *const usr);
-void display_sam_unk_info_2(FILE *out_hnd, enum action_type action,
- SAM_UNK_INFO_2 *const info2);
-void display_sam_unk_ctr(FILE *out_hnd, enum action_type action,
- uint32 switch_value, SAM_UNK_CTR *const ctr);
-void display_sam_info_1(FILE *out_hnd, enum action_type action,
- SAM_ENTRY1 *const e1, SAM_STR1 *const s1);
-void display_sam_info_1_ctr(FILE *out_hnd, enum action_type action,
- uint32 count, SAM_DISPINFO_1 *const ctr);
-void display_sam_disp_info_ctr(FILE *out_hnd, enum action_type action,
- uint16 level, uint32 count,
- SAM_DISPINFO_CTR *const ctr);
-
-/*The following definitions come from rpcclient/display_sec.c */
-
-void display_sec_desc(FILE *out_hnd, enum action_type action, SEC_DESC *const sec);
-
-/*The following definitions come from rpcclient/display_spool.c */
-
-void display_print_info_0(FILE *out_hnd, enum action_type action,
- PRINTER_INFO_0 *const i0);
-void display_print_info_1(FILE *out_hnd, enum action_type action,
- PRINTER_INFO_1 *const i1);
-void display_printer_info_0_ctr(FILE *out_hnd, enum action_type action,
- uint32 count, PRINTER_INFO_0 *const *const ctr);
-void display_printer_info_1_ctr(FILE *out_hnd, enum action_type action,
- uint32 count, PRINTER_INFO_1 *const *const ctr);
-void display_printer_info_ctr(FILE *out_hnd, enum action_type action,
- uint32 level, uint32 count,
- void *const *const ctr);
-void display_job_info_2(FILE *out_hnd, enum action_type action,
- JOB_INFO_2 *const i2);
-void display_job_info_1(FILE *out_hnd, enum action_type action,
- JOB_INFO_1 *const i1);
-void display_job_info_2_ctr(FILE *out_hnd, enum action_type action,
- uint32 count, JOB_INFO_2 *const *const ctr);
-void display_job_info_1_ctr(FILE *out_hnd, enum action_type action,
- uint32 count, JOB_INFO_1 *const *const ctr);
-void display_job_info_ctr(FILE *out_hnd, enum action_type action,
- uint32 level, uint32 count,
- void *const *const ctr);
-
-/*The following definitions come from rpcclient/display_srv.c */
-
-char *get_file_mode_str(uint32 share_mode);
-char *get_file_oplock_str(uint32 op_type);
-char *get_server_type_str(uint32 type);
-void display_srv_info_ctr(FILE *out_hnd, enum action_type action,
- const SRV_INFO_CTR *ctr);
-void display_conn_info_0(FILE *out_hnd, enum action_type action,
- CONN_INFO_0 *const info0);
-void display_conn_info_1(FILE *out_hnd, enum action_type action,
- CONN_INFO_1 *const info1, CONN_INFO_1_STR *const str1);
-void display_srv_conn_info_0_ctr(FILE *out_hnd, enum action_type action,
- SRV_CONN_INFO_0 *const ctr);
-void display_srv_conn_info_1_ctr(FILE *out_hnd, enum action_type action,
- SRV_CONN_INFO_1 *const ctr);
-void display_srv_conn_info_ctr(FILE *out_hnd, enum action_type action,
- SRV_CONN_INFO_CTR *const ctr);
-void display_tprt_info_0(FILE *out_hnd, enum action_type action,
- TPRT_INFO_0 *const info0, TPRT_INFO_0_STR *const str0);
-void display_srv_tprt_info_0_ctr(FILE *out_hnd, enum action_type action,
- const SRV_TPRT_INFO_0 *const ctr);
-void display_srv_tprt_info_ctr(FILE *out_hnd, enum action_type action,
- const SRV_TPRT_INFO_CTR *const ctr);
-void display_srv_share_info_ctr(FILE *out_hnd, enum action_type action,
- SRV_SHARE_INFO_CTR *const ctr);
-void display_srv_file_info_ctr(FILE *out_hnd, enum action_type action,
- SRV_FILE_INFO_CTR *const ctr);
-void display_sess_info_0(FILE *out_hnd, enum action_type action,
- SESS_INFO_0 *const info0, SESS_INFO_0_STR *const str0);
-void display_sess_info_1(FILE *out_hnd, enum action_type action,
- SESS_INFO_1 *const info1, SESS_INFO_1_STR *const str1);
-void display_srv_sess_info_0_ctr(FILE *out_hnd, enum action_type action,
- SRV_SESS_INFO_0 *const ctr);
-void display_srv_sess_info_1_ctr(FILE *out_hnd, enum action_type action,
- SRV_SESS_INFO_1 *const ctr);
-void display_srv_sess_info_ctr(FILE *out_hnd, enum action_type action,
- SRV_SESS_INFO_CTR *const ctr);
-void display_server(FILE *out_hnd, enum action_type action,
- char *const sname, uint32 type, char *const comment);
-void display_share(FILE *out_hnd, enum action_type action,
- char *const sname, uint32 type, char *const comment);
-void display_share2(FILE *out_hnd, enum action_type action,
- char *const sname, uint32 type, char *const comment,
- uint32 perms, uint32 max_uses, uint32 num_uses,
- char *const path, char *const password);
-void display_name(FILE *out_hnd, enum action_type action,
- char *const sname);
-
-/*The following definitions come from rpcclient/display_svc.c */
-
-char *get_svc_start_type_str(uint32 type);
-void display_query_svc_cfg(FILE *out_hnd, enum action_type action,
- const QUERY_SERVICE_CONFIG *const cfg);
-void display_svc_info(FILE *out_hnd, enum action_type action,
- const ENUM_SRVC_STATUS *const svc);
-
-/*The following definitions come from rpcclient/display_sync.c */
-
-void display_sam_sync_ctr(FILE *out_hnd, enum action_type action,
- SAM_DELTA_HDR *const delta,
- SAM_DELTA_CTR *const ctr);
-void display_sam_sync(FILE *out_hnd, enum action_type action,
- SAM_DELTA_HDR *const deltas,
- SAM_DELTA_CTR *const ctr,
- uint32 num);
-
-/*The following definitions come from rpcclient/eventlog.c */
-
-int main(int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/eventlog_cmds.c */
-
-void add_evt_commands(void);
-
-/*The following definitions come from rpcclient/lsa.c */
-
-
-/*The following definitions come from rpcclient/lsa_cmds.c */
-
-void add_lsa_commands(void);
-
-/*The following definitions come from rpcclient/net.c */
-
-
-/*The following definitions come from rpcclient/net_cmds.c */
-
-void add_net_commands(void);
-
-/*The following definitions come from rpcclient/netlogon_cmds.c */
-
-void add_ntl_commands(void);
-
-/*The following definitions come from rpcclient/regedit.c */
-
-
-/*The following definitions come from rpcclient/regedit_cmds.c */
-
-void add_reg_commands(void);
-
-/*The following definitions come from rpcclient/rpcclient.c */
-
-
-/*The following definitions come from rpcclient/samedit.c */
-
-
-/*The following definitions come from rpcclient/samedit_cmds.c */
-
-void add_sam_commands(void);
-
-/*The following definitions come from rpcclient/spoolss.c */
-
-int main(int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/spoolss_cmds.c */
-
-void add_spl_commands(void);
-
-/*The following definitions come from rpcclient/svcctrl.c */
-
-int main(int argc, char *argv[]);
-
-/*The following definitions come from rpcclient/svcctrl_cmds.c */
+/*The following definitions come from samrd/samrd.c */
-char *complete_svcenum(char *text, int state);
-void add_svc_commands(void);
+msrpc_service_fns *get_service_fns(void);
/*The following definitions come from samrd/samr_util.c */
uint32 samr_make_usr_obj_sd(SEC_DESC_BUF *buf, DOM_SID *usr_sid);
-/*The following definitions come from samrd/samrd.c */
-
-msrpc_service_fns *get_service_fns(void);
-
/*The following definitions come from samrd/srv_samr_als_tdb.c */
uint32 _samr_add_aliasmem(const POLICY_HND *alias_pol, const DOM_SID *sid);
@@ -4502,6 +4504,17 @@ BOOL become_user(connection_struct *conn, uint16 vuid);
BOOL become_userk(connection_struct *conn, const vuser_key *key);
BOOL unbecome_user(void );
+/*The following definitions come from smbd/vfs.c */
+
+int vfs_init_default(connection_struct *conn);
+BOOL vfs_init_custom(connection_struct *conn);
+BOOL vfs_file_exist(connection_struct *conn,char *fname,SMB_STRUCT_STAT *sbuf);
+ssize_t vfs_write_data(files_struct *fsp,char *buffer,size_t N);
+SMB_OFF_T vfs_transfer_file(int in_fd, files_struct *in_fsp,
+ int out_fd, files_struct *out_fsp,
+ SMB_OFF_T n, char *header, int headlen, int align);
+char *vfs_readdirname(connection_struct *conn, void *p);
+
/*The following definitions come from smbd/vfs-wrap.c */
int vfswrap_dummy_connect(struct vfs_connection_struct *conn, char *service,
@@ -4531,17 +4544,6 @@ int vfswrap_unlink(char *path);
int vfswrap_chmod(char *path, mode_t mode);
int vfswrap_utime(char *path, struct utimbuf *times);
-/*The following definitions come from smbd/vfs.c */
-
-int vfs_init_default(connection_struct *conn);
-BOOL vfs_init_custom(connection_struct *conn);
-BOOL vfs_file_exist(connection_struct *conn,char *fname,SMB_STRUCT_STAT *sbuf);
-ssize_t vfs_write_data(files_struct *fsp,char *buffer,size_t N);
-SMB_OFF_T vfs_transfer_file(int in_fd, files_struct *in_fsp,
- int out_fd, files_struct *out_fsp,
- SMB_OFF_T n, char *header, int headlen, int align);
-char *vfs_readdirname(connection_struct *conn, void *p);
-
/*The following definitions come from smbwrapper/realcalls.c */
int real_utime(const char *name, struct utimbuf *buf);
diff --git a/source/include/rpc_dce.h b/source/include/rpc_dce.h
index 50089511555..15e3db5a6e2 100644
--- a/source/include/rpc_dce.h
+++ b/source/include/rpc_dce.h
@@ -189,7 +189,8 @@ typedef struct rpc_bind_req_info
{
RPC_HDR_BBA bba;
- uint32 num_elements; /* the number of elements (0x1) */
+ uint8 num_elements; /* the number of elements (0x1) */
+ /* 3-byte pad */
uint16 context_id; /* presentation context identifier (0x0) */
uint8 num_syntaxes; /* the number of syntaxes (has always been 1?)(0x1) */
diff --git a/source/include/rpc_lsa.h b/source/include/rpc_lsa.h
index 090e2254017..37fe1b7abfe 100644
--- a/source/include/rpc_lsa.h
+++ b/source/include/rpc_lsa.h
@@ -201,7 +201,7 @@ typedef struct r_lsa_query_sec_obj_info
typedef struct lsa_query_info
{
POLICY_HND pol; /* policy handle */
- uint16 info_class; /* info class */
+ uint8 info_class; /* info class */
} LSA_Q_QUERY_INFO;
diff --git a/source/include/rpc_misc.h b/source/include/rpc_misc.h
index ed8cbd96bb4..8077a0aadb8 100644
--- a/source/include/rpc_misc.h
+++ b/source/include/rpc_misc.h
@@ -412,12 +412,11 @@ typedef struct gid_info
} DOM_GID;
-#define POL_HND_SIZE 20
-
/* POLICY_HND */
typedef struct lsa_policy_info
{
- uint8 data[POL_HND_SIZE]; /* policy handle */
+ uint32 ptr;
+ RPC_UUID uuid;
} POLICY_HND;
diff --git a/source/include/rpc_parse_proto.h b/source/include/rpc_parse_proto.h
index e9bd5044dd0..9e82cdf5006 100644
--- a/source/include/rpc_parse_proto.h
+++ b/source/include/rpc_parse_proto.h
@@ -95,7 +95,7 @@ BOOL make_q_query_sec_obj(LSA_Q_QUERY_SEC_OBJ * q_q, const POLICY_HND *hnd,
BOOL lsa_io_q_query_sec_obj(char *desc, LSA_Q_QUERY_SEC_OBJ * q_q, prs_struct * ps,
int depth);
BOOL lsa_io_r_query_sec_obj(char *desc, LSA_R_QUERY_SEC_OBJ *r_u, prs_struct *ps, int depth);
-BOOL make_q_query(LSA_Q_QUERY_INFO * q_q, POLICY_HND *hnd, uint16 info_class);
+BOOL make_q_query(LSA_Q_QUERY_INFO * q_q, POLICY_HND *hnd, uint8 info_class);
BOOL lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO * q_q, prs_struct * ps,
int depth);
BOOL make_q_create_secret(LSA_Q_CREATE_SECRET * q_o,
@@ -274,9 +274,11 @@ BOOL smb_io_rpc_hdr_nack(char *desc, RPC_HDR_NACK * rpc, prs_struct * ps,
int depth);
BOOL smb_io_rpc_hdr_fault(char *desc, RPC_HDR_FAULT * rpc, prs_struct * ps,
int depth);
+BOOL smb_io_rpc_uuid(char *desc, RPC_UUID * uuid, prs_struct * ps,
+ int depth);
BOOL make_rpc_hdr_rb(RPC_HDR_RB * rpc,
uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
- uint32 num_elements, uint16 context_id,
+ uint8 num_elements, uint16 context_id,
uint8 num_syntaxes, RPC_IFACE * abstract,
RPC_IFACE * transfer);
BOOL smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB * rpc, prs_struct * ps,
diff --git a/source/include/winbindd_proto.h b/source/include/winbindd_proto.h
index 7aa753fc626..753cf76d7ff 100644
--- a/source/include/winbindd_proto.h
+++ b/source/include/winbindd_proto.h
@@ -186,10 +186,263 @@ void CatchChildLeaveStatus(void);
int vslprintf(char *str, int n, char *format, va_list ap);
+/*The following definitions come from libsmb/clientgen.c */
+
+int cli_set_port(struct cli_state *cli, int port);
+char *cli_errstr(struct cli_state *cli);
+void cli_safe_smb_errstr(struct cli_state *cli, char *msg, size_t len);
+BOOL get_safe_rap_errstr(int rap_error, char *err_msg, size_t msglen);
+void cli_safe_errstr(struct cli_state *cli, char *err_msg, size_t msglen);
+BOOL cli_send_trans(struct cli_state *cli, int trans,
+ char *name, int pipe_name_len,
+ int fid, int flags,
+ uint16 *setup, int lsetup, int msetup,
+ char *param, int lparam, int mparam,
+ char *data, int ldata, int mdata);
+BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len,
+ uint16 *setup, uint32 setup_count, uint32 max_setup_count,
+ char *params, uint32 param_count, uint32 max_param_count,
+ char *data, uint32 data_count, uint32 max_data_count,
+ char **rparam, uint32 *rparam_count,
+ char **rdata, uint32 *rdata_count);
+BOOL cli_api(struct cli_state *cli,
+ char *param, int prcnt, int mprcnt,
+ char *data, int drcnt, int mdrcnt,
+ char **rparam, int *rprcnt,
+ char **rdata, int *rdrcnt);
+BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
+BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, const char *));
+BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
+ void (*fn)(const char *, uint32, const char *));
+BOOL cli_session_setup_x(struct cli_state *cli,
+ char *user,
+ char *pass, int passlen,
+ char *ntpass, int ntpasslen,
+ char *user_domain);
+BOOL cli_session_setup(struct cli_state *cli,
+ char *myhostname, char *user,
+ char *pass, int passlen,
+ char *ntpass, int ntpasslen,
+ char *user_domain);
+BOOL cli_ulogoff(struct cli_state *cli);
+BOOL cli_send_tconX(struct cli_state *cli,
+ char *share, char *dev, char *pass, int passlen);
+BOOL cli_tdis(struct cli_state *cli);
+BOOL cli_rename(struct cli_state *cli, char *fname_src, char *fname_dst);
+BOOL cli_unlink(struct cli_state *cli, char *fname);
+BOOL cli_mkdir(struct cli_state *cli, char *dname);
+BOOL cli_rmdir(struct cli_state *cli, char *dname);
+int cli_nt_create(struct cli_state *cli, const char *fname);
+int cli_open(struct cli_state *cli, const char *fname,
+ int flags, int share_mode);
+BOOL cli_close(struct cli_state *cli, int fnum);
+BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
+BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
+size_t cli_read_one(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size);
+size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size, BOOL overlap);
+ssize_t cli_write(struct cli_state *cli,
+ int fnum, uint16 write_mode,
+ char *buf, off_t offset, size_t size, size_t bytes_left);
+BOOL cli_getattrE(struct cli_state *cli, int fd,
+ uint16 *attr, size_t *size,
+ time_t *c_time, time_t *a_time, time_t *m_time);
+BOOL cli_getatr(struct cli_state *cli, char *fname,
+ uint16 *attr, size_t *size, time_t *t);
+BOOL cli_setatr(struct cli_state *cli, char *fname, uint16 attr, time_t t);
+BOOL cli_qpathinfo(struct cli_state *cli, const char *fname,
+ time_t *c_time, time_t *a_time, time_t *m_time,
+ size_t *size, uint16 *mode);
+BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname,
+ time_t *c_time, time_t *a_time, time_t *m_time,
+ time_t *w_time, size_t *size, uint16 *mode,
+ SMB_INO_T *ino);
+BOOL cli_qfileinfo(struct cli_state *cli, int fnum,
+ uint16 *mode, size_t *size,
+ time_t *c_time, time_t *a_time, time_t *m_time,
+ time_t *w_time, SMB_INO_T *ino);
+int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
+ void (*fn)(file_info *, const char *));
+BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
+ const char *old_password);
+BOOL cli_negprot(struct cli_state *cli);
+BOOL cli_session_request(struct cli_state *cli,
+ struct nmb_name *calling, struct nmb_name *called);
+BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip);
+void cli_init_creds(struct cli_state *cli, const struct ntuser_creds *usr);
+struct cli_state *cli_initialise(struct cli_state *cli);
+void cli_close_socket(struct cli_state *cli);
+void cli_shutdown(struct cli_state *cli);
+int cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num);
+void cli_sockopt(struct cli_state *cli, char *options);
+uint16 cli_setpid(struct cli_state *cli, uint16 pid);
+BOOL cli_reestablish_connection(struct cli_state *cli);
+BOOL cli_establish_connection(struct cli_state *cli,
+ const char *dest_host, struct in_addr *dest_ip,
+ struct nmb_name *calling, struct nmb_name *called,
+ char *service, char *service_type,
+ BOOL do_shutdown, BOOL do_tcon);
+BOOL cli_connect_auth(struct cli_state *cli,
+ const char* desthost,
+ struct in_addr *dest_ip,
+ const struct ntuser_creds *usr);
+BOOL cli_connect_servers_auth(struct cli_state *cli,
+ char *p,
+ const struct ntuser_creds *usr);
+BOOL cli_connect_serverlist(struct cli_state *cli, char *p);
+int cli_printjob_del(struct cli_state *cli, int job);
+int cli_print_queue(struct cli_state *cli,
+ void (*fn)(struct print_job_info *));
+BOOL cli_chkpath(struct cli_state *cli, char *path);
+BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
+ int *grp);
+BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp);
+BOOL cli_message_end(struct cli_state *cli, int grp);
+BOOL cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
+BOOL get_any_dc_name(const char *domain, char *srv_name);
+
+/*The following definitions come from libsmb/credentials.c */
+
+char *credstr(const uchar *cred);
+void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, const char *pass,
+ uchar session_key[8]);
+void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp,
+ DOM_CHAL *cred);
+int cred_assert(const DOM_CHAL *cred, uchar session_key[8],
+ DOM_CHAL *stored_cred, UTIME timestamp);
+BOOL clnt_deal_with_creds(uchar sess_key[8],
+ DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred);
+BOOL deal_with_creds(uchar sess_key[8],
+ DOM_CRED *sto_clnt_cred,
+ const DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred);
+
+/*The following definitions come from libsmb/namequery.c */
+
+BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
+ struct in_addr to_ip,char *master,char *rname,
+ void (*fn)(struct packet_struct *));
+struct in_addr *name_query(int fd,const char *name,int name_type, BOOL bcast,BOOL recurse,
+ struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *));
+FILE *startlmhosts(char *fname);
+BOOL getlmhostsent( FILE *fp, pstring name, int *name_type, struct in_addr *ipaddr);
+void endlmhosts(FILE *fp);
+BOOL is_ip_address(const char *name);
+BOOL resolve_name(const char *name, struct in_addr *return_ip, int name_type);
+BOOL resolve_srv_name(const char* srv_name, fstring dest_host,
+ struct in_addr *ip);
+BOOL find_master_ip(char *group, struct in_addr *master_ip);
+
+/*The following definitions come from libsmb/nmblib.c */
+
+void debug_nmb_packet(struct packet_struct *p);
+char *nmb_namestr(struct nmb_name *n);
+void nmb_safe_namestr(struct nmb_name *n, char *str, size_t len);
+struct packet_struct *copy_packet(struct packet_struct *packet);
+void free_packet(struct packet_struct *packet);
+struct packet_struct *read_packet(int fd,enum packet_type packet_type);
+void make_nmb_name( struct nmb_name *n, const char *name, int type, const char *this_scope );
+BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
+BOOL send_packet(struct packet_struct *p);
+struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
+void sort_query_replies(char *data, int n, struct in_addr ip);
+BOOL read_nmb_sock(int c, struct nmb_state *con);
+int get_nmb_sock(void);
+char *dns_to_netbios_name(char *dns_name);
+int name_mangle( char *In, char *Out, char name_type );
+int name_extract(char *buf,int ofs,char *name);
+int name_len(char *s1);
+
+/*The following definitions come from libsmb/nterr.c */
+
+BOOL get_safe_nt_error_msg(uint32 nt_code, char *msg, size_t len);
+const char *get_nt_error_msg(uint32 nt_code);
+
+/*The following definitions come from libsmb/pwd_cache.c */
+
+void pwd_init(struct pwd_info *pwd);
+BOOL pwd_is_nullpwd(const struct pwd_info *pwd);
+void pwd_obfuscate_key(struct pwd_info *pwd, uint32 int_key, char *str_key);
+BOOL pwd_compare(const struct pwd_info *_pwd1, const struct pwd_info *_pwd2);
+void pwd_read(struct pwd_info *pwd, char *passwd_report, BOOL do_encrypt);
+void pwd_set_nullpwd(struct pwd_info *pwd);
+void pwd_set_cleartext(struct pwd_info *pwd, char *clr);
+void pwd_get_cleartext(struct pwd_info *pwd, char *clr);
+void pwd_set_lm_nt_16(struct pwd_info *pwd,
+ const uchar lm_pwd[16],
+ const uchar nt_pwd[16]);
+void pwd_get_lm_nt_16(const struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]);
+void pwd_make_lm_nt_16(struct pwd_info *pwd, char *clr);
+void pwd_make_lm_nt_owf2(struct pwd_info *pwd, const uchar srv_key[8],
+ const char *user, const char *server, const char *domain,
+ uchar sess_key[16]);
+void pwd_make_lm_nt_owf(struct pwd_info *pwd, uchar cryptkey[8],
+ uchar sess_key[16]);
+void pwd_get_lm_nt_owf(struct pwd_info *pwd, uchar lm_owf[24],
+ uchar *nt_owf, size_t *nt_owf_len);
+
/*The following definitions come from lib/smbrun.c */
int smbrun(char *cmd,char *outfile,BOOL shared);
+/*The following definitions come from libsmb/smbdes.c */
+
+void smbhash(uchar *out, const uchar *in, const uchar *key, int forw);
+void E_P16(uchar *p14,uchar *p16);
+void E_P24(const uchar *p21, const uchar *c8, uchar *p24);
+void D_P16(const uchar *p14, const uchar *in, uchar *out);
+void E_old_pw_hash( const uchar *p14, const uchar *in, uchar *out);
+void cred_hash1(uchar *out, const uchar *in, const uchar *key);
+void cred_hash2(uchar *out,uchar *in,uchar *key);
+void cred_hash3(uchar *out, const uchar *in,uchar *key, int forw);
+void SamOEMhash( uchar *data, const uchar *key, int val);
+void sam_pwd_hash(uint32 rid, const uchar *in, uchar *out, int forw);
+
+/*The following definitions come from libsmb/smbencrypt.c */
+
+void SMBencrypt(uchar * pwrd, uchar * c8, uchar * p24);
+void SMBNTencrypt(uchar * pwrd, uchar * c8, uchar * p24);
+void E_md4hash(uchar * pwrd, uchar * p16);
+void lm_owf_genW(const UNISTR2 * pwd, uchar p16[16]);
+void lm_owf_gen(const char *pwd, uchar p16[16]);
+void nt_owf_genW(const UNISTR2 * pwd, uchar nt_p16[16]);
+void nt_owf_gen(const char *pwd, uchar nt_p16[16]);
+void nt_lm_owf_genW(const UNISTR2 * pwd, uchar nt_p16[16], uchar lm_p16[16]);
+void nt_lm_owf_gen(const char *pwd, uchar nt_p16[16], uchar lm_p16[16]);
+void SMBOWFencrypt(const uchar pwrd[16], const uchar * c8, uchar p24[24]);
+void SMBOWFencrypt_ntv2(const uchar kr[16],
+ const uchar * srv_chal, int srv_chal_len,
+ const uchar * cli_chal, int cli_chal_len,
+ char resp_buf[16]);
+void SMBsesskeygen_ntv2(const uchar kr[16],
+ const uchar * nt_resp, char sess_key[16]);
+void SMBsesskeygen_ntv1(const uchar kr[16],
+ const uchar * nt_resp, char sess_key[16]);
+void SMBgenclientchals(char *lm_cli_chal,
+ char *nt_cli_chal, int *nt_cli_chal_len,
+ const char *srv, const char *dom);
+void ntv2_owf_gen(const uchar owf[16],
+ const char *user_n, const char *domain_n, uchar kr_buf[16]);
+void NTLMSSPOWFencrypt(const uchar pwrd[8], const uchar * ntlmchalresp,
+ uchar p24[24]);
+BOOL make_oem_passwd_hash(uchar data[516],
+ const char *pwrd, int new_pw_len,
+ const uchar old_pw_hash[16], BOOL unicode);
+BOOL nt_encrypt_string2(STRING2 * out, const STRING2 * in, const uchar * key);
+BOOL nt_decrypt_string2(STRING2 * out, const STRING2 * in, const uchar * key);
+void create_ntlmssp_resp(struct pwd_info *pwd,
+ char *domain, char *user_name, char *my_name,
+ uint32 ntlmssp_cli_flgs, prs_struct * auth_resp);
+BOOL decode_pw_buffer(const char buffer[516], char *new_pwrd,
+ int new_pwrd_size, uint32 * new_pw_len);
+BOOL encode_pw_buffer(char buffer[516], const char *new_pass,
+ int new_pw_len, BOOL nt_pass_set);
+
+/*The following definitions come from libsmb/smberr.c */
+
+char *smb_err_msg(uint8 class, uint32 num);
+BOOL smb_safe_err_msg(uint8 class, uint32 num, char *ret, size_t len);
+BOOL smb_safe_errstr(char *inbuf, char *msg, size_t len);
+char *smb_errstr(char *inbuf);
+
/*The following definitions come from lib/snprintf.c */
@@ -199,11 +452,6 @@ void become_root(BOOL save_dir);
void unbecome_root(BOOL restore_dir);
const vuser_key *get_sec_ctx(void);
-/*The following definitions come from lib/surs.c */
-
-BOOL surs_sam_sid_to_unixid(DOM_SID *sid, uint32 type, uint32 *id, BOOL create);
-BOOL surs_unixid_to_sam_sid(uint32 id, uint32 type, DOM_SID *sid, BOOL create);
-
/*The following definitions come from lib/sursalgdomonly.c */
BOOL surs_algdomonly_sam_sid_to_unixid(DOM_SID *sid, uint32 type, uint32 *id,
@@ -218,6 +466,11 @@ BOOL surs_nt5ldap_sam_sid_to_unixid(LDAPDB *hds, DOM_SID * sid, uint32 type,
BOOL surs_nt5ldap_unixid_to_sam_sid(LDAPDB *hds, uint32 id, uint32 type,
DOM_SID * sid, BOOL create);
+/*The following definitions come from lib/surs.c */
+
+BOOL surs_sam_sid_to_unixid(DOM_SID *sid, uint32 type, uint32 *id, BOOL create);
+BOOL surs_unixid_to_sam_sid(uint32 id, uint32 type, DOM_SID *sid, BOOL create);
+
/*The following definitions come from lib/surstdb.c */
BOOL surs_tdb_sam_sid_to_unixid(DOM_SID * sid, uint32 type, uint32 * id,
@@ -290,6 +543,25 @@ const struct passwd *Get_Pwnam(char *user,BOOL allow_change);
BOOL user_ok(char *user,int snum);
BOOL user_in_list(char *user,char *list);
+/*The following definitions come from lib/util_array.c */
+
+void free_void_array(uint32 num_entries, void **entries,
+ void(free_item)(void*));
+void* add_copy_to_array(uint32 *len, void ***array, const void *item,
+ void*(item_dup)(const void*), BOOL alloc_anyway);
+void* add_item_to_array(uint32 *len, void ***array, void *item);
+void free_use_info_array(uint32 num_entries, struct use_info **entries);
+struct use_info* add_use_info_to_array(uint32 *len, struct use_info ***array,
+ const struct use_info *name);
+void free_char_array(uint32 num_entries, char **entries);
+char* add_chars_to_array(uint32 *len, char ***array, const char *name);
+void free_uint32_array(uint32 num_entries, uint32 **entries);
+uint32* add_uint32s_to_array(uint32 *len, uint32 ***array, const uint32 *name);
+void free_unistr_array(uint32 num_entries, UNISTR2 **entries);
+UNISTR2* add_unistr_to_array(uint32 *len, UNISTR2 ***array, UNISTR2 *name);
+void free_sid_array(uint32 num_entries, DOM_SID **entries);
+DOM_SID* add_sid_to_array(uint32 *len, DOM_SID ***array, const DOM_SID *sid);
+
/*The following definitions come from lib/util.c */
BOOL init_myworkgroup(void);
@@ -397,25 +669,6 @@ char *passdb_path(char *name);
char *lock_path(char *name);
const char *get_sid_name_use_str(uint32 sid_name_use);
-/*The following definitions come from lib/util_array.c */
-
-void free_void_array(uint32 num_entries, void **entries,
- void(free_item)(void*));
-void* add_copy_to_array(uint32 *len, void ***array, const void *item,
- void*(item_dup)(const void*), BOOL alloc_anyway);
-void* add_item_to_array(uint32 *len, void ***array, void *item);
-void free_use_info_array(uint32 num_entries, struct use_info **entries);
-struct use_info* add_use_info_to_array(uint32 *len, struct use_info ***array,
- const struct use_info *name);
-void free_char_array(uint32 num_entries, char **entries);
-char* add_chars_to_array(uint32 *len, char ***array, const char *name);
-void free_uint32_array(uint32 num_entries, uint32 **entries);
-uint32* add_uint32s_to_array(uint32 *len, uint32 ***array, const uint32 *name);
-void free_unistr_array(uint32 num_entries, UNISTR2 **entries);
-UNISTR2* add_unistr_to_array(uint32 *len, UNISTR2 ***array, UNISTR2 *name);
-void free_sid_array(uint32 num_entries, DOM_SID **entries);
-DOM_SID* add_sid_to_array(uint32 *len, DOM_SID ***array, const DOM_SID *sid);
-
/*The following definitions come from lib/util_file.c */
BOOL do_file_lock(int fd, int waitsecs, int type);
@@ -631,259 +884,6 @@ BOOL tdb_lookup_vuid( const vuser_key *uk, user_struct **usr);
BOOL tdb_store_vuid( const vuser_key *uk, user_struct *usr);
BOOL vuid_init_db(void);
-/*The following definitions come from libsmb/clientgen.c */
-
-int cli_set_port(struct cli_state *cli, int port);
-char *cli_errstr(struct cli_state *cli);
-void cli_safe_smb_errstr(struct cli_state *cli, char *msg, size_t len);
-BOOL get_safe_rap_errstr(int rap_error, char *err_msg, size_t msglen);
-void cli_safe_errstr(struct cli_state *cli, char *err_msg, size_t msglen);
-BOOL cli_send_trans(struct cli_state *cli, int trans,
- char *name, int pipe_name_len,
- int fid, int flags,
- uint16 *setup, int lsetup, int msetup,
- char *param, int lparam, int mparam,
- char *data, int ldata, int mdata);
-BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len,
- uint16 *setup, uint32 setup_count, uint32 max_setup_count,
- char *params, uint32 param_count, uint32 max_param_count,
- char *data, uint32 data_count, uint32 max_data_count,
- char **rparam, uint32 *rparam_count,
- char **rdata, uint32 *rdata_count);
-BOOL cli_api(struct cli_state *cli,
- char *param, int prcnt, int mprcnt,
- char *data, int drcnt, int mdrcnt,
- char **rparam, int *rprcnt,
- char **rdata, int *rdrcnt);
-BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
-BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, const char *));
-BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
- void (*fn)(const char *, uint32, const char *));
-BOOL cli_session_setup_x(struct cli_state *cli,
- char *user,
- char *pass, int passlen,
- char *ntpass, int ntpasslen,
- char *user_domain);
-BOOL cli_session_setup(struct cli_state *cli,
- char *myhostname, char *user,
- char *pass, int passlen,
- char *ntpass, int ntpasslen,
- char *user_domain);
-BOOL cli_ulogoff(struct cli_state *cli);
-BOOL cli_send_tconX(struct cli_state *cli,
- char *share, char *dev, char *pass, int passlen);
-BOOL cli_tdis(struct cli_state *cli);
-BOOL cli_rename(struct cli_state *cli, char *fname_src, char *fname_dst);
-BOOL cli_unlink(struct cli_state *cli, char *fname);
-BOOL cli_mkdir(struct cli_state *cli, char *dname);
-BOOL cli_rmdir(struct cli_state *cli, char *dname);
-int cli_nt_create(struct cli_state *cli, const char *fname);
-int cli_open(struct cli_state *cli, const char *fname,
- int flags, int share_mode);
-BOOL cli_close(struct cli_state *cli, int fnum);
-BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
-BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
-size_t cli_read_one(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size);
-size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size, BOOL overlap);
-ssize_t cli_write(struct cli_state *cli,
- int fnum, uint16 write_mode,
- char *buf, off_t offset, size_t size, size_t bytes_left);
-BOOL cli_getattrE(struct cli_state *cli, int fd,
- uint16 *attr, size_t *size,
- time_t *c_time, time_t *a_time, time_t *m_time);
-BOOL cli_getatr(struct cli_state *cli, char *fname,
- uint16 *attr, size_t *size, time_t *t);
-BOOL cli_setatr(struct cli_state *cli, char *fname, uint16 attr, time_t t);
-BOOL cli_qpathinfo(struct cli_state *cli, const char *fname,
- time_t *c_time, time_t *a_time, time_t *m_time,
- size_t *size, uint16 *mode);
-BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname,
- time_t *c_time, time_t *a_time, time_t *m_time,
- time_t *w_time, size_t *size, uint16 *mode,
- SMB_INO_T *ino);
-BOOL cli_qfileinfo(struct cli_state *cli, int fnum,
- uint16 *mode, size_t *size,
- time_t *c_time, time_t *a_time, time_t *m_time,
- time_t *w_time, SMB_INO_T *ino);
-int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(file_info *, const char *));
-BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
- const char *old_password);
-BOOL cli_negprot(struct cli_state *cli);
-BOOL cli_session_request(struct cli_state *cli,
- struct nmb_name *calling, struct nmb_name *called);
-BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip);
-void cli_init_creds(struct cli_state *cli, const struct ntuser_creds *usr);
-struct cli_state *cli_initialise(struct cli_state *cli);
-void cli_close_socket(struct cli_state *cli);
-void cli_shutdown(struct cli_state *cli);
-int cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num);
-void cli_sockopt(struct cli_state *cli, char *options);
-uint16 cli_setpid(struct cli_state *cli, uint16 pid);
-BOOL cli_reestablish_connection(struct cli_state *cli);
-BOOL cli_establish_connection(struct cli_state *cli,
- const char *dest_host, struct in_addr *dest_ip,
- struct nmb_name *calling, struct nmb_name *called,
- char *service, char *service_type,
- BOOL do_shutdown, BOOL do_tcon);
-BOOL cli_connect_auth(struct cli_state *cli,
- const char* desthost,
- struct in_addr *dest_ip,
- const struct ntuser_creds *usr);
-BOOL cli_connect_servers_auth(struct cli_state *cli,
- char *p,
- const struct ntuser_creds *usr);
-BOOL cli_connect_serverlist(struct cli_state *cli, char *p);
-int cli_printjob_del(struct cli_state *cli, int job);
-int cli_print_queue(struct cli_state *cli,
- void (*fn)(struct print_job_info *));
-BOOL cli_chkpath(struct cli_state *cli, char *path);
-BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
- int *grp);
-BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp);
-BOOL cli_message_end(struct cli_state *cli, int grp);
-BOOL cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
-BOOL get_any_dc_name(const char *domain, char *srv_name);
-
-/*The following definitions come from libsmb/credentials.c */
-
-char *credstr(const uchar *cred);
-void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, const char *pass,
- uchar session_key[8]);
-void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp,
- DOM_CHAL *cred);
-int cred_assert(const DOM_CHAL *cred, uchar session_key[8],
- DOM_CHAL *stored_cred, UTIME timestamp);
-BOOL clnt_deal_with_creds(uchar sess_key[8],
- DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred);
-BOOL deal_with_creds(uchar sess_key[8],
- DOM_CRED *sto_clnt_cred,
- const DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred);
-
-/*The following definitions come from libsmb/namequery.c */
-
-BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
- struct in_addr to_ip,char *master,char *rname,
- void (*fn)(struct packet_struct *));
-struct in_addr *name_query(int fd,const char *name,int name_type, BOOL bcast,BOOL recurse,
- struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *));
-FILE *startlmhosts(char *fname);
-BOOL getlmhostsent( FILE *fp, pstring name, int *name_type, struct in_addr *ipaddr);
-void endlmhosts(FILE *fp);
-BOOL is_ip_address(const char *name);
-BOOL resolve_name(const char *name, struct in_addr *return_ip, int name_type);
-BOOL resolve_srv_name(const char* srv_name, fstring dest_host,
- struct in_addr *ip);
-BOOL find_master_ip(char *group, struct in_addr *master_ip);
-
-/*The following definitions come from libsmb/nmblib.c */
-
-void debug_nmb_packet(struct packet_struct *p);
-char *nmb_namestr(struct nmb_name *n);
-void nmb_safe_namestr(struct nmb_name *n, char *str, size_t len);
-struct packet_struct *copy_packet(struct packet_struct *packet);
-void free_packet(struct packet_struct *packet);
-struct packet_struct *read_packet(int fd,enum packet_type packet_type);
-void make_nmb_name( struct nmb_name *n, const char *name, int type, const char *this_scope );
-BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
-BOOL send_packet(struct packet_struct *p);
-struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
-void sort_query_replies(char *data, int n, struct in_addr ip);
-BOOL read_nmb_sock(int c, struct nmb_state *con);
-int get_nmb_sock(void);
-char *dns_to_netbios_name(char *dns_name);
-int name_mangle( char *In, char *Out, char name_type );
-int name_extract(char *buf,int ofs,char *name);
-int name_len(char *s1);
-
-/*The following definitions come from libsmb/nterr.c */
-
-BOOL get_safe_nt_error_msg(uint32 nt_code, char *msg, size_t len);
-const char *get_nt_error_msg(uint32 nt_code);
-
-/*The following definitions come from libsmb/pwd_cache.c */
-
-void pwd_init(struct pwd_info *pwd);
-BOOL pwd_is_nullpwd(const struct pwd_info *pwd);
-void pwd_obfuscate_key(struct pwd_info *pwd, uint32 int_key, char *str_key);
-BOOL pwd_compare(const struct pwd_info *_pwd1, const struct pwd_info *_pwd2);
-void pwd_read(struct pwd_info *pwd, char *passwd_report, BOOL do_encrypt);
-void pwd_set_nullpwd(struct pwd_info *pwd);
-void pwd_set_cleartext(struct pwd_info *pwd, char *clr);
-void pwd_get_cleartext(struct pwd_info *pwd, char *clr);
-void pwd_set_lm_nt_16(struct pwd_info *pwd,
- const uchar lm_pwd[16],
- const uchar nt_pwd[16]);
-void pwd_get_lm_nt_16(const struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]);
-void pwd_make_lm_nt_16(struct pwd_info *pwd, char *clr);
-void pwd_make_lm_nt_owf2(struct pwd_info *pwd, const uchar srv_key[8],
- const char *user, const char *server, const char *domain,
- uchar sess_key[16]);
-void pwd_make_lm_nt_owf(struct pwd_info *pwd, uchar cryptkey[8],
- uchar sess_key[16]);
-void pwd_get_lm_nt_owf(struct pwd_info *pwd, uchar lm_owf[24],
- uchar *nt_owf, size_t *nt_owf_len);
-
-/*The following definitions come from libsmb/smbdes.c */
-
-void smbhash(uchar *out, const uchar *in, const uchar *key, int forw);
-void E_P16(uchar *p14,uchar *p16);
-void E_P24(const uchar *p21, const uchar *c8, uchar *p24);
-void D_P16(const uchar *p14, const uchar *in, uchar *out);
-void E_old_pw_hash( const uchar *p14, const uchar *in, uchar *out);
-void cred_hash1(uchar *out, const uchar *in, const uchar *key);
-void cred_hash2(uchar *out,uchar *in,uchar *key);
-void cred_hash3(uchar *out, const uchar *in,uchar *key, int forw);
-void SamOEMhash( uchar *data, const uchar *key, int val);
-void sam_pwd_hash(uint32 rid, const uchar *in, uchar *out, int forw);
-
-/*The following definitions come from libsmb/smbencrypt.c */
-
-void SMBencrypt(uchar * pwrd, uchar * c8, uchar * p24);
-void SMBNTencrypt(uchar * pwrd, uchar * c8, uchar * p24);
-void E_md4hash(uchar * pwrd, uchar * p16);
-void lm_owf_genW(const UNISTR2 * pwd, uchar p16[16]);
-void lm_owf_gen(const char *pwd, uchar p16[16]);
-void nt_owf_genW(const UNISTR2 * pwd, uchar nt_p16[16]);
-void nt_owf_gen(const char *pwd, uchar nt_p16[16]);
-void nt_lm_owf_genW(const UNISTR2 * pwd, uchar nt_p16[16], uchar lm_p16[16]);
-void nt_lm_owf_gen(const char *pwd, uchar nt_p16[16], uchar lm_p16[16]);
-void SMBOWFencrypt(const uchar pwrd[16], const uchar * c8, uchar p24[24]);
-void SMBOWFencrypt_ntv2(const uchar kr[16],
- const uchar * srv_chal, int srv_chal_len,
- const uchar * cli_chal, int cli_chal_len,
- char resp_buf[16]);
-void SMBsesskeygen_ntv2(const uchar kr[16],
- const uchar * nt_resp, char sess_key[16]);
-void SMBsesskeygen_ntv1(const uchar kr[16],
- const uchar * nt_resp, char sess_key[16]);
-void SMBgenclientchals(char *lm_cli_chal,
- char *nt_cli_chal, int *nt_cli_chal_len,
- const char *srv, const char *dom);
-void ntv2_owf_gen(const uchar owf[16],
- const char *user_n, const char *domain_n, uchar kr_buf[16]);
-void NTLMSSPOWFencrypt(const uchar pwrd[8], const uchar * ntlmchalresp,
- uchar p24[24]);
-BOOL make_oem_passwd_hash(uchar data[516],
- const char *pwrd, int new_pw_len,
- const uchar old_pw_hash[16], BOOL unicode);
-BOOL nt_encrypt_string2(STRING2 * out, const STRING2 * in, const uchar * key);
-BOOL nt_decrypt_string2(STRING2 * out, const STRING2 * in, const uchar * key);
-void create_ntlmssp_resp(struct pwd_info *pwd,
- char *domain, char *user_name, char *my_name,
- uint32 ntlmssp_cli_flgs, prs_struct * auth_resp);
-BOOL decode_pw_buffer(const char buffer[516], char *new_pwrd,
- int new_pwrd_size, uint32 * new_pw_len);
-BOOL encode_pw_buffer(char buffer[516], const char *new_pass,
- int new_pw_len, BOOL nt_pass_set);
-
-/*The following definitions come from libsmb/smberr.c */
-
-char *smb_err_msg(uint8 class, uint32 num);
-BOOL smb_safe_err_msg(uint8 class, uint32 num, char *ret, size_t len);
-BOOL smb_safe_errstr(char *inbuf, char *msg, size_t len);
-char *smb_errstr(char *inbuf);
-
/*The following definitions come from nsswitch/winbindd.c */
void exit_server(char *reason);
@@ -1712,7 +1712,7 @@ BOOL make_q_query_sec_obj(LSA_Q_QUERY_SEC_OBJ * q_q, const POLICY_HND *hnd,
BOOL lsa_io_q_query_sec_obj(char *desc, LSA_Q_QUERY_SEC_OBJ * q_q, prs_struct * ps,
int depth);
BOOL lsa_io_r_query_sec_obj(char *desc, LSA_R_QUERY_SEC_OBJ *r_u, prs_struct *ps, int depth);
-BOOL make_q_query(LSA_Q_QUERY_INFO * q_q, POLICY_HND *hnd, uint16 info_class);
+BOOL make_q_query(LSA_Q_QUERY_INFO * q_q, POLICY_HND *hnd, uint8 info_class);
BOOL lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO * q_q, prs_struct * ps,
int depth);
BOOL make_q_create_secret(LSA_Q_CREATE_SECRET * q_o,
@@ -2119,9 +2119,11 @@ BOOL smb_io_rpc_hdr_nack(char *desc, RPC_HDR_NACK * rpc, prs_struct * ps,
int depth);
BOOL smb_io_rpc_hdr_fault(char *desc, RPC_HDR_FAULT * rpc, prs_struct * ps,
int depth);
+BOOL smb_io_rpc_uuid(char *desc, RPC_UUID * uuid, prs_struct * ps,
+ int depth);
BOOL make_rpc_hdr_rb(RPC_HDR_RB * rpc,
uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
- uint32 num_elements, uint16 context_id,
+ uint8 num_elements, uint16 context_id,
uint8 num_syntaxes, RPC_IFACE * abstract,
RPC_IFACE * transfer);
BOOL smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB * rpc, prs_struct * ps,
diff --git a/source/lib/util_hnd.c b/source/lib/util_hnd.c
index 7715ba7aefc..1c140dadf82 100644
--- a/source/lib/util_hnd.c
+++ b/source/lib/util_hnd.c
@@ -75,19 +75,22 @@ struct policy_cache *get_global_hnd_cache(void)
static void create_pol_hnd(POLICY_HND *hnd)
{
static uint32 pol_hnd_low = 0;
- static uint32 pol_hnd_high = 0;
+ NTTIME ntt;
if (hnd == NULL) return;
- /* i severely doubt that pol_hnd_high will ever be non-zero... */
+ ZERO_STRUCTP(hnd);
+
pol_hnd_low++;
- if (pol_hnd_low == 0) pol_hnd_high++;
- SIVAL(hnd->data, 0 , 0x0); /* first bit must be null */
- SIVAL(hnd->data, 4 , pol_hnd_low ); /* second bit is incrementing */
- SIVAL(hnd->data, 8 , pol_hnd_high); /* second bit is incrementing */
- SIVAL(hnd->data, 12, time(NULL)); /* something random */
- SIVAL(hnd->data, 16, getpid()); /* something more random */
+ unix_to_nt_time(&ntt, time(NULL));
+
+ hnd->ptr = 0;
+ hnd->uuid.time_low = ntt.low;
+ hnd->uuid.time_mid = (ntt.high & 0xffff);
+ hnd->uuid.time_hi_and_version = ((ntt.high >> 16) & 0xffff);
+ SIVAL(hnd->uuid.remaining, 0, getpid());
+ SIVAL(hnd->uuid.remaining, 4, pol_hnd_low);
}
/****************************************************************************
@@ -123,14 +126,14 @@ static struct policy *find_policy(struct policy_cache *cache,
for (p=cache->Policy;p;p=p->next) {
if (memcmp(&p->pol_hnd, hnd, sizeof(*hnd)) == 0) {
DEBUG(4,("Found policy hnd[%x] ", p->pnum));
- dump_data(4, (const char *)hnd->data,
- sizeof(hnd->data));
+ dump_data(4, (const char *)hnd,
+ sizeof(*hnd));
return p;
}
}
DEBUG(4,("cache->Policy not found: "));
- dump_data(4, (const char *)hnd->data, sizeof(hnd->data));
+ dump_data(4, (const char *)hnd, sizeof(*hnd));
return NULL;
}
@@ -259,7 +262,7 @@ BOOL register_policy_hnd(struct policy_cache *cache,
p->key.pid, p->key.vuid));
memcpy(&p->pol_hnd, hnd, sizeof(*hnd));
- dump_data(4, (char *)hnd->data, sizeof(hnd->data));
+ dump_data(4, (char *)hnd, sizeof(*hnd));
return True;
}
diff --git a/source/libsmb/clientgen.c b/source/libsmb/clientgen.c
index 5eda1bc356a..5b887cdf56f 100644
--- a/source/libsmb/clientgen.c
+++ b/source/libsmb/clientgen.c
@@ -3230,6 +3230,7 @@ BOOL cli_establish_connection(struct cli_state *cli,
dump_data(100, cli->cryptkey, 8);
#endif
prs_init(&auth_resp, 0x0, 4, False);
+ auth_resp.bigendian = False;
if (cli->use_ntlmv2 != False)
{
diff --git a/source/rpc_client/cli_eventlog.c b/source/rpc_client/cli_eventlog.c
index 435c125cf98..968b7b5ef24 100644
--- a/source/rpc_client/cli_eventlog.c
+++ b/source/rpc_client/cli_eventlog.c
@@ -69,7 +69,7 @@ BOOL event_open(const char* srv_name, const char *log, POLICY_HND *hnd)
{
DEBUG(0,("event_open: unk_6 or unk_7 is an access mask\n"));
/*copy handle */
- *hnd->data = *r.pol.data;
+ *hnd = r.pol;
valid_pol = register_policy_hnd(get_global_hnd_cache(), cli_con_sec_ctx(con),
hnd, 0x01) &&
set_policy_con(get_global_hnd_cache(), hnd, con,
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c
index f350e7ede58..f00daf2b4da 100644
--- a/source/rpc_client/cli_lsarpc.c
+++ b/source/rpc_client/cli_lsarpc.c
@@ -1234,23 +1234,7 @@ BOOL lsa_close(POLICY_HND *hnd)
if (p)
{
- /* check that the returned policy handle is all zeros */
- uint32 i;
valid_close = True;
-
- for (i = 0; i < sizeof(r_c.pol.data); i++)
- {
- if (r_c.pol.data[i] != 0)
- {
- valid_close = False;
- break;
- }
- }
- if (!valid_close)
- {
- DEBUG(0,
- ("LSA_CLOSE: non-zero handle returned\n"));
- }
}
}
diff --git a/source/rpc_client/cli_reg.c b/source/rpc_client/cli_reg.c
index 94f526b4d87..7f0b8df301b 100644
--- a/source/rpc_client/cli_reg.c
+++ b/source/rpc_client/cli_reg.c
@@ -1084,22 +1084,7 @@ BOOL reg_close( POLICY_HND *hnd)
if (p)
{
- /* check that the returned policy handle is all zeros */
- uint32 i;
valid_close = True;
-
- for (i = 0; i < sizeof(r_c.pol.data); i++)
- {
- if (r_c.pol.data[i] != 0)
- {
- valid_close = False;
- break;
- }
- }
- if (!valid_close)
- {
- DEBUG(0,("REG_CLOSE: non-zero handle returned\n"));
- }
}
}
diff --git a/source/rpc_client/cli_samr.c b/source/rpc_client/cli_samr.c
index b233f70e15a..627d90ae47e 100644
--- a/source/rpc_client/cli_samr.c
+++ b/source/rpc_client/cli_samr.c
@@ -2465,22 +2465,7 @@ BOOL samr_close( POLICY_HND *hnd)
if (p)
{
- /* check that the returned policy handle is all zeros */
- uint32 i;
valid_close = True;
-
- for (i = 0; i < sizeof(r_c.pol.data); i++)
- {
- if (r_c.pol.data[i] != 0)
- {
- valid_close = False;
- break;
- }
- }
- if (!valid_close)
- {
- DEBUG(4,("SAMR_CLOSE_HND: non-zero handle returned\n"));
- }
}
}
diff --git a/source/rpc_client/cli_spoolss.c b/source/rpc_client/cli_spoolss.c
index 66b479094c4..5c313ed25d0 100644
--- a/source/rpc_client/cli_spoolss.c
+++ b/source/rpc_client/cli_spoolss.c
@@ -297,22 +297,7 @@ BOOL spoolss_closeprinter(POLICY_HND *hnd)
if (p)
{
- /* check that the returned policy handle is all zeros */
- uint32 i;
valid_close = True;
-
- for (i = 0; i < sizeof(r_c.handle.data); i++)
- {
- if (r_c.handle.data[i] != 0)
- {
- valid_close = False;
- break;
- }
- }
- if (!valid_close)
- {
- DEBUG(0,("SPOOL_CLOSEPRINTER: non-zero handle returned\n"));
- }
}
}
diff --git a/source/rpc_client/cli_svcctl.c b/source/rpc_client/cli_svcctl.c
index 533656c620e..08af617afaa 100644
--- a/source/rpc_client/cli_svcctl.c
+++ b/source/rpc_client/cli_svcctl.c
@@ -491,22 +491,7 @@ BOOL svc_close(POLICY_HND *hnd)
if (p)
{
- /* check that the returned policy handle is all zeros */
- uint32 i;
valid_close = True;
-
- for (i = 0; i < sizeof(r_c.pol.data); i++)
- {
- if (r_c.pol.data[i] != 0)
- {
- valid_close = False;
- break;
- }
- }
- if (!valid_close)
- {
- DEBUG(1,("SVC_CLOSE: non-zero handle returned\n"));
- }
}
}
diff --git a/source/rpc_parse/parse_lsa.c b/source/rpc_parse/parse_lsa.c
index 871b06682f9..83161b70896 100644
--- a/source/rpc_parse/parse_lsa.c
+++ b/source/rpc_parse/parse_lsa.c
@@ -534,7 +534,7 @@ BOOL lsa_io_r_query_sec_obj(char *desc, LSA_R_QUERY_SEC_OBJ *r_u, prs_struct *p
/*******************************************************************
makes an LSA_Q_QUERY_INFO structure.
********************************************************************/
-BOOL make_q_query(LSA_Q_QUERY_INFO * q_q, POLICY_HND *hnd, uint16 info_class)
+BOOL make_q_query(LSA_Q_QUERY_INFO * q_q, POLICY_HND *hnd, uint8 info_class)
{
if (q_q == NULL || hnd == NULL)
return False;
@@ -562,7 +562,8 @@ BOOL lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO * q_q, prs_struct * ps,
smb_io_pol_hnd("", &(q_q->pol), ps, depth);
- prs_uint16("info_class", ps, depth, &(q_q->info_class));
+ prs_uint8("info_class", ps, depth, &q_q->info_class);
+ prs_align(ps);
return True;
}
diff --git a/source/rpc_parse/parse_misc.c b/source/rpc_parse/parse_misc.c
index 5ec0496f76d..4007147a9a0 100644
--- a/source/rpc_parse/parse_misc.c
+++ b/source/rpc_parse/parse_misc.c
@@ -1298,7 +1298,8 @@ BOOL smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth)
prs_align(ps);
- prs_uint8s (False, "data", ps, depth, pol->data, POL_HND_SIZE);
+ prs_uint32("ptr", ps, depth, &pol->ptr);
+ smb_io_rpc_uuid("uuid", &pol->uuid, ps, depth);
return True;
}
diff --git a/source/rpc_parse/parse_rpc.c b/source/rpc_parse/parse_rpc.c
index c4f8fd06235..773dfc6eab0 100644
--- a/source/rpc_parse/parse_rpc.c
+++ b/source/rpc_parse/parse_rpc.c
@@ -291,6 +291,30 @@ BOOL smb_io_rpc_hdr_fault(char *desc, RPC_HDR_FAULT * rpc, prs_struct * ps,
}
/*******************************************************************
+ Reads or writes an RPC_UUID structure.
+********************************************************************/
+BOOL smb_io_rpc_uuid(char *desc, RPC_UUID * uuid, prs_struct * ps,
+ int depth)
+{
+ if (uuid == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "smb_io_rpc_iface");
+ depth++;
+
+ prs_align(ps);
+
+ prs_uint32("time_low", ps, depth, &uuid->time_low);
+ prs_uint16("time_mid", ps, depth, &uuid->time_mid);
+ prs_uint16("time_hiv", ps, depth, &uuid->time_hi_and_version);
+
+ prs_uint8s(False, "rem", ps, depth, uuid->remaining,
+ sizeof(uuid->remaining));
+
+ return True;
+}
+
+/*******************************************************************
Reads or writes an RPC_IFACE structure.
********************************************************************/
static BOOL smb_io_rpc_iface(char *desc, RPC_IFACE * ifc, prs_struct * ps,
@@ -304,12 +328,7 @@ static BOOL smb_io_rpc_iface(char *desc, RPC_IFACE * ifc, prs_struct * ps,
prs_align(ps);
- prs_uint32("time_low", ps, depth, &ifc->uuid.time_low);
- prs_uint16("time_mid", ps, depth, &ifc->uuid.time_mid);
- prs_uint16("time_hiv", ps, depth, &ifc->uuid.time_hi_and_version);
-
- prs_uint8s(False, "uuid ", ps, depth, ifc->uuid.remaining,
- sizeof(ifc->uuid.remaining));
+ smb_io_rpc_uuid("uuid", &ifc->uuid, ps, depth);
prs_uint32("version", ps, depth, &ifc->version);
return True;
@@ -397,7 +416,7 @@ creates an RPC_HDR_RB structure.
********************************************************************/
BOOL make_rpc_hdr_rb(RPC_HDR_RB * rpc,
uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
- uint32 num_elements, uint16 context_id,
+ uint8 num_elements, uint16 context_id,
uint8 num_syntaxes, RPC_IFACE * abstract,
RPC_IFACE * transfer)
{
@@ -433,9 +452,10 @@ BOOL smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB * rpc, prs_struct * ps,
smb_io_rpc_hdr_bba("", &(rpc->bba), ps, depth);
- prs_uint32("num_elements", ps, depth, &(rpc->num_elements));
- prs_uint16("context_id ", ps, depth, &(rpc->context_id));
- prs_uint8("num_syntaxes", ps, depth, &(rpc->num_syntaxes));
+ prs_uint8("num_elements", ps, depth, &rpc->num_elements);
+ prs_align(ps);
+ prs_uint16("context_id ", ps, depth, &rpc->context_id);
+ prs_uint8("num_syntaxes", ps, depth, &rpc->num_syntaxes);
smb_io_rpc_iface("", &(rpc->abstract), ps, depth);
smb_io_rpc_iface("", &(rpc->transfer), ps, depth);
diff --git a/source/rpc_parse/parse_spoolss.c b/source/rpc_parse/parse_spoolss.c
index 22e072bd21e..0d833a7a109 100644
--- a/source/rpc_parse/parse_spoolss.c
+++ b/source/rpc_parse/parse_spoolss.c
@@ -77,23 +77,6 @@ BOOL make_systemtime(SYSTEMTIME *systime, struct tm *unixtime)
}
/*******************************************************************
-reads or writes an POLICY_HND structure.
-********************************************************************/
-static BOOL smb_io_prt_hnd(char *desc, POLICY_HND *hnd, prs_struct *ps, int depth)
-{
- if (hnd == NULL) return False;
-
- prs_debug(ps, depth, desc, "smb_io_prt_hnd");
- depth++;
-
- prs_align(ps);
-
- prs_uint8s (False, "data", ps, depth, hnd->data, POLICY_HND_SIZE);
-
- return True;
-}
-
-/*******************************************************************
reads or writes an DOC_INFO structure.
********************************************************************/
static BOOL smb_io_doc_info_1(char *desc, DOC_INFO_1 *info_1, prs_struct *ps, int depth)
@@ -403,7 +386,7 @@ BOOL spoolss_io_r_open_printer_ex(char *desc, SPOOL_R_OPEN_PRINTER_EX *r_u, prs_
depth++;
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(r_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&r_u->handle,ps,depth);
/* prs_align(ps);*/
@@ -533,7 +516,7 @@ BOOL spoolss_io_q_getprinterdata(char *desc, SPOOL_Q_GETPRINTERDATA *q_u, prs_st
depth++;
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_align(ps);
smb_io_unistr2("", &(q_u->valuename),True,ps,depth);
prs_align(ps);
@@ -595,7 +578,7 @@ BOOL spoolss_io_q_closeprinter(char *desc, SPOOL_Q_CLOSEPRINTER *q_u, prs_struct
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
return True;
}
@@ -611,7 +594,7 @@ BOOL spoolss_io_r_closeprinter(char *desc, SPOOL_R_CLOSEPRINTER *r_u, prs_struct
depth++;
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(r_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(r_u->handle),ps,depth);
prs_uint32("status", ps, depth, &(r_u->status));
@@ -631,7 +614,7 @@ BOOL spoolss_io_q_startdocprinter(char *desc, SPOOL_Q_STARTDOCPRINTER *q_u, prs_
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
smb_io_doc_info_container("",&(q_u->doc_info_container), ps, depth);
@@ -665,7 +648,7 @@ BOOL spoolss_io_q_enddocprinter(char *desc, SPOOL_Q_ENDDOCPRINTER *q_u, prs_stru
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
return True;
}
@@ -696,7 +679,7 @@ BOOL spoolss_io_q_startpageprinter(char *desc, SPOOL_Q_STARTPAGEPRINTER *q_u, pr
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
return True;
}
@@ -727,7 +710,7 @@ BOOL spoolss_io_q_endpageprinter(char *desc, SPOOL_Q_ENDPAGEPRINTER *q_u, prs_st
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
return True;
}
@@ -758,7 +741,7 @@ BOOL spoolss_io_q_writeprinter(char *desc, SPOOL_Q_WRITEPRINTER *q_u, prs_struct
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("buffer_size", ps, depth, &(q_u->buffer_size));
if (q_u->buffer_size!=0)
@@ -799,7 +782,7 @@ BOOL spoolss_io_q_rffpcnex(char *desc, SPOOL_Q_RFFPCNEX *q_u,
depth++;
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("flags", ps, depth, &(q_u->flags));
prs_uint32("options", ps, depth, &(q_u->options));
prs_uint32("useless ptr", ps, depth, &useless_ptr);
@@ -844,7 +827,7 @@ BOOL spoolss_io_q_rfnpcnex(char *desc, SPOOL_Q_RFNPCNEX *q_u,
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("change", ps, depth, &(q_u->change));
@@ -1782,7 +1765,7 @@ BOOL spoolss_io_q_getprinterdriver2(char *desc,
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("pointer", ps, depth, &useless_ptr);
smb_io_unistr2("architecture", &(q_u->architecture),True,ps,depth);
@@ -2390,7 +2373,7 @@ BOOL spoolss_io_q_getprinter(char *desc, SPOOL_Q_GETPRINTER *q_u,
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("level", ps, depth, &(q_u->level));
@@ -2469,7 +2452,7 @@ BOOL spoolss_io_q_setprinter(char *desc, SPOOL_Q_SETPRINTER *q_u, prs_struct *ps
prs_align(ps);
- smb_io_prt_hnd("printer handle", &(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle", &(q_u->handle),ps,depth);
prs_uint32("level", ps, depth, &(q_u->level));
/* again a designed mess */
@@ -2513,7 +2496,7 @@ BOOL spoolss_io_q_fcpn(char *desc, SPOOL_Q_FCPN *q_u, prs_struct *ps, int depth)
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
return True;
}
@@ -2543,7 +2526,7 @@ BOOL spoolss_io_q_addjob(char *desc, SPOOL_Q_ADDJOB *q_u, prs_struct *ps, int de
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("level", ps, depth, &(q_u->level));
spoolss_io_read_buffer("", ps, depth, &(q_u->buffer));
@@ -2775,7 +2758,7 @@ BOOL spoolss_io_q_enumjobs(char *desc, SPOOL_Q_ENUMJOBS *q_u, prs_struct *ps, in
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("firstjob", ps, depth, &(q_u->firstjob));
prs_uint32("numofjobs", ps, depth, &(q_u->numofjobs));
prs_uint32("level", ps, depth, &(q_u->level));
@@ -2810,7 +2793,7 @@ BOOL spoolss_io_q_schedulejob(char *desc, SPOOL_Q_SCHEDULEJOB *q_u, prs_struct *
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("jobid", ps, depth, &(q_u->jobid));
return True;
@@ -2839,7 +2822,7 @@ BOOL spoolss_io_q_setjob(char *desc, SPOOL_Q_SETJOB *q_u, prs_struct *ps, int de
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("jobid", ps, depth, &(q_u->jobid));
/*
* level is usually 0. If (level!=0) then I'm in trouble !
@@ -3159,7 +3142,7 @@ BOOL spoolss_io_q_enumforms(char *desc, SPOOL_Q_ENUMFORMS *q_u, prs_struct *ps,
depth++;
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("level", ps, depth, &(q_u->level));
spoolss_io_read_buffer("", ps, depth, &(q_u->buffer));
prs_align(ps);
@@ -3502,7 +3485,7 @@ BOOL spoolss_io_r_addprinterex(char *desc, SPOOL_R_ADDPRINTEREX *r_u, prs_struct
prs_debug(ps, depth, desc, "spoolss_io_r_addprinterex");
depth++;
- smb_io_prt_hnd("printer handle",&(r_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(r_u->handle),ps,depth);
prs_uint32("status", ps, depth, &(r_u->status));
@@ -4121,7 +4104,7 @@ BOOL spoolss_io_q_enumprinterdata(char *desc, SPOOL_Q_ENUMPRINTERDATA *q_u, prs_
depth++;
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("index", ps, depth, &(q_u->index));
prs_uint32("valuesize", ps, depth, &(q_u->valuesize));
prs_uint32("datasize", ps, depth, &(q_u->datasize));
@@ -4137,7 +4120,7 @@ BOOL spoolss_io_q_setprinterdata(char *desc, SPOOL_Q_SETPRINTERDATA *q_u, prs_st
depth++;
prs_align(ps);
- smb_io_prt_hnd("printer handle", &(q_u->handle), ps, depth);
+ smb_io_pol_hnd("printer handle", &(q_u->handle), ps, depth);
smb_io_unistr2("", &(q_u->value), True, ps, depth);
prs_align(ps);
@@ -4240,7 +4223,7 @@ BOOL spoolss_io_q_addform(char *desc, SPOOL_Q_ADDFORM *q_u, prs_struct *ps, int
depth++;
prs_align(ps);
- smb_io_prt_hnd("printer handle", &(q_u->handle), ps, depth);
+ smb_io_pol_hnd("printer handle", &(q_u->handle), ps, depth);
prs_uint32("level", ps, depth, &(q_u->level));
prs_uint32("level2", ps, depth, &(q_u->level2));
@@ -4275,7 +4258,7 @@ BOOL spoolss_io_q_setform(char *desc, SPOOL_Q_SETFORM *q_u, prs_struct *ps, int
depth++;
prs_align(ps);
- smb_io_prt_hnd("printer handle", &(q_u->handle), ps, depth);
+ smb_io_pol_hnd("printer handle", &(q_u->handle), ps, depth);
smb_io_unistr2("", &(q_u->name), True, ps, depth);
prs_align(ps);
@@ -4425,7 +4408,7 @@ BOOL spoolss_io_q_getjob(char *desc, SPOOL_Q_GETJOB *q_u, prs_struct *ps, int de
prs_align(ps);
- smb_io_prt_hnd("printer handle",&(q_u->handle),ps,depth);
+ smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth);
prs_uint32("jobid", ps, depth, &(q_u->jobid));
prs_uint32("level", ps, depth, &(q_u->level));