diff options
Diffstat (limited to 'source3')
53 files changed, 463 insertions, 2783 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in index 1bf3c2bbdc..9fbab41f04 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -123,7 +123,7 @@ PASSDB_OBJ = passdb/passdb.o passdb/smbpassfile.o passdb/smbpass.o \ SMBD_OBJ1 = smbd/server.o smbd/files.o smbd/chgpasswd.o smbd/connection.o \ smbd/dfree.o smbd/dir.o smbd/password.o smbd/conn.o smbd/fileio.o \ - smbd/groupname.o smbd/ipc.o smbd/mangle.o smbd/negprot.o \ + smbd/ipc.o smbd/mangle.o smbd/negprot.o \ smbd/message.o smbd/nttrans.o smbd/pipes.o smbd/predict.o \ smbd/quotas.o smbd/reply.o smbd/ssl.o smbd/trans2.o smbd/uid.o \ smbd/dosmode.o smbd/filename.o smbd/open.o smbd/close.o smbd/blocking.o \ @@ -310,3 +310,11 @@ ctags: ctags `find . -name "*.[ch]"` realclean: clean + +# this target is really just for my use. It only works on a limited +# range of machines and is used to produce a list of potentially +# dead (ie. unused) functions in the code. (tridge) +finddead: + nm */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt + nm */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt + comm -13 nmused.txt nmfns.txt diff --git a/source3/client/client.c b/source3/client/client.c index d5dece1626..0d1fe6721c 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -47,6 +47,9 @@ extern BOOL doencrypt; extern pstring user_socket_options; +static int process_tok(fstring tok); +static void cmd_help(char *dum_in, char *dum_out); + /* 30 second timeout on most commands */ #define CLIENT_TIMEOUT (30*1000) #define SHORT_TIMEOUT (5*1000) @@ -134,7 +137,7 @@ extern int Client; /**************************************************************************** send an SMBclose on an SMB file handle ****************************************************************************/ -void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num) +static void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num) { bzero(outbuf,smb_size); set_message(outbuf,3,0,True); @@ -149,6 +152,7 @@ void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num) client_receive_smb(clnt_fd,inbuf,CLIENT_TIMEOUT); } + /**************************************************************************** write to a local file with CR/LF->LF translation if appropriate. return the number taken from the buffer. This may not equal the number written. @@ -472,7 +476,7 @@ static void display_finfo(file_info *finfo) DEBUG(0,(" %-30s%7.7s%10d %s", CNV_LANG(finfo->name), attrib_string(finfo->mode), - finfo->size, + (int)finfo->size, asctime(LocalTime(&t)))); #endif /* LARGE_SMB_OFF_T */ dir_total += finfo->size; @@ -1206,7 +1210,7 @@ static void do_get(char *rname,char *lname,file_info *finfo1) #else /* LARGE_SMB_OFF_T */ DEBUG(2,("getting file %s of size %d bytes as %s ", CNV_LANG(finfo.name), - finfo.size, + (int)finfo.size, lname)); #endif /* LARGE_SMB_OFF_T */ @@ -1220,7 +1224,8 @@ static void do_get(char *rname,char *lname,file_info *finfo1) #ifdef LARGE_SMB_OFF_T DEBUG(3,("nread=%d max_xmit=%d fsize=%.0f\n",nread,max_xmit,(double)finfo.size)); #else /* LARGE_SMB_OFF_T */ - DEBUG(3,("nread=%d max_xmit=%d fsize=%d\n",nread,max_xmit,finfo.size)); + DEBUG(3,("nread=%d max_xmit=%d fsize=%d\n",nread,max_xmit, + (int)finfo.size)); #endif /* LARGE_SMB_OFF_T */ /* 3 possible read types. readbraw if a large block is required. @@ -1902,7 +1907,8 @@ static void do_put(char *rname,char *lname,file_info *finfo) #ifdef LARGE_SMB_OFF_T DEBUG(1,("putting file %s of size %.0f bytes as %s ",lname,(double)finfo->size,CNV_LANG(rname))); #else /* LARGE_SMB_OFF_T */ - DEBUG(1,("putting file %s of size %d bytes as %s ",lname,finfo->size,CNV_LANG(rname))); + DEBUG(1,("putting file %s of size %d bytes as %s ",lname, + (int)finfo->size,CNV_LANG(rname))); #endif /* LARGE_SMB_OFF_T */ if (!maxwrite) @@ -3318,7 +3324,7 @@ static int process_tok(fstring tok) /**************************************************************************** help ****************************************************************************/ -void cmd_help(char *dum_in, char *dum_out) +static void cmd_help(char *dum_in, char *dum_out) { int i=0,j; fstring buf; @@ -3339,6 +3345,8 @@ void cmd_help(char *dum_in, char *dum_out) } } + + /**************************************************************************** wait for keyboard activity, swallowing network packets ****************************************************************************/ diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 502a867f60..376d3aeac6 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -39,6 +39,8 @@ #include "includes.h" #include "clitar.h" +static int clipfind(char **aret, int ret, char *tok); + typedef struct file_info_struct file_info2; struct file_info_struct @@ -973,7 +975,7 @@ static BOOL ensurepath(char *fname, char *inbuf, char *outbuf) return True; } -int padit(char *buf, int bufsize, int padsize) +static int padit(char *buf, int bufsize, int padsize) { int berr= 0; int bytestowrite; @@ -2294,7 +2296,7 @@ int process_tar(char *inbuf, char *outbuf) /**************************************************************************** Find a token (filename) in a clip list ***************************************************************************/ -int clipfind(char **aret, int ret, char *tok) +static int clipfind(char **aret, int ret, char *tok) { if (aret==NULL) return 0; diff --git a/source3/include/proto.h b/source3/include/proto.h index d5cfb28166..7430affd34 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5,9 +5,7 @@ /*The following definitions come from client/client.c */ -void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num); void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo); -void cmd_help(char *dum_in, char *dum_out); /*The following definitions come from client/clientutil.c */ @@ -34,13 +32,11 @@ BOOL cli_reopen_connection(char *inbuf,char *outbuf); /*The following definitions come from client/clitar.c */ -int padit(char *buf, int bufsize, int padsize); void cmd_block(char *dum_in, char *dum_out); void cmd_tarmode(char *dum_in, char *dum_out); void cmd_setmode(char *dum_in, char *dum_out); void cmd_tar(char *inbuf, char *outbuf); int process_tar(char *inbuf, char *outbuf); -int clipfind(char **aret, int ret, char *tok); int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); /*The following definitions come from lib/access.c */ @@ -52,7 +48,6 @@ BOOL check_access(int sock, char *allow_list, char *deny_list); /*The following definitions come from lib/bitmap.c */ struct bitmap *bitmap_allocate(int n); -void bitmap_free(struct bitmap *bm); BOOL bitmap_set(struct bitmap *bm, unsigned i); BOOL bitmap_clear(struct bitmap *bm, unsigned i); int bitmap_find(struct bitmap *bm, unsigned ofs); @@ -96,7 +91,6 @@ char *getsmbpass(char *prompt) ; void load_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); BOOL ismyip(struct in_addr ip); -BOOL ismybcast(struct in_addr bcast); BOOL is_local_net(struct in_addr from); int iface_count(void); BOOL we_are_multihomed(void); @@ -104,7 +98,6 @@ struct interface *get_interface(int n); struct in_addr *iface_n_ip(int n); unsigned iface_hash(void); struct in_addr *iface_bcast(struct in_addr ip); -struct in_addr *iface_nmask(struct in_addr ip); struct in_addr *iface_ip(struct in_addr ip); /*The following definitions come from lib/kanji.c */ @@ -120,17 +113,14 @@ void mdfour(unsigned char *out, unsigned char *in, int n); void mem_init(struct mem_buf *buf, int margin); void mem_create(struct mem_buf *buf, char *data, int size, int margin, BOOL dynamic); -void mem_take(struct mem_buf *mem_to, struct mem_buf *mem_from); BOOL mem_alloc_data(struct mem_buf *buf, int size); BOOL mem_buf_copy(char *copy_into, struct mem_buf *buf, uint32 offset, uint32 len); BOOL mem_buf_init(struct mem_buf **buf, uint32 margin); void mem_buf_free(struct mem_buf **buf); -void mem_free_chain(struct mem_buf **buf); void mem_free_data(struct mem_buf *buf); BOOL mem_realloc_data(struct mem_buf *buf, int new_size); BOOL mem_grow_data(struct mem_buf **buf, BOOL io, int new_size, BOOL force_grow); -BOOL mem_find(struct mem_buf **buf, uint32 offset); uint32 mem_buf_len(struct mem_buf *buf); char *mem_data(struct mem_buf **buf, uint32 offset); @@ -223,8 +213,6 @@ char *tmpdir(void); BOOL is_a_socket(int fd); BOOL next_token(char **ptr,char *buff,char *sep, int bufsize); char **toktocliplist(int *ctok, char *sep); -void *mem_dup( void *from, int size ); -void array_promote(char *array,int elsize,int element); void set_socket_options(int fd, char *options); void close_sockets(void ); BOOL in_group(gid_t group, int current_gid, int ngroups, GID_T *groups); @@ -254,9 +242,7 @@ int smb_len(char *buf); void _smb_setlen(char *buf,int len); void smb_setlen(char *buf,int len); int set_message(char *buf,int num_words,int num_bytes,BOOL zero); -int smb_numwords(char *buf); int smb_buflen(char *buf); -int smb_buf_ofs(char *buf); char *smb_buf(char *buf); int smb_offset(char *p,char *buf); char *skip_string(char *buf,int n); @@ -272,11 +258,9 @@ BOOL strhaslower(char *s); int count_chars(char *s,char c); void make_dir_struct(char *buf,char *mask,char *fname,SMB_OFF_T size,int mode,time_t date); void close_low_fds(void); -int set_blocking(int fd, BOOL set); int write_socket(int fd,char *buf,int len); int read_udp_socket(int fd,char *buf,int len); int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); -int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); BOOL send_keepalive(int client); int read_data(int fd,char *buffer,int N); @@ -291,11 +275,9 @@ BOOL receive_message_or_smb(int smbfd, int oplock_fd, char *buffer, int buffer_len, int timeout, BOOL *got_smb); BOOL send_smb(int fd,char *buffer); -char *name_ptr(char *buf,int ofs); int name_extract(char *buf,int ofs,char *name); int name_len( char *s ); BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); -void msleep(int t); BOOL in_list(char *s,char *list,BOOL casesensitive); BOOL string_init(char **dest,char *src); void string_free(char **s); @@ -307,8 +289,6 @@ void become_daemon(void); BOOL yesno(char *p); char *fgets_slash(char *s2,int maxlen,FILE *f); int set_filelen(int fd, SMB_OFF_T len); -int byte_checksum(char *buf,int len); -char *dirname_dos(char *path,char *buf); void *Realloc(void *p,int size); BOOL get_myname(char *my_name,struct in_addr *ip); BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); @@ -321,8 +301,6 @@ BOOL zero_ip(struct in_addr ip); void reset_globals_after_fork(void); char *client_name(int fd); char *client_addr(int fd); -char *automount_server(char *user_name); -char *automount_path(char *user_name); void standard_sub_basic(char *str); void standard_sub(connection_struct *conn,char *str); BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); @@ -337,8 +315,6 @@ BOOL is_in_path(char *name, name_compare_entry *namelist); void set_namearray(name_compare_entry **ppname_array, char *namelist); void free_namearray(name_compare_entry *name_array); BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); -int file_lock(char *name,int timeout); -void file_unlock(int fd); BOOL is_myname(char *s); void set_remote_arch(enum remote_arch_types type); enum remote_arch_types get_remote_arch(void); @@ -347,13 +323,10 @@ char *unistrn2(uint16 *buf, int len); char *unistr2(uint16 *buf); int struni2(uint16 *p, char *buf); char *unistr(char *buf); -int unistrncpy(char *dst, char *src, int len); int unistrcpy(char *dst, char *src); char *safe_strcpy(char *dest, char *src, int maxlength); char *safe_strcat(char *dest, char *src, int maxlength); -char *align4(char *q, char *base); char *align2(char *q, char *base); -char *align_offset(char *q, char *base, int align_offset_len); void print_asc(int level, unsigned char *buf,int len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); @@ -364,7 +337,6 @@ void zero_free(void *p, int size); /*The following definitions come from libsmb/clientgen.c */ -char *cli_smb_errstr(struct cli_state *cli); char *cli_errstr(struct cli_state *cli); BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len, uint16 *setup, uint32 setup_count, uint32 max_setup_count, @@ -451,7 +423,6 @@ BOOL resolve_name(char *name, struct in_addr *return_ip); /*The following definitions come from libsmb/nmblib.c */ -char *lookup_opcode_name( int opcode ); void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); struct packet_struct *copy_packet(struct packet_struct *packet); @@ -483,7 +454,6 @@ void SamOEMhash( unsigned char *data, unsigned char *key, int val); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16); /*The following definitions come from libsmb/smberr.c */ @@ -548,19 +518,12 @@ int main(int argc,char *argv[]); /*The following definitions come from nmbd/nmbd_become_dmb.c */ -void unbecome_domain_master(char *workgroup_name); void add_domain_names(time_t t); /*The following definitions come from nmbd/nmbd_become_lmb.c */ void insert_permanent_name_into_unicast( struct subnet_record *subrec, struct nmb_name *nmbname, uint16 nb_type ); -void unbecome_local_master_success(struct subnet_record *subrec, - struct userdata_struct *userdata, - struct nmb_name *released_name, - struct in_addr released_ip); -void unbecome_local_master_fail(struct subnet_record *subrec, struct response_record *rrec, - struct nmb_name *fail_name); void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work, BOOL force_new_election); void become_local_master_browser(struct subnet_record *subrec, struct work_record *work); @@ -574,7 +537,6 @@ struct browse_cache_record *create_browser_in_lmb_cache( char *work_name, struct in_addr ip ); struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name ); void expire_lmb_browsers( time_t t ); -void remove_workgroup_lmb_browsers( char *work_group ); /*The following definitions come from nmbd/nmbd_browsesync.c */ @@ -636,7 +598,6 @@ void refresh_my_names(time_t t); /*The following definitions come from nmbd/nmbd_namelistdb.c */ void set_samba_nb_type(void); -BOOL ms_browser_name( char *name, int type ); void remove_name_from_namelist( struct subnet_record *subrec, struct name_record *namerec ); struct name_record *find_name_on_subnet( struct subnet_record *subrec, @@ -774,11 +735,6 @@ struct response_record *queue_node_status( struct subnet_record *subrec, void reply_netbios_packet(struct packet_struct *orig_packet, int rcode, enum netbios_reply_type_code rcv_code, int opcode, int ttl, char *data,int len); -void queue_packet(struct packet_struct *packet); -void process_browse_packet(struct packet_struct *p, char *buf,int len); -void process_lanman_packet(struct packet_struct *p, char *buf,int len); -BOOL validate_nmb_response_packet( struct nmb_packet *nmb ); -BOOL validate_nmb_packet( struct nmb_packet *nmb ); void run_packet_queue(void); void retransmit_or_expire_response_records(time_t t); BOOL listen_for_packets(BOOL run_election); @@ -795,8 +751,6 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len, /*The following definitions come from nmbd/nmbd_responserecordsdb.c */ -void add_response_record(struct subnet_record *subrec, - struct response_record *rrec); void remove_response_record(struct subnet_record *subrec, struct response_record *rrec); struct response_record *make_response_record( struct subnet_record *subrec, @@ -886,7 +840,6 @@ void expire_workgroups_and_servers(time_t t); /*The following definitions come from param/loadparm.c */ -char *lp_string(char *s); char *lp_logfile(void); char *lp_smbrun(void); char *lp_configfile(void); @@ -897,7 +850,6 @@ char *lp_lockdir(void); char *lp_rootdir(void); char *lp_defaultservice(void); char *lp_msg_command(void); -char *lp_dfree_command(void); char *lp_hosts_equiv(void); char *lp_auto_services(void); char *lp_passwd_program(void); @@ -906,8 +858,6 @@ char *lp_passwordserver(void); char *lp_name_resolve_order(void); char *lp_workgroup(void); char *lp_username_map(void); -char *lp_groupname_map(void); -char *lp_character_set(void); char *lp_logon_script(void); char *lp_logon_path(void); char *lp_logon_drive(void); @@ -918,19 +868,15 @@ char *lp_wins_server(void); char *lp_interfaces(void); char *lp_socket_address(void); char *lp_nis_home_map_name(void); -char *lp_announce_version(void); char *lp_netbios_aliases(void); char *lp_driverfile(void); char *lp_panic_action(void); char *lp_domain_sid(void); -char *lp_domain_other_sids(void); char *lp_domain_groups(void); char *lp_domain_admin_group(void); char *lp_domain_guest_group(void); char *lp_domain_admin_users(void); char *lp_domain_guest_users(void); -char *lp_domain_hostsallow(void); -char *lp_domain_hostsdeny(void); char *lp_ldap_server(void); char *lp_ldap_suffix(void); char *lp_ldap_filter(void); @@ -961,7 +907,6 @@ BOOL lp_domain_logons(void); BOOL lp_preferred_master(void); BOOL lp_load_printers(void); BOOL lp_use_rhosts(void); -BOOL lp_getwdcache(void); BOOL lp_readprediction(void); BOOL lp_readbmpx(void); BOOL lp_readraw(void); @@ -975,7 +920,6 @@ BOOL lp_timestamp_logs(void); BOOL lp_browse_list(void); BOOL lp_unix_realname(void); BOOL lp_nis_home_map(void); -BOOL lp_time_server(void); BOOL lp_bind_interfaces_only(void); BOOL lp_net_wksta_user_logon(void); BOOL lp_unix_password_sync(void); @@ -987,11 +931,8 @@ int lp_max_ttl(void); int lp_max_wins_ttl(void); int lp_min_wins_ttl(void); int lp_max_log_size(void); -int lp_mangledstack(void); int lp_maxxmit(void); int lp_maxmux(void); -int lp_maxpacket(void); -int lp_keepalive(void); int lp_passwordlevel(void); int lp_usernamelevel(void); int lp_readsize(void); @@ -1003,7 +944,6 @@ int lp_maxdisksize(void); int lp_lpqcachetime(void); int lp_syslog(void); int lp_client_code_page(void); -int lp_announce_as(void); int lp_lm_announce(void); int lp_lm_interval(void); int lp_machine_password_timeout(void); @@ -1040,7 +980,6 @@ char *lp_force_user(int ); char *lp_force_group(int ); char *lp_readlist(int ); char *lp_writelist(int ); -char *lp_volume(int ); char *lp_mangled_map(int ); char *lp_veto_files(int ); char *lp_hide_files(int ); @@ -1105,7 +1044,6 @@ int lp_numservices(void); void lp_dump(FILE *f, BOOL show_defaults); int lp_servicenumber(char *pszServiceName); char *volume_label(int snum); -void lp_rename_service(int snum, char *new_name); void lp_remove_service(int snum); void lp_copy_service(int snum, char *new_name); int lp_default_server_announce(void); @@ -1141,8 +1079,6 @@ struct smb_passwd *iterate_getsmbpwnam(char *name); void *startsmbpwent(BOOL update); void endsmbpwent(void *vp); struct smb_passwd *getsmbpwent(void *vp); -unsigned long getsmbpwpos(void *vp); -BOOL setsmbpwpos(void *vp, unsigned long tok); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); struct smb_passwd *getsmbpwnam(char *name); @@ -1150,39 +1086,21 @@ struct smb_passwd *getsmbpwuid(uid_t smb_userid); struct sam_passwd *iterate_getsam21pwnam(char *name); struct sam_passwd *iterate_getsam21pwrid(uint32 rid); struct sam_passwd *iterate_getsam21pwuid(uid_t uid); -struct sam_disp_info *getsamdispnam(char *name); struct sam_disp_info *getsamdisprid(uint32 rid); -struct sam_disp_info *getsamdispent(void *vp); struct sam_passwd *getsam21pwent(void *vp); -BOOL add_sam21pwd_entry(struct sam_passwd *newpwd); -BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override); struct sam_passwd *getsam21pwnam(char *name); struct sam_passwd *getsam21pwrid(uint32 rid); -struct sam_passwd *getsam21pwuid(uid_t uid); -void pdb_init_dispinfo(struct sam_disp_info *user); void pdb_init_smb(struct smb_passwd *user); void pdb_init_sam(struct sam_passwd *user); struct sam_disp_info *pdb_sam_to_dispinfo(struct sam_passwd *user); struct smb_passwd *pdb_sam_to_smb(struct sam_passwd *user); -struct sam_passwd *pdb_smb_to_sam(struct smb_passwd *user); -time_t pdb_get_last_set_time(char *p); -void pdb_set_logon_time(char *p, int max_len, time_t t); -void pdb_set_logoff_time(char *p, int max_len, time_t t); -void pdb_set_kickoff_time(char *p, int max_len, time_t t); -void pdb_set_can_change_time(char *p, int max_len, time_t t); -void pdb_set_must_change_time(char *p, int max_len, time_t t); -void pdb_set_last_set_time(char *p, int max_len, time_t t); char *pdb_encode_acct_ctrl(uint16 acct_ctrl); uint16 pdb_decode_acct_ctrl(char *p); BOOL pdb_gethexpwd(char *p, char *pwd); -void pdb_sethexpwd(char *p, char *pwd, uint16 acct_ctrl); BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); BOOL pdb_generate_machine_sid(void); -uid_t pdb_user_rid_to_uid(uint32 u_rid); -gid_t pdb_group_rid_to_gid(uint32 g_rid); uint32 pdb_uid_to_user_rid(uid_t uid); uint32 pdb_gid_to_group_rid(gid_t gid); -BOOL pdb_rid_is_well_known(uint32 rid); BOOL pdb_rid_is_user(uint32 rid); /*The following definitions come from passdb/smbpass.c */ @@ -1251,52 +1169,30 @@ BOOL change_trust_account_password( char *domain, char *remote_machine_list); /*The following definitions come from rpc_client/cli_pipe.c */ -uint32 get_rpc_call_id(void); -BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, - prs_struct *param , prs_struct *data, - prs_struct *rparam, prs_struct *rdata); BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, prs_struct *data, prs_struct *rdata); -BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint16 device_state); -BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, - RPC_IFACE *abstract, RPC_IFACE *transfer, BOOL ntlmssp_auth); BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted); void cli_nt_session_close(struct cli_state *cli); /*The following definitions come from rpc_parse/parse_lsa.c */ void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); -void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth); -void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth); -void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); -void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth); -void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, - uint32 attributes, uint32 sec_qos, - uint32 desired_access); void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth); void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth); -void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class); void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth); void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth); void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, uint32 enum_context, char *domain_name, DOM_SID *domain_sid, uint32 status); void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth); -void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd); -void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth); -void make_lsa_r_close(LSA_R_CLOSE *q_r, POLICY_HND *hnd); -void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth); void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth); -void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth); void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth); -void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth); void lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth); void lsa_io_q_lookup_rids(char *desc, LSA_Q_LOOKUP_RIDS *q_r, prs_struct *ps, int depth); void lsa_io_r_lookup_rids(char *desc, LSA_R_LOOKUP_RIDS *r_r, prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_misc.c */ -void smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth); void smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth); void smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth); uint32 get_enum_hnd(ENUM_HND *enh); @@ -1326,9 +1222,6 @@ void smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth); void make_dom_rid3(DOM_RID3 *rid3, uint32 rid); void smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth); void make_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid); -void smb_io_dom_rid4(char *desc, DOM_RID4 *rid4, prs_struct *ps, int depth); -void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); -void smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth); void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name); void smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth); @@ -1351,21 +1244,10 @@ void smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth); void smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth); void smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); void smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); -void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth); void smb_io_dom_name(char *desc, DOM_NAME *name, prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_net.c */ -void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth); -void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts); -void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth); -void make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status); -void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth); -void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, - uint32 tc_status, char *trusted_dc_name); -void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth); -void make_q_logon_ctrl2(NET_Q_LOGON_CTRL2 *q_l, char *server_name, - uint32 function_code); void net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth); void make_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level, uint32 flags, uint32 pdc_status, uint32 logon_attempts, @@ -1374,8 +1256,6 @@ void net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, i void make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t, uint32 num_doms, char *dom_name); void net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth); -void make_q_trust_dom(NET_Q_TRUST_DOM_LIST *q_l, char *server_name, - uint32 function_code); void net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth); void make_q_req_chal(NET_Q_REQ_CHAL *q_c, char *logon_srv, char *logon_clnt, @@ -1391,25 +1271,16 @@ void make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, DOM_CRED *cred, char nt_cypher[16]); void net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth); void net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth); -void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, - uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, - char *user_name, char *wksta_name, - char sess_key[16], - unsigned char lm_cypher[16], unsigned char nt_cypher[16]); -void net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth); void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, char *user_name, char *wksta_name, unsigned char lm_challenge[8], unsigned char lm_chal_resp[24], unsigned char nt_chal_resp[24]); -void net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth); void make_sam_info(DOM_SAM_INFO *sam, char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, uint16 logon_level, NET_ID_INFO_CTR *ctr, uint16 validation_level); -void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int depth); -void smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth); void make_net_user_info3(NET_USER_INFO_3 *usr, NTTIME *logon_time, @@ -1442,7 +1313,6 @@ void make_net_user_info3(NET_USER_INFO_3 *usr, DOM_SID *dom_sid, char *other_sids); -void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth); void net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth); void net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth); void net_io_q_sam_logoff(char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth); @@ -1461,7 +1331,6 @@ BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8); BOOL prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16); BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32); BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len); -BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len); BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len); BOOL prs_uninotstr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNINOTSTR2 *str); BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str); @@ -1471,27 +1340,16 @@ BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len); /*The following definitions come from rpc_parse/parse_reg.c */ -void make_reg_q_open_policy(REG_Q_OPEN_POLICY *r_q, - uint16 unknown_0, uint32 level, uint16 unknown_1); void reg_io_q_open_policy(char *desc, REG_Q_OPEN_POLICY *r_q, prs_struct *ps, int depth); -void make_reg_r_open_policy(REG_R_OPEN_POLICY *r_r, - POLICY_HND *pol, uint32 status); void reg_io_r_open_policy(char *desc, REG_R_OPEN_POLICY *r_r, prs_struct *ps, int depth); void reg_io_q_close(char *desc, REG_Q_CLOSE *q_u, prs_struct *ps, int depth); void reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth); -void make_reg_q_info(REG_Q_INFO *r_q, - POLICY_HND *pol, char *product_type, - NTTIME *prod_time, uint8 major_version, uint8 minor_version, - uint32 unknown); void reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth); void make_reg_r_info(REG_R_INFO *r_r, uint32 level, char *os_type, uint32 unknown_0, uint32 unknown_1, uint32 status); void reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth); -void make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, - POLICY_HND *pol, char *name, - uint32 unknown_0, uint32 unknown_1, uint16 unknown_2); void reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth); void make_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r, POLICY_HND *pol, uint32 status); @@ -1502,20 +1360,11 @@ void reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, uint32 call_id, int data_len, int auth_len); void smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth); -void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); -void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth); -void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); -void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int depth); -void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); -void smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, int depth); void 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_syntaxes, RPC_IFACE *abstract, RPC_IFACE *transfer); void smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth); -void make_rpc_results(RPC_RESULTS *res, - uint8 num_results, uint16 result, uint16 reason); -void smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, int depth); void make_rpc_hdr_ba(RPC_HDR_BA *rpc, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, char *pipe_addr, @@ -1524,7 +1373,6 @@ void make_rpc_hdr_ba(RPC_HDR_BA *rpc, void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth); void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 data_len, uint16 opnum); void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth); -void make_rpc_hdr_resp(RPC_HDR_RESP *hdr, uint32 data_len); void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth); void make_rpc_auth_ntlmssp_req(RPC_AUTH_NTLMSSP_REQ *req, fstring ntlmssp_str, uint32 ntlmssp_ver, @@ -1539,90 +1387,44 @@ void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_st /*The following definitions come from rpc_parse/parse_samr.c */ -void make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd); void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth); void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth); -void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, - POLICY_HND *connect_pol, uint32 rid, DOM_SID *sid); void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth); void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, - POLICY_HND *domain_pol, uint16 switch_value); -void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int depth); -void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, - POLICY_HND *user_pol, uint16 switch_value); void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid); -void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth); -void make_sam_sid_stuff(SAM_SID_STUFF *stf, - uint16 unknown_2, uint16 unknown_3, - uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, - int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS]); -void sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth); void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, uint16 unknown_2, uint16 unknown_3, uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS], uint32 status); void samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth); -void make_sam_str1(SAM_STR1 *sam, char *sam_acct, char *sam_name, char *sam_desc); -void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, - uint32 len_sam_name, uint32 len_sam_full, uint32 len_sam_desc, - uint32 rid_user, uint16 acb_info); -void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth); -void make_sam_str2(SAM_STR2 *sam, char *sam_acct, char *sam_desc); -void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, - uint32 len_sam_name, uint32 len_sam_desc, - uint32 rid_user, uint16 acb_info); -void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth); -void make_sam_str3(SAM_STR3 *sam, char *grp_acct, char *grp_desc); -void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, - uint32 len_grp_name, uint32 len_grp_desc, uint32 rid_grp); -void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth); -void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid); -void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth); -void make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, - uint16 req_num_entries, uint16 unk_0, - uint16 acb_mask, uint16 unk_1, uint32 size); void samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth); void make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, uint16 total_num_entries, uint16 unk_0, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status); void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth); -void make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size); void samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth); void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, uint32 num_sam_entries, SAM_USER_INFO_21 grps[MAX_SAM_ENTRIES], uint32 status); void samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth); -void make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, - uint16 switch_level, uint32 start_idx, uint32 size); void samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth); void make_sam_info_2(SAM_INFO_2 *sam, uint32 acb_mask, uint32 start_idx, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); -void sam_io_sam_info_2(char *desc, SAM_INFO_2 *sam, prs_struct *ps, int depth); void make_sam_info_1(SAM_INFO_1 *sam, uint32 acb_mask, uint32 start_idx, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); -void sam_io_sam_info_1(char *desc, SAM_INFO_1 *sam, prs_struct *ps, int depth); void make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u, uint16 switch_level, SAM_INFO_CTR *ctr, uint32 status); void samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth); -void make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, - uint16 switch_level, uint32 start_idx, uint32 size); void samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth); void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, uint32 start_idx, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status); void samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth); -void make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e, - POLICY_HND *pol, - uint16 switch_level); void samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth); void make_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, uint16 switch_value, char *acct_desc, @@ -1636,36 +1438,18 @@ void samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *p void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, uint32 num_rids, uint32 *rid, uint32 status); void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, - POLICY_HND *pol, uint32 rid, - uint32 num_gids, uint32 *gid); void samr_io_q_unknown_12(char *desc, SAMR_Q_UNKNOWN_12 *q_u, prs_struct *ps, int depth); void make_samr_r_unknown_12(SAMR_R_UNKNOWN_12 *r_u, uint32 num_aliases, fstring *als_name, uint32 *num_als_usrs, uint32 status); void samr_io_r_unknown_12(char *desc, SAMR_R_UNKNOWN_12 *r_u, prs_struct *ps, int depth); -void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, - POLICY_HND *pol, - uint32 unk_0, uint32 rid); void samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth); void samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth); -void make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, - POLICY_HND *hnd); void samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth); void make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, uint32 num_gids, DOM_GID *gid, uint32 status); void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth); -void make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, - POLICY_HND *hnd, uint16 switch_value); void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth); -void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth); -void make_sam_user_info11(SAM_USER_INFO_11 *usr, - NTTIME *expiry, - char *mach_acct, - uint32 rid_user, - uint32 rid_group, - uint16 acct_ctrl); -void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth); void make_sam_user_info21(SAM_USER_INFO_21 *usr, NTTIME *logon_time, @@ -1695,139 +1479,65 @@ void make_sam_user_info21(SAM_USER_INFO_21 *usr, LOGON_HRS *hrs, uint32 unknown_5, uint32 unknown_6); -void sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *ps, int depth); void make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u, uint16 switch_value, void *info, uint32 status); void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_21(SAMR_Q_UNKNOWN_21 *q_c, - POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); -void samr_io_q_unknown_21(char *desc, SAMR_Q_UNKNOWN_21 *q_u, prs_struct *ps, int depth); -void make_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c, - POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); -void samr_io_q_unknown_13(char *desc, SAMR_Q_UNKNOWN_13 *q_u, prs_struct *ps, int depth); void samr_io_q_unknown_32(char *desc, SAMR_Q_UNKNOWN_32 *q_u, prs_struct *ps, int depth); void samr_io_r_unknown_32(char *desc, SAMR_R_UNKNOWN_32 *r_u, prs_struct *ps, int depth); -void make_samr_q_connect(SAMR_Q_CONNECT *q_u, - char *srv_name, uint32 unknown_0); void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth); void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int depth); -void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, - uint32 unknown_0, uint32 rid); void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth); void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name); -void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth); -void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, - uint16 level, uint32 status); -void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); -void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); -void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_srv.c */ void make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark); -void srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth); void make_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark); -void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth); -void srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_struct *ps, int depth); void make_srv_share_info2_str(SH_INFO_2_STR *sh2, char *net_name, char *remark, char *path, char *passwd); -void srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth); void make_srv_share_info2(SH_INFO_2 *sh2, char *net_name, uint32 type, char *remark, uint32 perms, uint32 max_uses, uint32 num_uses, char *path, char *passwd); -void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth); -void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, int depth); -void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, - char *srv_name, - uint32 share_level, SRV_SHARE_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); void srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth); void make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name); -void srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth); void make_srv_sess_info0(SESS_INFO_0 *ss0, char *name); -void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth); -void srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth); void make_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user); -void srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth); void make_srv_sess_info1(SESS_INFO_1 *ss1, char *name, char *user, uint32 num_opens, uint32 open_time, uint32 idle_time, uint32 user_flags); -void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 sess_level, SRV_SESS_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); void srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth); void make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id); -void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth); -void srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth); void make_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name); -void srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth); void make_srv_conn_info1(CONN_INFO_1 *ss1, uint32 id, uint32 type, uint32 num_opens, uint32 num_users, uint32 open_time, char *usr_name, char *net_name); -void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 conn_level, SRV_CONN_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); void srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth); void make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name); -void srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth); void make_srv_file_info3(FILE_INFO_3 *fl3, uint32 id, uint32 perms, uint32 num_locks, char *path_name, char *user_name); -void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth); -void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, int depth); -void srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 file_level, SRV_FILE_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); void srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth); void make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, uint32 ver_major, uint32 ver_minor, uint32 srv_type, char *comment); -void srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth); void make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, char *comment, uint32 ver_major, uint32 ver_minor, uint32 srv_type, uint32 users, uint32 disc, uint32 hidden, uint32 announce, uint32 ann_delta, uint32 licenses, char *usr_path); -void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth); -void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv, - char *server_name, uint32 switch_value); void srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth); void make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); void srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth); -void make_srv_q_net_srv_set_info(SRV_Q_NET_SRV_SET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr); -void srv_io_q_net_srv_set_info(char *desc, SRV_Q_NET_SRV_SET_INFO *q_n, prs_struct *ps, int depth); -void make_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); -void srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n, prs_struct *ps, int depth); void srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth); -void srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth); void make_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs, uint32 hours, uint32 mins, uint32 secs, uint32 hunds, uint32 zone, uint32 tintervals, uint32 day, @@ -1836,13 +1546,10 @@ void srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct * /*The following definitions come from rpc_parse/parse_wks.c */ -void make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, - char *server, uint16 switch_value) ; void wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth); void make_wks_info_100(WKS_INFO_100 *inf, uint32 platform_id, uint32 ver_major, uint32 ver_minor, char *my_name, char *domain_name); -void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth); void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, uint32 switch_value, WKS_INFO_100 *wks100, int status) ; @@ -1858,7 +1565,6 @@ BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from rpc_server/srv_lsa_hnd.c */ -void create_pol_hnd(POLICY_HND *hnd); void init_lsa_policy_hnd(void); BOOL open_lsa_policy_hnd(POLICY_HND *hnd); int find_lsa_policy_by_hnd(POLICY_HND *hnd); @@ -1867,7 +1573,6 @@ BOOL set_lsa_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status); BOOL set_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid); uint32 get_lsa_policy_samr_rid(POLICY_HND *hnd); BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); -BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, char *name); BOOL close_lsa_policy_hnd(POLICY_HND *hnd); /*The following definitions come from rpc_server/srv_netlog.c */ @@ -1881,7 +1586,6 @@ void init_rpc_pipe_hnd(void); pipes_struct *open_rpc_pipe_p(char *pipe_name, connection_struct *conn, uint16 vuid); int read_pipe(pipes_struct *p, char *data, uint32 pos, int n); -char *get_rpc_pipe_hnd_name(pipes_struct *p); BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); BOOL close_rpc_pipe_hnd(pipes_struct *p, connection_struct *conn); pipes_struct *get_rpc_pipe_p(char *buf, int where); @@ -1901,7 +1605,6 @@ BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from rpc_server/srv_util.c */ -BOOL lookup_wellknown_sid_from_name(char *windows_name, DOM_SID *psid); int make_dom_gids(char *gids_str, DOM_GID **ppgids); BOOL create_rpc_reply(pipes_struct *p, uint32 data_start, uint32 data_end); @@ -1928,7 +1631,6 @@ void process_blocking_lock_queue(time_t t); /*The following definitions come from smbd/chgpasswd.c */ -BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root); BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); BOOL check_lanman_password(char *user, unsigned char *pass1, @@ -2016,13 +1718,10 @@ void sync_file(connection_struct *conn, files_struct *fsp); /*The following definitions come from smbd/filename.c */ -BOOL fname_equal(char *name1, char *name2); -BOOL mangled_equal(char *name1, char *name2); void print_stat_cache_statistics(void); BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, BOOL *bad_path, SMB_STRUCT_STAT *pst); BOOL check_name(char *name,connection_struct *conn); -BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache); /*The following definitions come from smbd/files.c */ @@ -2042,14 +1741,8 @@ void file_chain_reset(void); void file_chain_save(void); void file_chain_restore(void); -/*The following definitions come from smbd/groupname.c */ - -void load_groupname_map(void); -void map_gid_to_sid( gid_t gid, DOM_SID *psid); - /*The following definitions come from smbd/ipc.c */ -int get_printerdrivernumber(int snum); int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int bufsize); /*The following definitions come from smbd/mangle.c */ @@ -2087,7 +1780,6 @@ int reply_ntcancel(connection_struct *conn, int reply_nttranss(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); void remove_pending_change_notify_requests_by_fid(files_struct *fsp); -void remove_pending_change_notify_requests_by_mid(int mid); void process_pending_change_notify_queue(time_t t); int reply_nttrans(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); @@ -2101,14 +1793,11 @@ void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int int open_directory(files_struct *fsp,connection_struct *conn, char *fname, int smb_ofun, int unixmode, int *action); BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op); -int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, - BOOL fcbopen, int *flags); /*The following definitions come from smbd/oplock.c */ BOOL open_oplock_ipc(void); BOOL process_local_message(int sock, char *buffer, int buf_size); -BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval); BOOL request_oplock_break(share_mode_entry *share_entry, SMB_DEV_T dev, SMB_INO_T inode); BOOL attempt_close_oplocked_file(files_struct *fsp); @@ -2117,14 +1806,12 @@ BOOL attempt_close_oplocked_file(files_struct *fsp); void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); -BOOL last_challenge(unsigned char *challenge); user_struct *get_valid_user_struct(uint16 vuid); void invalidate_vuid(uint16 vuid); char *validated_username(uint16 vuid); int setup_groups(char *user, int uid, int gid, int *p_ngroups, GID_T **p_groups); uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); void add_session_user(char *user); -BOOL update_smbpassword_file(char *user, char *password); BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); BOOL smb_password_ok(struct smb_passwd *smb_pass, uchar lm_pass[24], uchar nt_pass[24]); @@ -2162,7 +1849,6 @@ void process_smb(char *inbuf, char *outbuf); char *smb_fn_name(int type); void construct_reply_common(char *inbuf,char *outbuf); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); -int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); void smbd_process(void); /*The following definitions come from smbd/quotas.c */ @@ -2243,8 +1929,6 @@ int reply_getattrE(connection_struct *conn, char *inbuf,char *outbuf, int dum_si /*The following definitions come from smbd/server.c */ -void *dflt_sig(void); -void killkids(void); BOOL reload_services(BOOL test); void exit_server(char *reason); @@ -2289,12 +1973,6 @@ void unbecome_root(BOOL restore_dir); void cgi_load_variables(FILE *f1); char *cgi_variable(char *name); -char *cgi_vnum(int i, char **name); -int cgi_boolean(char *name, int def); -char *quotedup(char *s); -char *urlquote(char *s); -char *quotequotes(char *s); -void quote_spaces(char *buf); void cgi_setup(char *rootdir, int auth_required); char *cgi_baseurl(void); char *cgi_pathinfo(void); diff --git a/source3/lib/bitmap.c b/source3/lib/bitmap.c index ce677f7846..9ccdbb420b 100644 --- a/source3/lib/bitmap.c +++ b/source3/lib/bitmap.c @@ -51,17 +51,6 @@ struct bitmap *bitmap_allocate(int n) } /**************************************************************************** -free a bitmap structure -****************************************************************************/ -void bitmap_free(struct bitmap *bm) -{ - free(bm->b); - bm->b = NULL; - free(bm); -} - - -/**************************************************************************** set a bit in a bitmap ****************************************************************************/ BOOL bitmap_set(struct bitmap *bm, unsigned i) diff --git a/source3/lib/interface.c b/source3/lib/interface.c index 581a2135bd..65d276021c 100644 --- a/source3/lib/interface.c +++ b/source3/lib/interface.c @@ -260,17 +260,6 @@ BOOL ismyip(struct in_addr ip) } /**************************************************************************** - check if a bcast is one of mine - **************************************************************************/ -BOOL ismybcast(struct in_addr bcast) -{ - struct interface *i; - for (i=local_interfaces;i;i=i->next) - if (ip_equal(i->bcast,bcast)) return True; - return False; -} - -/**************************************************************************** check if a packet is from a local (known) net **************************************************************************/ BOOL is_local_net(struct in_addr from) @@ -383,12 +372,6 @@ struct in_addr *iface_bcast(struct in_addr ip) return(i ? &i->bcast : &local_interfaces->bcast); } -struct in_addr *iface_nmask(struct in_addr ip) -{ - struct interface *i = iface_find(ip); - return(i ? &i->nmask : &local_interfaces->nmask); -} - struct in_addr *iface_ip(struct in_addr ip) { struct interface *i = iface_find(ip); diff --git a/source3/lib/membuffer.c b/source3/lib/membuffer.c index 90b07047d3..85f63e8c06 100644 --- a/source3/lib/membuffer.c +++ b/source3/lib/membuffer.c @@ -95,17 +95,6 @@ void mem_create(struct mem_buf *buf, char *data, int size, int margin, BOOL dyna } /******************************************************************* - takes a memory buffer out of one structure: puts it in the other. - NULLs the one that the buffer is being stolen from. - ********************************************************************/ -void mem_take(struct mem_buf *mem_to, struct mem_buf *mem_from) -{ - memcpy(mem_to, mem_from, sizeof(*mem_to)); - - mem_init(mem_from, mem_from->margin); -} - -/******************************************************************* allocate a memory buffer. assume it's empty ********************************************************************/ BOOL mem_alloc_data(struct mem_buf *buf, int size) @@ -218,7 +207,7 @@ void mem_buf_free(struct mem_buf **buf) /******************************************************************* frees a memory buffer chain. assumes that all items are malloced. ********************************************************************/ -void mem_free_chain(struct mem_buf **buf) +static void mem_free_chain(struct mem_buf **buf) { if (buf == NULL) return; if ((*buf) == NULL) return; @@ -312,7 +301,7 @@ BOOL mem_grow_data(struct mem_buf **buf, BOOL io, int new_size, BOOL force_grow) /******************************************************************* search for a memory buffer that falls within the specified offset ********************************************************************/ -BOOL mem_find(struct mem_buf **buf, uint32 offset) +static BOOL mem_find(struct mem_buf **buf, uint32 offset) { struct mem_buf *f; if (buf == NULL) return False; diff --git a/source3/lib/util.c b/source3/lib/util.c index 8432071d80..ad84b17943 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -206,25 +206,10 @@ char **toktocliplist(int *ctok, char *sep) return ret; } - -/* ************************************************************************* ** - * Duplicate a block of memory. - * ************************************************************************* ** - */ -void *mem_dup( void *from, int size ) - { - void *tmp; - - tmp = malloc( size ); - if( NULL != tmp ) - (void)memcpy( tmp, from, size ); - return( tmp ); - } /* mem_dup */ - /**************************************************************************** prompte a dptr (to make it recently used) ****************************************************************************/ -void array_promote(char *array,int elsize,int element) +static void array_promote(char *array,int elsize,int element) { char *p; if (element == 0) @@ -1050,7 +1035,7 @@ int set_message(char *buf,int num_words,int num_bytes,BOOL zero) /******************************************************************* return the number of smb words ********************************************************************/ -int smb_numwords(char *buf) +static int smb_numwords(char *buf) { return (CVAL(buf,smb_wct)); } @@ -1066,7 +1051,7 @@ int smb_buflen(char *buf) /******************************************************************* return a pointer to the smb_buf data area ********************************************************************/ -int smb_buf_ofs(char *buf) +static int smb_buf_ofs(char *buf) { return (smb_size + CVAL(buf,smb_wct)*2); } @@ -1476,6 +1461,26 @@ static void expand_one(char *Mask,int len) } /**************************************************************************** +parse out a directory name from a path name. Assumes dos style filenames. +****************************************************************************/ +static char *dirname_dos(char *path,char *buf) +{ + char *p = strrchr(path,'\\'); + + if (!p) + pstrcpy(buf,path); + else + { + *p = 0; + pstrcpy(buf,path); + *p = '\\'; + } + + return(buf); +} + + +/**************************************************************************** expand a wildcard expression, replacing *s with ?s ****************************************************************************/ void expand_mask(char *Mask,BOOL doext) @@ -1755,7 +1760,7 @@ else if SYSV use O_NDELAY if BSD use FNDELAY ****************************************************************************/ -int set_blocking(int fd, BOOL set) +static int set_blocking(int fd, BOOL set) { int val; #ifdef O_NONBLOCK @@ -1932,33 +1937,6 @@ int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out) return(nread); } -/**************************************************************************** -read data from the client. Maxtime is in milliseconds -****************************************************************************/ -int read_max_udp(int fd,char *buffer,int bufsize,int maxtime) -{ - fd_set fds; - int selrtn; - int nread; - struct timeval timeout; - - FD_ZERO(&fds); - FD_SET(fd,&fds); - - timeout.tv_sec = maxtime / 1000; - timeout.tv_usec = (maxtime % 1000) * 1000; - - selrtn = sys_select(fd+1,&fds,maxtime>0?&timeout:NULL); - - if (!FD_ISSET(fd,&fds)) - return 0; - - nread = read_udp_socket(fd, buffer, bufsize); - - /* return the number got */ - return(nread); -} - /******************************************************************* find the difference in milliseconds between two struct timeval values @@ -2064,7 +2042,7 @@ SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n,char *header,int headlen, #ifdef LARGE_SMB_OFF_T DEBUG(4,("transfer_file n=%.0f (head=%d) called\n",(double)n,headlen)); #else /* LARGE_SMB_OFF_T */ - DEBUG(4,("transfer_file n=%d (head=%d) called\n",n,headlen)); + DEBUG(4,("transfer_file n=%d (head=%d) called\n",(int)n,headlen)); #endif /* LARGE_SMB_OFF_T */ if (size == 0) { @@ -2501,7 +2479,7 @@ BOOL send_smb(int fd,char *buffer) /**************************************************************************** find a pointer to a netbios name ****************************************************************************/ -char *name_ptr(char *buf,int ofs) +static char *name_ptr(char *buf,int ofs) { unsigned char c = *(unsigned char *)(buf+ofs); @@ -2595,7 +2573,7 @@ BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type) /******************************************************************* sleep for a specified number of milliseconds ********************************************************************/ -void msleep(int t) +static void msleep(int t) { int tdiff=0; struct timeval tval,t1,t2; @@ -3307,20 +3285,6 @@ int set_filelen(int fd, SMB_OFF_T len) } -/**************************************************************************** -return the byte checksum of some data -****************************************************************************/ -int byte_checksum(char *buf,int len) -{ - unsigned char *p = (unsigned char *)buf; - int ret = 0; - while (len--) - ret += *p++; - return(ret); -} - - - #ifdef HPUX /**************************************************************************** this is a version of setbuffer() for those machines that only have setvbuf @@ -3333,26 +3297,6 @@ this is a version of setbuffer() for those machines that only have setvbuf /**************************************************************************** -parse out a directory name from a path name. Assumes dos style filenames. -****************************************************************************/ -char *dirname_dos(char *path,char *buf) -{ - char *p = strrchr(path,'\\'); - - if (!p) - pstrcpy(buf,path); - else - { - *p = 0; - pstrcpy(buf,path); - *p = '\\'; - } - - return(buf); -} - - -/**************************************************************************** parse out a filename from a path name. Assumes dos style filenames. ****************************************************************************/ static char *filename_dos(char *path,char *buf) @@ -3953,8 +3897,7 @@ static char *automount_lookup(char *user_name) This is Luke's original function with the NIS lookup code moved out to a separate function. *******************************************************************/ - -char *automount_server(char *user_name) +static char *automount_server(char *user_name) { static pstring server_name; @@ -3988,8 +3931,7 @@ char *automount_server(char *user_name) Patch from jkf@soton.ac.uk Added this to implement %p (NIS auto-map version of %H) *******************************************************************/ - -char *automount_path(char *user_name) +static char *automount_path(char *user_name) { static pstring server_path; @@ -4609,7 +4551,7 @@ BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) (double)offset,(double)count,op,type,strerror(errno))); #else DEBUG(3,("lock failed at offset %d count %d op %d type %d (%s)\n", - offset,count,op,type,strerror(errno))); + (int)offset,(int)count,op,type,strerror(errno))); #endif /* perhaps it doesn't support this sort of locking?? */ @@ -4632,40 +4574,6 @@ BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) } /******************************************************************* -lock a file - returning a open file descriptor or -1 on failure -The timeout is in seconds. 0 means no timeout -********************************************************************/ -int file_lock(char *name,int timeout) -{ - int fd = open(name,O_RDWR|O_CREAT,0666); - time_t t=0; - if (fd < 0) return(-1); - -#if HAVE_FCNTL_LOCK - if (timeout) t = time(NULL); - while (!timeout || (time(NULL)-t < timeout)) { - if (fcntl_lock(fd,SMB_F_SETLK,0,1,F_WRLCK)) return(fd); - msleep(LOCK_RETRY_TIMEOUT); - } - return(-1); -#else - return(fd); -#endif -} - -/******************************************************************* -unlock a file locked by file_lock -********************************************************************/ -void file_unlock(int fd) -{ - if (fd<0) return; -#if HAVE_FCNTL_LOCK - fcntl_lock(fd,SMB_F_SETLK,0,1,F_UNLCK); -#endif - close(fd); -} - -/******************************************************************* is the name specified one of my netbios names returns true is it is equal, false otherwise ********************************************************************/ @@ -4844,26 +4752,6 @@ char *unistr(char *buf) return lbuf; } -/******************************************************************* -strncpy for unicode strings -********************************************************************/ -int unistrncpy(char *dst, char *src, int len) -{ - int num_wchars = 0; - - while (*src && len > 0) - { - *dst++ = *src++; - *dst++ = *src++; - len--; - num_wchars++; - } - *dst++ = 0; - *dst++ = 0; - - return num_wchars; -} - /******************************************************************* strcpy for unicode strings. returns length (in num of wide chars) @@ -4947,18 +4835,6 @@ char *safe_strcat(char *dest, char *src, int maxlength) } /******************************************************************* -align a pointer to a multiple of 4 bytes -********************************************************************/ -char *align4(char *q, char *base) -{ - if ((q - base) & 3) - { - q += 4 - ((q - base) & 3); - } - return q; -} - -/******************************************************************* align a pointer to a multiple of 2 bytes ********************************************************************/ char *align2(char *q, char *base) @@ -4970,20 +4846,6 @@ char *align2(char *q, char *base) return q; } -/******************************************************************* -align a pointer to a multiple of align_offset bytes. looks like it -will work for offsets of 0, 2 and 4... -********************************************************************/ -char *align_offset(char *q, char *base, int align_offset_len) -{ - int mod = ((q - base) & (align_offset_len-1)); - if (align_offset_len != 0 && mod != 0) - { - q += align_offset_len - mod; - } - return q; -} - void print_asc(int level, unsigned char *buf,int len) { int i; diff --git a/source3/lib/util_hnd.c b/source3/lib/util_hnd.c index d65116e646..addedaec90 100644 --- a/source3/lib/util_hnd.c +++ b/source3/lib/util_hnd.c @@ -64,7 +64,7 @@ static struct bitmap *bmap; /**************************************************************************** create a unique policy handle ****************************************************************************/ -void create_pol_hnd(POLICY_HND *hnd) +static void create_pol_hnd(POLICY_HND *hnd) { static uint32 pol_hnd_low = 0; static uint32 pol_hnd_high = 0; @@ -263,26 +263,6 @@ BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name) } /**************************************************************************** - get reg name -****************************************************************************/ -BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, char *name) -{ - struct policy *p = find_lsa_policy(hnd); - - if (p && p->open) { - fstrcpy(name, p->dev.reg.name); - - DEBUG(3,("Getting policy pnum=%x name=%s\n", - p->pnum, name)); - - return True; - } - - DEBUG(3,("Error getting policy\n")); - return False; -} - -/**************************************************************************** close an lsa policy ****************************************************************************/ BOOL close_lsa_policy_hnd(POLICY_HND *hnd) diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 52919d9eb4..c85de92989 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -51,7 +51,7 @@ struct /**************************************************************************** return a description of an SMB error ****************************************************************************/ -char *cli_smb_errstr(struct cli_state *cli) +static char *cli_smb_errstr(struct cli_state *cli) { return smb_errstr(cli->inbuf); } @@ -425,6 +425,7 @@ BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation) return (cli->rap_error == 0); } +#if UNUSED_CODE /**************************************************************************** call a NetShareEnum - try and browse available connections on a host ****************************************************************************/ @@ -480,6 +481,7 @@ BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(char *, uint32, char *) return(count>0); } +#endif /**************************************************************************** call a NetServerEnum for the specified workgroup and servertype mask. @@ -763,6 +765,7 @@ BOOL cli_tdis(struct cli_state *cli) return CVAL(cli->inbuf,smb_rcls) == 0; } +#if UNUSED_CODE /**************************************************************************** rename a file ****************************************************************************/ @@ -799,6 +802,7 @@ BOOL cli_mv(struct cli_state *cli, char *fname_src, char *fname_dst) return True; } +#endif /**************************************************************************** delete a file diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c index ab57590b6f..d08003133f 100644 --- a/source3/libsmb/nmblib.c +++ b/source3/libsmb/nmblib.c @@ -44,8 +44,7 @@ static struct opcode_names { /**************************************************************************** * Lookup a nmb opcode name. ****************************************************************************/ - -char *lookup_opcode_name( int opcode ) +static char *lookup_opcode_name( int opcode ) { struct opcode_names *op_namep; int i; diff --git a/source3/libsmb/smbencrypt.c b/source3/libsmb/smbencrypt.c index 052dae06f1..6840f2e2c8 100644 --- a/source3/libsmb/smbencrypt.c +++ b/source3/libsmb/smbencrypt.c @@ -109,27 +109,4 @@ void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24) E_P24(p21, c8, p24); } -/* Does both the NT and LM owfs of a user's password */ - -void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16) -{ - char passwd[130]; - StrnCpy(passwd, pwd, sizeof(passwd)-1); - - /* Calculate the MD4 hash (NT compatible) of the password */ - memset(nt_p16, '\0', 16); - E_md4hash((uchar *)passwd, (uchar *)nt_p16); - - /* Mangle the passwords into Lanman format */ - passwd[14] = '\0'; - strupper(passwd); - - /* Calculate the SMB (lanman) hash functions of the password */ - - memset(p16, '\0', 16); - E_P16((uchar *) passwd, (uchar *)p16); - - /* clear out local copy of user's password (just being paranoid). */ - bzero(passwd, sizeof(passwd)); -} diff --git a/source3/locking/shmem.c b/source3/locking/shmem.c index 3cdcf82f73..d8ef1d2c53 100644 --- a/source3/locking/shmem.c +++ b/source3/locking/shmem.c @@ -344,7 +344,7 @@ static BOOL smb_shm_register_process(char *processreg_file, pid_t pid, BOOL *oth (int)other_pid, (double)seek_back)); #else DEBUG(5,("smb_shm_register_process : erasing stale record for pid %d (seek_back = %d)\n", - (int)other_pid, seek_back)); + (int)other_pid, (int)seek_back)); #endif other_pid = (pid_t)0; erased_slot = sys_lseek(smb_shm_processes_fd, seek_back, SEEK_CUR); @@ -372,7 +372,7 @@ static BOOL smb_shm_register_process(char *processreg_file, pid_t pid, BOOL *oth (int)pid, (double)free_slot)); #else /* LARGE_SMB_OFF_T */ DEBUG(5,("smb_shm_register_process : writing record for pid %d at offset %d\n", - (int)pid,free_slot)); + (int)pid,(int)free_slot)); #endif /* LARGE_SMB_OFF_T */ sys_lseek(smb_shm_processes_fd, free_slot, SEEK_SET); @@ -416,7 +416,7 @@ static BOOL smb_shm_unregister_process(char *processreg_file, pid_t pid) (int)other_pid, (double)seek_back)); #else /* LARGE_SMB_OFF_T */ DEBUG(5,("smb_shm_unregister_process : erasing record for pid %d (seek_val = %d)\n", - (int)other_pid, seek_back)); + (int)other_pid, (int)seek_back)); #endif /* LARGE_SMB_OFF_T */ other_pid = (pid_t)0; erased_slot = sys_lseek(smb_shm_processes_fd, seek_back, SEEK_CUR); @@ -785,7 +785,8 @@ struct shmem_ops *smb_shm_open(int ronly) #ifdef LARGE_SMB_OFF_T DEBUG(5,("smb_shm_open : using shmem file %s to be of size %.0f\n",file_name,(double)size)); #else /* LARGE_SMB_OFF_T */ - DEBUG(5,("smb_shm_open : using shmem file %s to be of size %d\n",file_name,size)); + DEBUG(5,("smb_shm_open : using shmem file %s to be of size %d\n", + file_name,(int)size)); #endif /* LARGE_SMB_OFF_T */ smb_shm_fd = open(file_name, read_only?O_RDONLY:(O_RDWR|O_CREAT), @@ -863,7 +864,7 @@ struct shmem_ops *smb_shm_open(int ronly) (double)filesize, (double)size)); #else /* LARGE_SMB_OFF_T */ DEBUG(0,("WARNING smb_shm_open : filesize (%d) != expected size (%d), using filesize\n", - filesize,size)); + (int)filesize,(int)size)); #endif /* LARGE_SMB_OFF_T */ size = filesize; diff --git a/source3/nmbd/nmbd_become_dmb.c b/source3/nmbd/nmbd_become_dmb.c index fe02f18f06..cfaec3378d 100644 --- a/source3/nmbd/nmbd_become_dmb.c +++ b/source3/nmbd/nmbd_become_dmb.c @@ -37,114 +37,6 @@ extern uint16 samba_nb_type; /* Samba's NetBIOS type. */ static void become_domain_master_browser_bcast(char *); -/******************************************************************* - Unbecome a domain master browser - name release success function. - ******************************************************************/ - -static void unbecome_dmb_success(struct subnet_record *subrec, - struct userdata_struct *userdata, - struct nmb_name *released_name, - struct in_addr released_ip) -{ - struct work_record *work = find_workgroup_on_subnet(subrec, released_name->name); - struct server_record *servrec; - - if(!work) - { - DEBUG(0,("unbecome_dmb_success: Cannot find workgroup %s on subnet %s\n", - released_name->name, subrec->subnet_name)); - return; - } - - if((servrec = find_server_in_workgroup( work, global_myname)) == NULL) - { - DEBUG(0,("unbecome_dmb_success: Error - cannot find server %s \ -in workgroup %s on subnet %s\n", - global_myname, released_name->name, subrec->subnet_name)); - return; - } - - /* Set the state in the workgroup structure. */ - work->dom_state = DOMAIN_NONE; - - /* Update our server status. */ - servrec->serv.type &= ~SV_TYPE_DOMAIN_MASTER; - - /* Tell the namelist writer to write out a change. */ - subrec->work_changed = True; - - /* Remove any list of local master browsers we are syncing with. */ - remove_workgroup_lmb_browsers(released_name->name); - - /* Delete the known domain master browser name from the workgroup - struct. */ - bzero((char *)&work->dmb_name, sizeof(work->dmb_name)); - putip((char *)&work->dmb_addr, &ipzero); - - if( DEBUGLVL( 0 ) ) - { - dbgtext( "*****\n\nSamba server %s ", global_myname ); - dbgtext( "has stopped being a domain master browser " ); - dbgtext( "for workgroup %s ", work->work_group ); - dbgtext( "on subnet %s.\n\n*****\n", subrec->subnet_name ); - } - -} - -/******************************************************************* - Unbecome a domain master browser - name release fail function. - ******************************************************************/ - -static void unbecome_dmb_fail(struct subnet_record *subrec, - struct response_record *rrec, - struct nmb_name *released_name) -{ - if( DEBUGLVL( 0 ) ) - { - dbgtext( "unbecome_dmb_fail: Failed to unbecome domain master browser " ); - dbgtext( "for workgroup %s ", released_name->name ); - dbgtext( "on subnet %s.\n", subrec->subnet_name ); - } -} - -/******************************************************************* - Unbecome a domain master browser. - ******************************************************************/ - -void unbecome_domain_master(char *workgroup_name) -{ - struct subnet_record *subrec; - - for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) - { - struct work_record *work = find_workgroup_on_subnet(subrec, workgroup_name); - - if(work && (work->dom_state == DOMAIN_MST)) - { - struct name_record *namerec; - struct nmb_name nmbname; - make_nmb_name(&nmbname,workgroup_name,0x1b,scope); - - /* We can only do this if we are a domain master already. */ - DEBUG(2,("unbecome_domain_master: attempting to stop being a domain \ -master browser for workgroup %s on subnet %s\n", - work->work_group, subrec->subnet_name)); - - /* Find the WORKGROUP<1b> name on the subnet namelist. */ - if((namerec = find_name_on_subnet(subrec, &nmbname, FIND_SELF_NAME))==NULL) - { - DEBUG(0,("unbecome_domain_master: Cannot find name %s on subnet %s.\n", - namestr(&nmbname), subrec->subnet_name)); - continue; - } - release_name(subrec, namerec, - unbecome_dmb_success, - unbecome_dmb_fail, - NULL); - } - } -} - /**************************************************************************** Fail to become a Domain Master Browser on a subnet. ****************************************************************************/ diff --git a/source3/nmbd/nmbd_become_lmb.c b/source3/nmbd/nmbd_become_lmb.c index 3fe6f596fa..1e4f070271 100644 --- a/source3/nmbd/nmbd_become_lmb.c +++ b/source3/nmbd/nmbd_become_lmb.c @@ -138,7 +138,7 @@ in workgroup %s on subnet %s\n", Unbecome the local master browser name release success function. ******************************************************************/ -void unbecome_local_master_success(struct subnet_record *subrec, +static void unbecome_local_master_success(struct subnet_record *subrec, struct userdata_struct *userdata, struct nmb_name *released_name, struct in_addr released_ip) @@ -168,7 +168,7 @@ void unbecome_local_master_success(struct subnet_record *subrec, Unbecome the local master browser name release fail function. ******************************************************************/ -void unbecome_local_master_fail(struct subnet_record *subrec, struct response_record *rrec, +static void unbecome_local_master_fail(struct subnet_record *subrec, struct response_record *rrec, struct nmb_name *fail_name) { struct name_record *namerec; diff --git a/source3/nmbd/nmbd_browserdb.c b/source3/nmbd/nmbd_browserdb.c index 8e32dbd570..12ce00df4f 100644 --- a/source3/nmbd/nmbd_browserdb.c +++ b/source3/nmbd/nmbd_browserdb.c @@ -183,37 +183,3 @@ void expire_lmb_browsers( time_t t ) } } } /* expire_lmb_browsers */ - -/* ************************************************************************** ** - * Remove browsers from a named workgroup in the browserlist. - * - * Input: work_group - The name of the work group which is to be removed - * from the browse list. - * Output: none. - * - * ************************************************************************** ** - */ -void remove_workgroup_lmb_browsers( char *work_group ) -{ - struct browse_cache_record *browc; - struct browse_cache_record *nextbrowc; - - for( browc = (struct browse_cache_record *)ubi_dlFirst( lmb_browserlist ); - browc; - browc = nextbrowc ) - { - nextbrowc = (struct browse_cache_record *)ubi_dlNext( browc ); - - if( strequal( work_group, browc->work_group ) ) - { - if( DEBUGLVL( 3 ) ) - { - Debug1( "nmbd_browserdb:remove_workgroup_browsers()\n" ); - Debug1( "Removing lmb entry %s\n", browc->lmb_name ); - } - remove_lmb_browser_entry(browc); - } - } - } /* remove_workgroup_lmb_browsers */ - -/* ========================================================================== */ diff --git a/source3/nmbd/nmbd_namelistdb.c b/source3/nmbd/nmbd_namelistdb.c index 498cbcfdcf..f9b2e3da9a 100644 --- a/source3/nmbd/nmbd_namelistdb.c +++ b/source3/nmbd/nmbd_namelistdb.c @@ -45,21 +45,6 @@ void set_samba_nb_type(void) } /* set_samba_nb_type */ /* ************************************************************************** ** - * Returns True if the netbios name is ^1^2__MSBROWSE__^2^1. - * - * Note: This name is registered if as a master browser or backup browser - * you are responsible for a workgroup (when you announce a domain by - * broadcasting on your local subnet, you announce it as coming from this - * name: see announce_host()). - * - * ************************************************************************** ** - */ -BOOL ms_browser_name( char *name, int type ) - { - return( strequal( name, MSBROWSE ) && (type == 0x01) ); - } /* ms_browser_name */ - -/* ************************************************************************** ** * Convert a NetBIOS name to upper case. * ************************************************************************** ** */ diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c index 816695833a..10ce2da0c1 100644 --- a/source3/nmbd/nmbd_packets.c +++ b/source3/nmbd/nmbd_packets.c @@ -35,6 +35,8 @@ extern int num_response_packets; extern pstring scope; extern struct in_addr loopback_ip; +static void queue_packet(struct packet_struct *packet); + /******************************************************************* The global packet linked-list. Incoming entries are added to the end of this list. It is supposed to remain fairly @@ -963,8 +965,7 @@ for id %hu\n", /******************************************************************* Queue a packet into a packet queue ******************************************************************/ - -void queue_packet(struct packet_struct *packet) +static void queue_packet(struct packet_struct *packet) { struct packet_struct *p; @@ -1013,8 +1014,7 @@ static struct subnet_record *find_subnet_for_dgram_browse_packet(struct packet_s /**************************************************************************** Dispatch a browse frame from port 138 to the correct processing function. ****************************************************************************/ - -void process_browse_packet(struct packet_struct *p, char *buf,int len) +static void process_browse_packet(struct packet_struct *p, char *buf,int len) { struct dgram_packet *dgram = &p->packet.dgram; int command = CVAL(buf,0); @@ -1135,8 +1135,7 @@ command code %d from %s IP %s to %s\n", /**************************************************************************** Dispatch a LanMan browse frame from port 138 to the correct processing function. ****************************************************************************/ - -void process_lanman_packet(struct packet_struct *p, char *buf,int len) +static void process_lanman_packet(struct packet_struct *p, char *buf,int len) { struct dgram_packet *dgram = &p->packet.dgram; int command = SVAL(buf,0); @@ -1284,7 +1283,7 @@ static void process_dgram(struct packet_struct *p) Validate a response nmb packet. ****************************************************************************/ -BOOL validate_nmb_response_packet( struct nmb_packet *nmb ) +static BOOL validate_nmb_response_packet( struct nmb_packet *nmb ) { BOOL ignore = False; @@ -1338,7 +1337,7 @@ BOOL validate_nmb_response_packet( struct nmb_packet *nmb ) Validate a request nmb packet. ****************************************************************************/ -BOOL validate_nmb_packet( struct nmb_packet *nmb ) +static BOOL validate_nmb_packet( struct nmb_packet *nmb ) { BOOL ignore = False; diff --git a/source3/nmbd/nmbd_responserecordsdb.c b/source3/nmbd/nmbd_responserecordsdb.c index 21defa970c..3edca69981 100644 --- a/source3/nmbd/nmbd_responserecordsdb.c +++ b/source3/nmbd/nmbd_responserecordsdb.c @@ -37,7 +37,7 @@ int num_response_packets = 0; Add an expected response record into the list **************************************************************************/ -void add_response_record(struct subnet_record *subrec, +static void add_response_record(struct subnet_record *subrec, struct response_record *rrec) { struct response_record *rrec2; diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9bf3dce6fb..8e759cbbb0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -652,7 +652,6 @@ static struct parm_struct parm_table[] = {"domain guest group",P_STRING, P_GLOBAL, &Globals.szDomainGuestGroup, NULL, NULL, 0}, {"domain admin users",P_STRING, P_GLOBAL, &Globals.szDomainAdminUsers, NULL, NULL, 0}, {"domain guest users",P_STRING, P_GLOBAL, &Globals.szDomainGuestUsers, NULL, NULL, 0}, - {"groupname map", P_STRING, P_GLOBAL, &Globals.szGroupnameMap, NULL, NULL, 0}, {"machine password timeout", P_INTEGER, P_GLOBAL, &Globals.machine_password_timeout, NULL, NULL, 0}, {"Logon Options", P_SEP, P_SEPARATOR}, @@ -971,7 +970,7 @@ convenience routine to grab string parameters into a rotating buffer, and run standard_sub_basic on them. The buffers can be written to by callers without affecting the source string. ********************************************************************/ -char *lp_string(char *s) +static char *lp_string(char *s) { static char *bufs[10]; static int buflen[10]; @@ -1050,7 +1049,6 @@ FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir) FN_GLOBAL_STRING(lp_rootdir,&Globals.szRootdir) FN_GLOBAL_STRING(lp_defaultservice,&Globals.szDefaultService) FN_GLOBAL_STRING(lp_msg_command,&Globals.szMsgCommand) -FN_GLOBAL_STRING(lp_dfree_command,&Globals.szDfree) FN_GLOBAL_STRING(lp_hosts_equiv,&Globals.szHostsEquiv) FN_GLOBAL_STRING(lp_auto_services,&Globals.szAutoServices) FN_GLOBAL_STRING(lp_passwd_program,&Globals.szPasswdProgram) @@ -1059,8 +1057,6 @@ FN_GLOBAL_STRING(lp_passwordserver,&Globals.szPasswordServer) FN_GLOBAL_STRING(lp_name_resolve_order,&Globals.szNameResolveOrder) FN_GLOBAL_STRING(lp_workgroup,&Globals.szWorkGroup) FN_GLOBAL_STRING(lp_username_map,&Globals.szUsernameMap) -FN_GLOBAL_STRING(lp_groupname_map,&Globals.szGroupnameMap) -FN_GLOBAL_STRING(lp_character_set,&Globals.szCharacterSet) FN_GLOBAL_STRING(lp_logon_script,&Globals.szLogonScript) FN_GLOBAL_STRING(lp_logon_path,&Globals.szLogonPath) FN_GLOBAL_STRING(lp_logon_drive,&Globals.szLogonDrive) @@ -1071,20 +1067,17 @@ FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver) FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces) FN_GLOBAL_STRING(lp_socket_address,&Globals.szSocketAddress) FN_GLOBAL_STRING(lp_nis_home_map_name,&Globals.szNISHomeMapName) -FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) +static FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion) FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases) FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile) FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction) FN_GLOBAL_STRING(lp_domain_sid,&Globals.szDomainSID) -FN_GLOBAL_STRING(lp_domain_other_sids,&Globals.szDomainOtherSIDs) FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups) FN_GLOBAL_STRING(lp_domain_admin_group,&Globals.szDomainAdminGroup) FN_GLOBAL_STRING(lp_domain_guest_group,&Globals.szDomainGuestGroup) FN_GLOBAL_STRING(lp_domain_admin_users,&Globals.szDomainAdminUsers) FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers) -FN_GLOBAL_STRING(lp_domain_hostsallow,&Globals.szDomainHostsallow) -FN_GLOBAL_STRING(lp_domain_hostsdeny,&Globals.szDomainHostsdeny) #ifdef WITH_LDAP FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer); @@ -1122,7 +1115,6 @@ FN_GLOBAL_BOOL(lp_domain_logons,&Globals.bDomainLogons) FN_GLOBAL_BOOL(lp_preferred_master,&Globals.bPreferredMaster) FN_GLOBAL_BOOL(lp_load_printers,&Globals.bLoadPrinters) FN_GLOBAL_BOOL(lp_use_rhosts,&Globals.bUseRhosts) -FN_GLOBAL_BOOL(lp_getwdcache,&use_getwd_cache) FN_GLOBAL_BOOL(lp_readprediction,&Globals.bReadPrediction) FN_GLOBAL_BOOL(lp_readbmpx,&Globals.bReadbmpx) FN_GLOBAL_BOOL(lp_readraw,&Globals.bReadRaw) @@ -1136,7 +1128,7 @@ FN_GLOBAL_BOOL(lp_timestamp_logs,&Globals.bTimestampLogs) FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList) FN_GLOBAL_BOOL(lp_unix_realname,&Globals.bUnixRealname) FN_GLOBAL_BOOL(lp_nis_home_map,&Globals.bNISHomeMap) -FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) +static FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer) FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly) FN_GLOBAL_BOOL(lp_net_wksta_user_logon,&Globals.bNetWkstaUserLogon) FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync) @@ -1149,11 +1141,8 @@ FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl) FN_GLOBAL_INTEGER(lp_max_wins_ttl,&Globals.max_wins_ttl) FN_GLOBAL_INTEGER(lp_min_wins_ttl,&Globals.max_wins_ttl) FN_GLOBAL_INTEGER(lp_max_log_size,&Globals.max_log_size) -FN_GLOBAL_INTEGER(lp_mangledstack,&Globals.mangled_stack) FN_GLOBAL_INTEGER(lp_maxxmit,&Globals.max_xmit) FN_GLOBAL_INTEGER(lp_maxmux,&Globals.max_mux) -FN_GLOBAL_INTEGER(lp_maxpacket,&Globals.max_packet) -FN_GLOBAL_INTEGER(lp_keepalive,&keepalive) FN_GLOBAL_INTEGER(lp_passwordlevel,&Globals.pwordlevel) FN_GLOBAL_INTEGER(lp_usernamelevel,&Globals.unamelevel) FN_GLOBAL_INTEGER(lp_readsize,&Globals.ReadSize) @@ -1165,7 +1154,7 @@ FN_GLOBAL_INTEGER(lp_maxdisksize,&Globals.maxdisksize) FN_GLOBAL_INTEGER(lp_lpqcachetime,&Globals.lpqcachetime) FN_GLOBAL_INTEGER(lp_syslog,&Globals.syslog) FN_GLOBAL_INTEGER(lp_client_code_page,&Globals.client_code_page) -FN_GLOBAL_INTEGER(lp_announce_as,&Globals.announce_as) +static FN_GLOBAL_INTEGER(lp_announce_as,&Globals.announce_as) FN_GLOBAL_INTEGER(lp_lm_announce,&Globals.lm_announce) FN_GLOBAL_INTEGER(lp_lm_interval,&Globals.lm_interval) FN_GLOBAL_INTEGER(lp_machine_password_timeout,&Globals.machine_password_timeout) @@ -1206,7 +1195,7 @@ FN_LOCAL_STRING(lp_force_user,force_user) FN_LOCAL_STRING(lp_force_group,force_group) FN_LOCAL_STRING(lp_readlist,readlist) FN_LOCAL_STRING(lp_writelist,writelist) -FN_LOCAL_STRING(lp_volume,volume) +static FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) FN_LOCAL_STRING(lp_veto_files,szVetoFiles) FN_LOCAL_STRING(lp_hide_files,szHideFiles) @@ -2552,14 +2541,6 @@ static void set_default_server_announce_type() /******************************************************************* -rename a service -********************************************************************/ -void lp_rename_service(int snum, char *new_name) -{ - string_set(&pSERVICE(snum)->szService, new_name); -} - -/******************************************************************* remove a service ********************************************************************/ void lp_remove_service(int snum) diff --git a/source3/passdb/nispass.c b/source3/passdb/nispass.c index b43a52e48a..d397f1bf40 100644 --- a/source3/passdb/nispass.c +++ b/source3/passdb/nispass.c @@ -678,6 +678,7 @@ struct passdb_ops *nisplus_initialize_password_db(void) /* useful code i can't bring myself to delete */ #if 0 +static void useful_code(void) { /* checks user in unix password database. don't want to do that, here. */ nisname = make_nisname_from_name(newpwd->smb_name, "passwd.org_dir"); @@ -692,4 +693,5 @@ struct passdb_ops *nisplus_initialize_password_db(void) user_obj = NIS_RES_OBJECT(nis_user); make_nisname_from_name(ENTRY_VAL(user_obj,0), pfile); +} #endif diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 5e476e0227..33368fe87b 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -209,38 +209,6 @@ struct smb_passwd *getsmbpwent(void *vp) return pdb_ops->getsmbpwent(vp); } -/************************************************************************* - Return the current position in the smb passwd list as an unsigned long. - This must be treated as an opaque token. - - Note that currently it is being assumed that a pointer returned - from this function may be used to enumerate struct sam_passwd - entries as well as struct smb_passwd entries. This may need - to change. JRA. - - *************************************************************************/ - -unsigned long getsmbpwpos(void *vp) -{ - return pdb_ops->getsmbpwpos(vp); -} - -/************************************************************************* - Set the current position in the smb passwd list from unsigned long. - This must be treated as an opaque token. - - Note that currently it is being assumed that a pointer returned - from this function may be used to enumerate struct sam_passwd - entries as well as struct smb_passwd entries. This may need - to change. JRA. - - *************************************************************************/ - -BOOL setsmbpwpos(void *vp, unsigned long tok) -{ - return pdb_ops->setsmbpwpos(vp, tok); -} - /************************************************************************ Routine to add an entry to the smb passwd file. *************************************************************************/ @@ -394,14 +362,6 @@ struct sam_passwd *iterate_getsam21pwuid(uid_t uid) } /************************************************************************* - Routine to return a display info structure, by name - *************************************************************************/ -struct sam_disp_info *getsamdispnam(char *name) -{ - return pdb_ops->getsamdispnam(name); -} - -/************************************************************************* Routine to return a display info structure, by rid *************************************************************************/ struct sam_disp_info *getsamdisprid(uint32 rid) @@ -412,43 +372,12 @@ struct sam_disp_info *getsamdisprid(uint32 rid) /************************************************************************* Routine to return the next entry in the sam passwd list. *************************************************************************/ -struct sam_disp_info *getsamdispent(void *vp) -{ - return pdb_ops->getsamdispent(vp); -} - -/************************************************************************* - Routine to return the next entry in the sam passwd list. - *************************************************************************/ struct sam_passwd *getsam21pwent(void *vp) { return pdb_ops->getsam21pwent(vp); } -/************************************************************************ - Routine to add an entry to the sam passwd file. -*************************************************************************/ - -BOOL add_sam21pwd_entry(struct sam_passwd *newpwd) -{ - return pdb_ops->add_sam21pwd_entry(newpwd); -} - -/************************************************************************ - Routine to search the sam passwd database for an entry matching the username. - and then modify its password entry. We can't use the startsampwent()/ - getsampwent()/endsampwent() interfaces here as we depend on looking - in the actual file to decide how much room we have to write data. - override = False, normal - override = True, override XXXXXXXX'd out password or NO PASS -************************************************************************/ - -BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override) -{ - return pdb_ops->mod_sam21pwd_entry(pwd, override); -} - /************************************************************************ Routine to search sam passwd by name. @@ -468,17 +397,6 @@ struct sam_passwd *getsam21pwrid(uint32 rid) return pdb_ops->getsam21pwrid(rid); } -/************************************************************************ - Routine to search sam passwd by uid. -*************************************************************************/ - -struct sam_passwd *getsam21pwuid(uid_t uid) -{ - return pdb_ops->getsam21pwuid(uid); -} - - - /********************************************************** ********************************************************** @@ -493,7 +411,7 @@ struct sam_passwd *getsam21pwuid(uid_t uid) initialises a struct sam_disp_info. **************************************************************/ -void pdb_init_dispinfo(struct sam_disp_info *user) +static void pdb_init_dispinfo(struct sam_disp_info *user) { if (user == NULL) return; bzero(user, sizeof(*user)); @@ -566,128 +484,10 @@ struct smb_passwd *pdb_sam_to_smb(struct sam_passwd *user) return &pw_buf; } -/************************************************************* - converts a smb_passwd structure to a sam_passwd structure. - **************************************************************/ - -struct sam_passwd *pdb_smb_to_sam(struct smb_passwd *user) -{ - static struct sam_passwd pw_buf; - - if (user == NULL) return NULL; - - pdb_init_sam(&pw_buf); - - pw_buf.smb_userid = user->smb_userid; - pw_buf.smb_name = user->smb_name; - pw_buf.smb_passwd = user->smb_passwd; - pw_buf.smb_nt_passwd = user->smb_nt_passwd; - pw_buf.acct_ctrl = user->acct_ctrl; - pw_buf.pass_last_set_time = user->pass_last_set_time; - - return &pw_buf; -} - - -/******************************************************************* - gets password-database-format time from a string. - ********************************************************************/ - -static time_t get_time_from_string(char *p) -{ - int i; - - for (i = 0; i < 8; i++) - { - if (p[i] == '\0' || !isxdigit((int)p[i])) - break; - } - if (i == 8) - { - /* - * p points at 8 characters of hex digits - - * read into a time_t as the seconds since - * 1970 that the password was last changed. - */ - return (time_t)strtol((char *)p, NULL, 16); - } - return (time_t)-1; -} - -/******************************************************************* - gets password last set time - ********************************************************************/ - -time_t pdb_get_last_set_time(char *p) -{ - if (*p && StrnCaseCmp((char *)p, "LCT-", 4)) - { - return get_time_from_string(p + 4); - } - return (time_t)-1; -} - - -/******************************************************************* - sets password-database-format time in a string. - ********************************************************************/ -static void set_time_in_string(char *p, int max_len, char *type, time_t t) -{ - slprintf(p, max_len, ":%s-%08X:", type, (uint32)t); -} - -/******************************************************************* - sets logon time - ********************************************************************/ -void pdb_set_logon_time(char *p, int max_len, time_t t) -{ - set_time_in_string(p, max_len, "LNT", t); -} - -/******************************************************************* - sets logoff time - ********************************************************************/ -void pdb_set_logoff_time(char *p, int max_len, time_t t) -{ - set_time_in_string(p, max_len, "LOT", t); -} - -/******************************************************************* - sets kickoff time - ********************************************************************/ -void pdb_set_kickoff_time(char *p, int max_len, time_t t) -{ - set_time_in_string(p, max_len, "KOT", t); -} - -/******************************************************************* - sets password can change time - ********************************************************************/ -void pdb_set_can_change_time(char *p, int max_len, time_t t) -{ - set_time_in_string(p, max_len, "CCT", t); -} - -/******************************************************************* - sets password last set time - ********************************************************************/ -void pdb_set_must_change_time(char *p, int max_len, time_t t) -{ - set_time_in_string(p, max_len, "MCT", t); -} - -/******************************************************************* - sets password last set time - ********************************************************************/ -void pdb_set_last_set_time(char *p, int max_len, time_t t) -{ - set_time_in_string(p, max_len, "LCT", t); -} /********************************************************** Encode the account control bits into a string. **********************************************************/ - char *pdb_encode_acct_ctrl(uint16 acct_ctrl) { static fstring acct_str; @@ -796,32 +596,6 @@ BOOL pdb_gethexpwd(char *p, char *pwd) return (True); } -/************************************************************* - Routine to set 32 hex password characters from a 16 byte array. -**************************************************************/ -void pdb_sethexpwd(char *p, char *pwd, uint16 acct_ctrl) -{ - if (pwd != NULL) - { - int i; - for (i = 0; i < 16; i++) - { - slprintf(&p[i*2], 33, "%02X", pwd[i]); - } - } - else - { - if (IS_BITS_SET_ALL(acct_ctrl, ACB_PWNOTREQ)) - { - safe_strcpy(p, "NO PASSWORDXXXXXXXXXXXXXXXXXXXXX", 33); - } - else - { - safe_strcpy(p, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 33); - } - } -} - /******************************************************************* Group and User RID username mapping function ********************************************************************/ @@ -1059,24 +833,6 @@ Error was %s\n", sid_file, strerror(errno) )); } /******************************************************************* - converts NT User RID to a UNIX uid. - ********************************************************************/ - -uid_t pdb_user_rid_to_uid(uint32 u_rid) -{ - return (uid_t)((u_rid / RID_MULTIPLIER) - 1000); -} - -/******************************************************************* - converts NT Group RID to a UNIX uid. - ********************************************************************/ - -gid_t pdb_group_rid_to_gid(uint32 g_rid) -{ - return (gid_t)((g_rid / RID_MULTIPLIER) - 1000); -} - -/******************************************************************* converts UNIX uid to an NT User RID. ********************************************************************/ @@ -1098,7 +854,7 @@ uint32 pdb_gid_to_group_rid(gid_t gid) Decides if a RID is a well known RID. ********************************************************************/ -BOOL pdb_rid_is_well_known(uint32 rid) +static BOOL pdb_rid_is_well_known(uint32 rid) { return (rid < 1000); } diff --git a/source3/rpc_client/cli_login.c b/source3/rpc_client/cli_login.c index 43ee45d48d..abe471379b 100644 --- a/source3/rpc_client/cli_login.c +++ b/source3/rpc_client/cli_login.c @@ -96,13 +96,13 @@ BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd) return cli_net_srv_pwset(cli, processed_new_pwd); } +#if UNUSED_CODE /**************************************************************************** NT login - interactive. *NEVER* use this code. This method of doing a logon (sending the cleartext password equivalents, protected by the session key) is inherently insecure given the current design of the NT Domain system. JRA. ****************************************************************************/ - BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username, uint32 smb_userid_low, char *password, NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3) @@ -149,6 +149,7 @@ BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *usernam return ret; } +#endif /**************************************************************************** NT login - network. @@ -176,10 +177,10 @@ BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username, return cli_net_sam_logon(cli, ctr, user_info3); } +#if UNUSED_CODE /**************************************************************************** NT Logoff. ****************************************************************************/ - BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr) { DEBUG(5,("cli_nt_logoff: %d\n", __LINE__)); @@ -187,3 +188,4 @@ BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr) /* Send client sam-logoff request - update credentials on success. */ return cli_net_sam_logoff(cli, ctr); } +#endif diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index 59d85db675..9d1fde50c0 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -53,10 +53,10 @@ static void gen_next_creds( struct cli_state *cli, DOM_CRED *new_clnt_cred) } +#if UNUSED_CODE /**************************************************************************** do a LSA Logon Control2 ****************************************************************************/ - BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level) { prs_struct rbuf; @@ -100,6 +100,7 @@ BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level) return ok; } +#endif /**************************************************************************** LSA Authenticate 2 @@ -389,6 +390,7 @@ password ?).\n", cli->desthost )); return ok; } +#if UNUSED_CODE /*************************************************************************** LSA SAM Logoff. @@ -398,7 +400,6 @@ send a different info level. Right now though, I'm not sure what that needs to be (I need to see one on the wire before I can be sure). JRA. ****************************************************************************/ - BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr) { DOM_CRED new_clnt_cred; @@ -463,6 +464,7 @@ password ?).\n", cli->desthost )); return ok; } +#endif /********************************************************* Change the domain password on the PDC. diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 899c0437e6..1689ae0e69 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -37,8 +37,7 @@ extern pstring global_myname; /******************************************************************** rpc pipe call id ********************************************************************/ - -uint32 get_rpc_call_id(void) +static uint32 get_rpc_call_id(void) { static uint32 call_id = 1; return ++call_id; @@ -157,7 +156,7 @@ static BOOL rpc_check_hdr(prs_struct *rdata, uint8 *pkt_type, ****************************************************************************/ -BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, +static BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, prs_struct *param , prs_struct *data, prs_struct *rparam, prs_struct *rdata) { @@ -437,7 +436,7 @@ BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, do an rpc bind ****************************************************************************/ -BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint16 device_state) +static BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint16 device_state) { BOOL state_set = False; char param[2]; @@ -577,7 +576,7 @@ static BOOL check_bind_response(RPC_HDR_BA *hdr_ba, char *pipe_name, RPC_IFACE * do an rpc bind ****************************************************************************/ -BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, +static BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, RPC_IFACE *abstract, RPC_IFACE *transfer, BOOL ntlmssp_auth) { prs_struct hdr; diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index 638222590d..0818057d48 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -26,6 +26,7 @@ extern int DEBUGLEVEL; +static void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth); /******************************************************************* creates a LSA_TRANS_NAME structure. @@ -43,7 +44,7 @@ void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, u /******************************************************************* reads or writes a LSA_TRANS_NAME structure. ********************************************************************/ -void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth) +static void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth) { if (trn == NULL) return; @@ -63,7 +64,7 @@ void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int dept /******************************************************************* reads or writes a DOM_R_REF structure. ********************************************************************/ -void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth) +static void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth) { int i; @@ -99,27 +100,11 @@ void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth) } } -/******************************************************************* -makes an LSA_OBJ_ATTR structure. -********************************************************************/ -void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos) -{ - if (attr == NULL) return; - - DEBUG(5,("make_lsa_obj_attr\n")); - - attr->len = 0x18; /* length of object attribute block, in bytes */ - attr->ptr_root_dir = 0; - attr->ptr_obj_name = 0; - attr->attributes = attributes; - attr->ptr_sec_desc = 0; - attr->sec_qos = sec_qos; -} /******************************************************************* reads or writes an LSA_OBJ_ATTR structure. ********************************************************************/ -void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth) +static void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth) { int start; @@ -148,24 +133,6 @@ void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth) attr->len, ps->offset - start)); } } -/******************************************************************* -makes an LSA_Q_OPEN_POL structure. -********************************************************************/ -void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, - uint32 attributes, uint32 sec_qos, - uint32 desired_access) -{ - if (r_q == NULL) return; - - DEBUG(5,("make_open_pol\n")); - - r_q->ptr = 1; /* undocumented pointer */ - - make_unistr2 (&(r_q->uni_server_name), server_name, strlen(server_name)); - make_lsa_obj_attr(&(r_q->attr ), attributes, sec_qos); - - r_q->des_access = desired_access; -} /******************************************************************* reads or writes an LSA_Q_OPEN_POL structure. @@ -202,20 +169,6 @@ void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int dep } /******************************************************************* -makes an LSA_Q_QUERY_INFO structure. -********************************************************************/ -void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class) -{ - if (q_q == NULL || hnd == NULL) return; - - DEBUG(5,("make_q_query\n")); - - memcpy(&(q_q->pol), hnd, sizeof(q_q->pol)); - - q_q->info_class = info_class; -} - -/******************************************************************* reads or writes an LSA_Q_QUERY_INFO structure. ********************************************************************/ void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth) @@ -307,60 +260,6 @@ void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct } /******************************************************************* -makes an LSA_Q_CLOSE structure. -********************************************************************/ -void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd) -{ - if (q_c == NULL || hnd == NULL) return; - - DEBUG(5,("make_lsa_q_close\n")); - - memcpy(&(q_c->pol), hnd, sizeof(q_c->pol)); -} - - -/******************************************************************* -reads or writes an LSA_Q_CLOSE structure. -********************************************************************/ -void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth) -{ - if (q_c == NULL) return; - - prs_debug(ps, depth, desc, "lsa_io_q_close"); - depth++; - - smb_io_pol_hnd("", &(q_c->pol), ps, depth); -} - -/******************************************************************* -makes an LSA_R_CLOSE structure. -********************************************************************/ -void make_lsa_r_close(LSA_R_CLOSE *q_r, POLICY_HND *hnd) -{ - if (q_r == NULL || hnd == NULL) return; - - DEBUG(5,("make_lsa_r_close\n")); - - memcpy(&(q_r->pol), hnd, sizeof(q_r->pol)); -} - - -/******************************************************************* -reads or writes an LSA_R_CLOSE structure. -********************************************************************/ -void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth) -{ - if (r_c == NULL) return; - - prs_debug(ps, depth, desc, "lsa_io_r_close"); - depth++; - - smb_io_pol_hnd("", &(r_c->pol), ps, depth); - - prs_uint32("status", ps, depth, &(r_c->status)); -} - -/******************************************************************* reads or writes an LSA_Q_QUERY_INFO structure. ********************************************************************/ void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth) @@ -402,7 +301,7 @@ void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int dept /******************************************************************* reads or writes a LSA_SID_ENUM structure. ********************************************************************/ -void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth) +static void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth) { int i; @@ -459,7 +358,7 @@ void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, in /******************************************************************* reads or writes a structure. ********************************************************************/ -void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth) +static void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth) { int i; int i2; diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index 3c83382f0c..3749827860 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -32,7 +32,7 @@ extern int DEBUGLEVEL; /******************************************************************* reads or writes a UTIME type. ********************************************************************/ -void smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth) +static void smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth) { if (t == NULL) return; @@ -541,27 +541,11 @@ void make_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid) rid4->rid = rid; } -/******************************************************************* -reads or writes a DOM_RID4 structure. -********************************************************************/ -void smb_io_dom_rid4(char *desc, DOM_RID4 *rid4, prs_struct *ps, int depth) -{ - if (rid4 == NULL) return; - - prs_debug(ps, depth, desc, "smb_io_dom_rid4. XXXX !check size of unknown! XXXX"); - depth++; - - prs_align(ps); - - prs_uint32("unknown", ps, depth, &(rid4->unknown)); - prs_uint16("attr ", ps, depth, &(rid4->attr )); - prs_uint32("rid ", ps, depth, &(rid4->rid )); -} /******************************************************************* makes a DOM_CLNT_SRV structure. ********************************************************************/ -void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name) +static void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name) { if (log == NULL) return; @@ -591,7 +575,7 @@ void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name) /******************************************************************* reads or writes a DOM_CLNT_SRV structure. ********************************************************************/ -void smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth) +static void smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth) { if (log == NULL) return; @@ -861,23 +845,7 @@ void smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth) /******************************************************************* reads or writes a dom query structure. ********************************************************************/ -void smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) -{ - smb_io_dom_query("", d_q, ps, depth); -} - -/******************************************************************* -reads or writes a dom query structure. -********************************************************************/ -void smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) -{ - smb_io_dom_query("", d_q, ps, depth); -} - -/******************************************************************* -reads or writes a dom query structure. -********************************************************************/ -void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth) +static void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth) { if (d_q == NULL) return; @@ -905,6 +873,23 @@ void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth) } /******************************************************************* +reads or writes a dom query structure. +********************************************************************/ +void smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) +{ + smb_io_dom_query("", d_q, ps, depth); +} + +/******************************************************************* +reads or writes a dom query structure. +********************************************************************/ +void smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) +{ + smb_io_dom_query("", d_q, ps, depth); +} + + +/******************************************************************* reads or writes a DOM_NAME structure. ********************************************************************/ void smb_io_dom_name(char *desc, DOM_NAME *name, prs_struct *ps, int depth) diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c index 182b3495db..12d6aca264 100644 --- a/source3/rpc_parse/parse_net.c +++ b/source3/rpc_parse/parse_net.c @@ -29,7 +29,7 @@ extern int DEBUGLEVEL; /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth) +static void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth) { if (neg == NULL) return; @@ -44,7 +44,7 @@ void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth) /******************************************************************* creates a NETLOGON_INFO_3 structure. ********************************************************************/ -void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts) +static void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts) { info->flags = flags; info->logon_attempts = logon_attempts; @@ -58,7 +58,7 @@ void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts) /******************************************************************* reads or writes a NETLOGON_INFO_3 structure. ********************************************************************/ -void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth) +static void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth) { if (info == NULL) return; @@ -80,7 +80,7 @@ void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int de /******************************************************************* creates a NETLOGON_INFO_1 structure. ********************************************************************/ -void make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status) +static void make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status) { info->flags = flags; info->pdc_status = pdc_status; @@ -89,7 +89,7 @@ void make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status) /******************************************************************* reads or writes a NETLOGON_INFO_1 structure. ********************************************************************/ -void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth) +static void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth) { if (info == NULL) return; @@ -105,7 +105,7 @@ void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int de /******************************************************************* creates a NETLOGON_INFO_2 structure. ********************************************************************/ -void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, +static void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, uint32 tc_status, char *trusted_dc_name) { int len_dc_name = strlen(trusted_dc_name); @@ -127,7 +127,7 @@ void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, /******************************************************************* reads or writes a NETLOGON_INFO_2 structure. ********************************************************************/ -void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth) +static void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth) { if (info == NULL) return; @@ -150,24 +150,6 @@ void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int de } /******************************************************************* -makes an NET_Q_LOGON_CTRL2 structure. -********************************************************************/ -void make_q_logon_ctrl2(NET_Q_LOGON_CTRL2 *q_l, char *server_name, - uint32 function_code) -{ - if (q_l == NULL) return; - - DEBUG(5,("make_q_logon_ctrl2\n")); - - q_l->ptr = 1; /* undocumented pointer */ - make_unistr2 (&(q_l->uni_server_name), server_name, strlen(server_name)); - - q_l->function_code = function_code; /* should only be 0x1 */ - q_l->query_level = function_code; /* should only be 0x1 */ - q_l->switch_value = function_code; /* should only be 0x1 */ -} - -/******************************************************************* reads or writes an NET_Q_LOGON_CTRL2 structure. ********************************************************************/ void net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth) @@ -340,20 +322,6 @@ void net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, prs_uint32("status", ps, depth, &(r_t->status)); } -/******************************************************************* -makes an NET_Q_TRUST_DOM_LIST structure. -********************************************************************/ -void make_q_trust_dom(NET_Q_TRUST_DOM_LIST *q_l, char *server_name, - uint32 function_code) -{ - if (q_l == NULL) return; - - DEBUG(5,("make_q_trust_dom\n")); - - make_unistr2 (&(q_l->uni_server_name), server_name, strlen(server_name)); - - q_l->function_code = function_code; /* should only be 0x31 */ -} /******************************************************************* reads or writes an NET_Q_TRUST_DOM_LIST structure. @@ -571,88 +539,9 @@ static int make_dom_sid2s(char *sids_str, DOM_SID2 *sids, int max_sids) } /******************************************************************* -makes a NET_ID_INFO_1 structure. - -This is an interactive logon packet. The log_id parameters -are what an NT server would generate for LUID once the -user is logged on. I don't think we care about them. - -Note that this passes the actual NT and LM hashed passwords -over the secure channel. This is not the preferred logon -method from a Samba domain client as it exposes the password -hashes to anyone who has compromised the secure channel. JRA. -********************************************************************/ - -void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, - uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, - char *user_name, char *wksta_name, - char sess_key[16], - unsigned char lm_cypher[16], unsigned char nt_cypher[16]) -{ - int len_domain_name = strlen(domain_name); - int len_user_name = strlen(user_name ); - int len_wksta_name = strlen(wksta_name ); - - unsigned char lm_owf[16]; - unsigned char nt_owf[16]; - - if (id == NULL) return; - - DEBUG(5,("make_id_info1: %d\n", __LINE__)); - - id->ptr_id_info1 = 1; - - make_uni_hdr(&(id->hdr_domain_name), len_domain_name, len_domain_name, 4); - - id->param_ctrl = param_ctrl; - make_logon_id(&(id->logon_id), log_id_low, log_id_high); - - make_uni_hdr(&(id->hdr_user_name ), len_user_name , len_user_name , 4); - make_uni_hdr(&(id->hdr_wksta_name ), len_wksta_name , len_wksta_name , 4); - - if (lm_cypher && nt_cypher) - { - void arcfour(uint8 key[16], uint8 out[16], uint8 in[16]); - unsigned char owf_key[16]; -#ifdef DEBUG_PASSWORD - DEBUG(100,("lm cypher:")); - dump_data(100, lm_cypher, 16); - - DEBUG(100,("nt cypher:")); - dump_data(100, nt_cypher, 16); -#endif - - memcpy(owf_key, sess_key, 16); - - memcpy(lm_owf, lm_cypher, 16); - memcpy(nt_owf, nt_cypher, 16); - SamOEMhash(lm_owf, owf_key, False); - SamOEMhash(nt_owf, owf_key, False); - -#ifdef DEBUG_PASSWORD - DEBUG(100,("hash of lm owf password:")); - dump_data(100, lm_owf, 16); - - DEBUG(100,("hash of nt owf password:")); - dump_data(100, nt_owf, 16); -#endif - /* set up pointers to blocks */ - lm_cypher = lm_owf; - nt_cypher = nt_owf; - } - - make_owf_info(&(id->lm_owf), lm_cypher); - make_owf_info(&(id->nt_owf), nt_cypher); - - make_unistr2(&(id->uni_domain_name), domain_name, len_domain_name); - make_unistr2(&(id->uni_user_name ), user_name , len_user_name ); - make_unistr2(&(id->uni_wksta_name ), wksta_name , len_wksta_name ); -} - -/******************************************************************* reads or writes an NET_ID_INFO_1 structure. ********************************************************************/ -void net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth) +static void net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth) { if (id == NULL) return; @@ -754,7 +643,7 @@ void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, /******************************************************************* reads or writes an NET_ID_INFO_2 structure. ********************************************************************/ -void net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth) +static void net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth) { if (id == NULL) return; @@ -821,7 +710,7 @@ void make_sam_info(DOM_SAM_INFO *sam, /******************************************************************* reads or writes a DOM_SAM_INFO structure. ********************************************************************/ -void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int depth) +static void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int depth) { if (ctr == NULL) return; @@ -856,7 +745,7 @@ void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int d /******************************************************************* reads or writes a DOM_SAM_INFO structure. ********************************************************************/ -void smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth) +static void smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth) { if (sam == NULL) return; @@ -1004,7 +893,7 @@ void make_net_user_info3(NET_USER_INFO_3 *usr, /******************************************************************* reads or writes a structure. ********************************************************************/ -void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth) +static void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth) { int i; diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index ad05831229..024ac88b18 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -148,20 +148,6 @@ BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *dat } /****************************************************************** - stream an array of uint16s. length is number of uint16s - ********************************************************************/ -BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len) -{ - char *q = mem_data(&(ps->data), ps->offset); - if (q == NULL) return False; - - DBG_RW_PSVAL(charmode, name, depth, ps->offset, ps->io, q, data16s, len) - ps->offset += len * sizeof(uint16); - - return True; -} - -/****************************************************************** stream an array of uint32s. length is number of uint32s ********************************************************************/ BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len) diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c index dec5110b41..6b464645e5 100644 --- a/source3/rpc_parse/parse_reg.c +++ b/source3/rpc_parse/parse_reg.c @@ -28,18 +28,6 @@ extern int DEBUGLEVEL; /******************************************************************* -creates a structure. -********************************************************************/ -void make_reg_q_open_policy(REG_Q_OPEN_POLICY *r_q, - uint16 unknown_0, uint32 level, uint16 unknown_1) -{ - r_q->ptr = 1; - r_q->unknown_0 = unknown_0; - r_q->level = level; - r_q->unknown_1 = unknown_1; -} - -/******************************************************************* reads or writes a structure. ********************************************************************/ void reg_io_q_open_policy(char *desc, REG_Q_OPEN_POLICY *r_q, prs_struct *ps, int depth) @@ -62,18 +50,6 @@ void reg_io_q_open_policy(char *desc, REG_Q_OPEN_POLICY *r_q, prs_struct *ps, i /******************************************************************* -creates a structure. -********************************************************************/ -void make_reg_r_open_policy(REG_R_OPEN_POLICY *r_r, - POLICY_HND *pol, uint32 status) -{ - if (r_r == NULL) return; - - memcpy(&(r_r->pol), pol, sizeof(r_r->pol)); - r_r->status = status; -} - -/******************************************************************* reads or writes a structure. ********************************************************************/ void reg_io_r_open_policy(char *desc, REG_R_OPEN_POLICY *r_r, prs_struct *ps, int depth) @@ -124,34 +100,6 @@ void reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth) prs_uint32("status", ps, depth, &(r_u->status)); } -/******************************************************************* -creates a structure. -********************************************************************/ -void make_reg_q_info(REG_Q_INFO *r_q, - POLICY_HND *pol, char *product_type, - NTTIME *prod_time, uint8 major_version, uint8 minor_version, - uint32 unknown) -{ - int type_len = strlen(product_type); - - memcpy(&(r_q->pol), pol, sizeof(r_q->pol)); - make_uni_hdr(&(r_q->hdr_type), type_len, type_len, 1); - make_unistr2(&(r_q->uni_type), product_type, type_len); - - r_q->ptr1 = 1; - memcpy(&(r_q->time), prod_time, sizeof(r_q->time)); - r_q->major_version1 = major_version; - r_q->minor_version1 = minor_version; - bzero(r_q->pad1, sizeof(r_q->pad1)); - - r_q->ptr2 = 1; - r_q->major_version2 = major_version; - r_q->minor_version2 = minor_version; - bzero(r_q->pad2, sizeof(r_q->pad2)); - - r_q->ptr3 = 1; - r_q->unknown = unknown; -} /******************************************************************* reads or writes a structure. @@ -264,25 +212,6 @@ void reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth) /******************************************************************* -creates a structure. -********************************************************************/ -void make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, - POLICY_HND *pol, char *name, - uint32 unknown_0, uint32 unknown_1, uint16 unknown_2) -{ - int len_name = strlen(name); - - memcpy(&(r_q->pol), pol, sizeof(r_q->pol)); - - make_uni_hdr(&(r_q->hdr_name), len_name, len_name, 1); - make_unistr2(&(r_q->uni_name), name, len_name); - - r_q->unknown_0 = unknown_0; - r_q->unknown_1 = unknown_1; - r_q->unknown_2 = unknown_2; -} - -/******************************************************************* reads or writes a structure. ********************************************************************/ void reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth) diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c index 8a5b6c172e..ac01e7f0b1 100644 --- a/source3/rpc_parse/parse_rpc.c +++ b/source3/rpc_parse/parse_rpc.c @@ -184,20 +184,9 @@ void smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth) } /******************************************************************* -creates an RPC_IFACE structure. -********************************************************************/ -void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version) -{ - if (ifc == NULL || data == NULL) return; - - memcpy(ifc->data, data, sizeof(ifc->data)); /* 16 bytes of number */ - ifc->version = version; /* the interface number */ -} - -/******************************************************************* reads or writes an RPC_IFACE structure. ********************************************************************/ -void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth) +static void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth) { if (ifc == NULL) return; @@ -213,7 +202,7 @@ void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth) /******************************************************************* creates an RPC_ADDR_STR structure. ********************************************************************/ -void make_rpc_addr_str(RPC_ADDR_STR *str, char *name) +static void make_rpc_addr_str(RPC_ADDR_STR *str, char *name) { if (str == NULL || name == NULL) return; @@ -224,7 +213,7 @@ void make_rpc_addr_str(RPC_ADDR_STR *str, char *name) /******************************************************************* reads or writes an RPC_ADDR_STR structure. ********************************************************************/ -void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int depth) +static void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int depth) { if (str == NULL) return; @@ -239,7 +228,7 @@ void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int dep /******************************************************************* creates an RPC_HDR_BBA structure. ********************************************************************/ -void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid) +static void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid) { if (bba == NULL) return; @@ -251,7 +240,7 @@ void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint /******************************************************************* reads or writes an RPC_HDR_BBA structure. ********************************************************************/ -void smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, int depth) +static void smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, int depth) { if (rpc == NULL) return; @@ -312,7 +301,7 @@ creates an RPC_RESULTS structure. lkclXXXX only one reason at the moment! ********************************************************************/ -void make_rpc_results(RPC_RESULTS *res, +static void make_rpc_results(RPC_RESULTS *res, uint8 num_results, uint16 result, uint16 reason) { if (res == NULL) return; @@ -328,7 +317,7 @@ reads or writes an RPC_RESULTS structure. lkclXXXX only one reason at the moment! ********************************************************************/ -void smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, int depth) +static void smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, int depth) { if (res == NULL) return; @@ -411,19 +400,6 @@ void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth } /******************************************************************* -creates an RPC_HDR_RESP structure. -********************************************************************/ -void make_rpc_hdr_resp(RPC_HDR_RESP *hdr, uint32 data_len) -{ - if (hdr == NULL) return; - - hdr->alloc_hint = data_len - 0x18; /* allocation hint */ - hdr->context_id = 0; /* presentation context identifier */ - hdr->cancel_count = 0; /* cancel count */ - hdr->reserved = 0; /* 0 - reserved */ -} - -/******************************************************************* reads or writes an RPC_HDR_RESP structure. ********************************************************************/ void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth) diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 8f20a257ce..71eb8a37dd 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -28,18 +28,6 @@ extern int DEBUGLEVEL; /******************************************************************* -makes a SAMR_Q_CLOSE_HND structure. -********************************************************************/ -void make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd) -{ - if (q_c == NULL || hnd == NULL) return; - - DEBUG(5,("make_samr_q_close_hnd\n")); - - memcpy(&(q_c->pol), hnd, sizeof(q_c->pol)); -} - -/******************************************************************* reads or writes a structure. ********************************************************************/ void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth) @@ -77,22 +65,6 @@ void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, - POLICY_HND *connect_pol, uint32 rid, DOM_SID *sid) -{ - if (q_u == NULL) return; - - DEBUG(5,("samr_make_q_open_domain\n")); - - memcpy(&q_u->connect_pol, connect_pol, sizeof(q_u->connect_pol)); - q_u->rid = rid; - make_dom_sid2(&(q_u->dom_sid), sid); -} - - -/******************************************************************* -reads or writes a structure. -********************************************************************/ void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth) { if (q_u == NULL) return; @@ -134,55 +106,6 @@ void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, - POLICY_HND *domain_pol, uint16 switch_value) -{ - if (q_u == NULL) return; - - DEBUG(5,("samr_make_q_unknown_8\n")); - - memcpy(&q_u->domain_pol, domain_pol, sizeof(q_u->domain_pol)); - q_u->switch_value = switch_value; -} - - -/******************************************************************* -reads or writes a structure. -********************************************************************/ -void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return; - - prs_debug(ps, depth, desc, "samr_io_q_unknown_8"); - depth++; - - prs_align(ps); - - smb_io_pol_hnd("domain_pol", &(q_u->domain_pol), ps, depth); - prs_align(ps); - - prs_uint16("switch_value", ps, depth, &(q_u->switch_value)); - prs_align(ps); -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ -void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, - POLICY_HND *user_pol, uint16 switch_value) -{ - if (q_u == NULL) return; - - DEBUG(5,("samr_make_q_unknown_3\n")); - - memcpy(&q_u->user_pol, user_pol, sizeof(q_u->user_pol)); - q_u->switch_value = switch_value; -} - - -/******************************************************************* -reads or writes a structure. -********************************************************************/ void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth) { if (q_u == NULL) return; @@ -219,7 +142,7 @@ this one's odd, because the length (in bytes) is specified at the beginning. the length _includes_ the length of the length, too :-) ********************************************************************/ -void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth) +static void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth) { if (sid3 == NULL) return; @@ -243,7 +166,7 @@ unknown_6 : 0x0002 unknown_7 : 0x5800 or 0x0070 ********************************************************************/ -void make_sam_sid_stuff(SAM_SID_STUFF *stf, +static void make_sam_sid_stuff(SAM_SID_STUFF *stf, uint16 unknown_2, uint16 unknown_3, uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS]) @@ -269,7 +192,7 @@ void make_sam_sid_stuff(SAM_SID_STUFF *stf, /******************************************************************* reads or writes a SAM_SID_STUFF structure. ********************************************************************/ -void sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth) +static void sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth) { int i; @@ -406,29 +329,10 @@ void samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int prs_uint32("status", ps, depth, &(r_u->status)); } - -/******************************************************************* -makes a SAM_STR1 structure. -********************************************************************/ -void make_sam_str1(SAM_STR1 *sam, char *sam_acct, char *sam_name, char *sam_desc) -{ - int len_sam_acct = sam_acct != NULL ? strlen(sam_acct) : 0; - int len_sam_name = sam_name != NULL ? strlen(sam_name) : 0; - int len_sam_desc = sam_desc != NULL ? strlen(sam_desc) : 0; - - if (sam == NULL) return; - - DEBUG(5,("make_sam_str1: %d\n", __LINE__)); - - make_unistr2(&(sam->uni_acct_name), sam_acct, len_sam_acct); - make_unistr2(&(sam->uni_full_name), sam_name, len_sam_name); - make_unistr2(&(sam->uni_acct_desc), sam_desc, len_sam_desc); -} - /******************************************************************* reads or writes a SAM_STR1 structure. ********************************************************************/ -void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_buf, uint32 desc_buf, prs_struct *ps, int depth) +static void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_buf, uint32 desc_buf, prs_struct *ps, int depth) { if (sam == NULL) return; @@ -445,7 +349,7 @@ void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_bu /******************************************************************* makes a SAM_ENTRY1 structure. ********************************************************************/ -void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, +static void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, uint32 len_sam_name, uint32 len_sam_full, uint32 len_sam_desc, uint32 rid_user, uint16 acb_info) { @@ -466,7 +370,7 @@ void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, /******************************************************************* reads or writes a SAM_ENTRY1 structure. ********************************************************************/ -void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth) +static void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth) { if (sam == NULL) return; @@ -487,25 +391,9 @@ void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth) } /******************************************************************* -makes a SAM_STR2 structure. -********************************************************************/ -void make_sam_str2(SAM_STR2 *sam, char *sam_acct, char *sam_desc) -{ - int len_sam_acct = sam_acct != NULL ? strlen(sam_acct) : 0; - int len_sam_desc = sam_desc != NULL ? strlen(sam_desc) : 0; - - if (sam == NULL) return; - - DEBUG(5,("make_sam_str2: %d\n", __LINE__)); - - make_unistr2(&(sam->uni_srv_name), sam_acct, len_sam_acct); - make_unistr2(&(sam->uni_srv_desc), sam_desc, len_sam_desc); -} - -/******************************************************************* reads or writes a SAM_STR2 structure. ********************************************************************/ -void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth) +static void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth) { if (sam == NULL) return; @@ -521,7 +409,7 @@ void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_bu /******************************************************************* makes a SAM_ENTRY2 structure. ********************************************************************/ -void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, +static void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, uint32 len_sam_name, uint32 len_sam_desc, uint32 rid_user, uint16 acb_info) { @@ -541,7 +429,7 @@ void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, /******************************************************************* reads or writes a SAM_ENTRY2 structure. ********************************************************************/ -void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth) +static void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth) { if (sam == NULL) return; @@ -561,25 +449,9 @@ void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth) } /******************************************************************* -makes a SAM_STR3 structure. -********************************************************************/ -void make_sam_str3(SAM_STR3 *sam, char *grp_acct, char *grp_desc) -{ - int len_grp_acct = strlen(grp_acct); - int len_grp_desc = strlen(grp_desc); - - if (sam == NULL) return; - - DEBUG(5,("make_sam_str3: %d\n", __LINE__)); - - make_unistr2(&(sam->uni_grp_name), grp_acct, len_grp_acct); - make_unistr2(&(sam->uni_grp_desc), grp_desc, len_grp_desc); -} - -/******************************************************************* reads or writes a SAM_STR3 structure. ********************************************************************/ -void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth) +static void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth) { if (sam == NULL) return; @@ -595,7 +467,7 @@ void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_bu /******************************************************************* makes a SAM_ENTRY3 structure. ********************************************************************/ -void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, +static void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, uint32 len_grp_name, uint32 len_grp_desc, uint32 rid_grp) { if (sam == NULL) return; @@ -613,7 +485,7 @@ void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, /******************************************************************* reads or writes a SAM_ENTRY3 structure. ********************************************************************/ -void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth) +static void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth) { if (sam == NULL) return; @@ -634,7 +506,7 @@ void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth) /******************************************************************* makes a SAM_ENTRY structure. ********************************************************************/ -void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid) +static void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid) { if (sam == NULL) return; @@ -647,7 +519,7 @@ void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid) /******************************************************************* reads or writes a SAM_ENTRY structure. ********************************************************************/ -void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth) +static void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth) { if (sam == NULL) return; @@ -659,26 +531,6 @@ void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth) smb_io_unihdr("unihdr", &(sam->hdr_name), ps, depth); /* account name unicode string header */ } -/******************************************************************* -makes a SAMR_Q_ENUM_DOM_USERS structure. -********************************************************************/ -void make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, - uint16 req_num_entries, uint16 unk_0, - uint16 acb_mask, uint16 unk_1, uint32 size) -{ - if (q_e == NULL || pol == NULL) return; - - DEBUG(5,("make_q_enum_dom_users\n")); - - memcpy(&(q_e->pol), pol, sizeof(*pol)); - - q_e->req_num_entries = req_num_entries; /* zero indicates lots */ - q_e->unknown_0 = unk_0; /* this gets returned in the response */ - q_e->acb_mask = acb_mask; - q_e->unknown_1 = unk_1; - q_e->max_size = size; -} - /******************************************************************* reads or writes a structure. @@ -809,21 +661,6 @@ void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struc prs_uint32("status", ps, depth, &(r_u->status)); } -/******************************************************************* -makes a SAMR_Q_ENUM_DOM_ALIASES structure. -********************************************************************/ -void make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size) -{ - if (q_e == NULL || pol == NULL) return; - - DEBUG(5,("make_q_enum_dom_aliases\n")); - - memcpy(&(q_e->pol), pol, sizeof(*pol)); - - q_e->unknown_0 = 0; - q_e->max_size = size; -} - /******************************************************************* reads or writes a structure. @@ -940,26 +777,6 @@ void samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_s prs_uint32("status", ps, depth, &(r_u->status)); } -/******************************************************************* -makes a SAMR_Q_QUERY_DISPINFO structure. -********************************************************************/ -void make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, - uint16 switch_level, uint32 start_idx, uint32 size) -{ - if (q_e == NULL || pol == NULL) return; - - DEBUG(5,("make_q_query_dispinfo\n")); - - memcpy(&(q_e->pol), pol, sizeof(*pol)); - - q_e->switch_level = switch_level; - - q_e->unknown_0 = 0; - q_e->start_idx = start_idx; - q_e->unknown_1 = 0x000007d0; - q_e->max_size = size; -} - /******************************************************************* reads or writes a structure. @@ -1033,7 +850,7 @@ void make_sam_info_2(SAM_INFO_2 *sam, uint32 acb_mask, /******************************************************************* reads or writes a structure. ********************************************************************/ -void sam_io_sam_info_2(char *desc, SAM_INFO_2 *sam, prs_struct *ps, int depth) +static void sam_io_sam_info_2(char *desc, SAM_INFO_2 *sam, prs_struct *ps, int depth) { int i; @@ -1116,7 +933,7 @@ void make_sam_info_1(SAM_INFO_1 *sam, uint32 acb_mask, /******************************************************************* reads or writes a structure. ********************************************************************/ -void sam_io_sam_info_1(char *desc, SAM_INFO_1 *sam, prs_struct *ps, int depth) +static void sam_io_sam_info_1(char *desc, SAM_INFO_1 *sam, prs_struct *ps, int depth) { int i; @@ -1218,26 +1035,6 @@ void samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struc } -/******************************************************************* -makes a SAMR_Q_ENUM_DOM_GROUPS structure. -********************************************************************/ -void make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, - uint16 switch_level, uint32 start_idx, uint32 size) -{ - if (q_e == NULL || pol == NULL) return; - - DEBUG(5,("make_q_enum_dom_groups\n")); - - memcpy(&(q_e->pol), pol, sizeof(*pol)); - - q_e->switch_level = switch_level; - - q_e->unknown_0 = 0; - q_e->start_idx = start_idx; - q_e->unknown_1 = 0x000007d0; - q_e->max_size = size; -} - /******************************************************************* reads or writes a structure. @@ -1370,22 +1167,6 @@ void samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_str } -/******************************************************************* -makes a SAMR_Q_QUERY_ALIASINFO structure. -********************************************************************/ -void make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e, - POLICY_HND *pol, - uint16 switch_level) -{ - if (q_e == NULL || pol == NULL) return; - - DEBUG(5,("make_q_query_aliasinfo\n")); - - memcpy(&(q_e->pol), pol, sizeof(*pol)); - - q_e->switch_level = switch_level; -} - /******************************************************************* reads or writes a structure. @@ -1709,33 +1490,6 @@ void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *p } /******************************************************************* -makes a SAMR_Q_UNKNOWN_12 structure. -********************************************************************/ -void make_samr_q_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, - POLICY_HND *pol, uint32 rid, - uint32 num_gids, uint32 *gid) -{ - int i; - if (q_u == NULL) return; - - DEBUG(5,("make_samr_r_unknwon_12\n")); - - memcpy(&(q_u->pol), pol, sizeof(*pol)); - - q_u->num_gids1 = num_gids; - q_u->rid = rid; - q_u->ptr = 0; - q_u->num_gids2 = num_gids; - - SMB_ASSERT_ARRAY(q_u->gid, num_gids); - - for (i = 0; i < num_gids; i++) - { - q_u->gid[i] = gid[i]; - } -} - -/******************************************************************* reads or writes a structure. ********************************************************************/ void samr_io_q_unknown_12(char *desc, SAMR_Q_UNKNOWN_12 *q_u, prs_struct *ps, int depth) @@ -1870,23 +1624,6 @@ void samr_io_r_unknown_12(char *desc, SAMR_R_UNKNOWN_12 *r_u, prs_struct *ps, i prs_uint32("status", ps, depth, &(r_u->status)); } -/******************************************************************* -reads or writes a structure. -********************************************************************/ -void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, - POLICY_HND *pol, - uint32 unk_0, uint32 rid) -{ - if (q_u == NULL) return; - - DEBUG(5,("samr_make_q_open_user\n")); - - memcpy(&q_u->domain_pol, pol, sizeof(q_u->domain_pol)); - - q_u->unknown_0 = unk_0; - q_u->user_rid = rid; -} - /******************************************************************* reads or writes a structure. @@ -1929,19 +1666,6 @@ void samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int /******************************************************************* -makes a SAMR_Q_QUERY_USERGROUPS structure. -********************************************************************/ -void make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, - POLICY_HND *hnd) -{ - if (q_u == NULL || hnd == NULL) return; - - DEBUG(5,("make_samr_q_query_usergroups\n")); - - memcpy(&(q_u->pol), hnd, sizeof(q_u->pol)); -} - -/******************************************************************* reads or writes a structure. ********************************************************************/ void samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth) @@ -2032,20 +1756,6 @@ void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_s } /******************************************************************* -makes a SAMR_Q_QUERY_USERINFO structure. -********************************************************************/ -void make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, - POLICY_HND *hnd, uint16 switch_value) -{ - if (q_u == NULL || hnd == NULL) return; - - DEBUG(5,("make_samr_q_query_userinfo\n")); - - memcpy(&(q_u->pol), hnd, sizeof(q_u->pol)); - q_u->switch_value = switch_value; -} - -/******************************************************************* reads or writes a structure. ********************************************************************/ void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth) @@ -2068,7 +1778,7 @@ void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struc /******************************************************************* reads or writes a LOGON_HRS structure. ********************************************************************/ -void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth) +static void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth) { if (hrs == NULL) return; @@ -2088,104 +1798,6 @@ void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth) prs_uint8s (False, "hours", ps, depth, hrs->hours, hrs->len); } -/******************************************************************* -makes a SAM_USER_INFO_11 structure. -********************************************************************/ -void make_sam_user_info11(SAM_USER_INFO_11 *usr, - NTTIME *expiry, - char *mach_acct, - uint32 rid_user, - uint32 rid_group, - uint16 acct_ctrl) - -{ - int len_mach_acct; - if (usr == NULL || expiry == NULL || mach_acct == NULL) return; - - DEBUG(5,("make_samr_r_unknown_24\n")); - - len_mach_acct = strlen(mach_acct); - - memcpy(&(usr->expiry),expiry, sizeof(usr->expiry)); /* expiry time or something? */ - bzero(usr->padding_1, sizeof(usr->padding_1)); /* 0 - padding 24 bytes */ - - make_uni_hdr(&(usr->hdr_mach_acct), len_mach_acct, len_mach_acct, 4); /* unicode header for machine account */ - usr->padding_2 = 0; /* 0 - padding 4 bytes */ - - usr->ptr_1 = 1; /* pointer */ - bzero(usr->padding_3, sizeof(usr->padding_3)); /* 0 - padding 32 bytes */ - usr->padding_4 = 0; /* 0 - padding 4 bytes */ - - usr->ptr_2 = 1; /* pointer */ - usr->padding_5 = 0; /* 0 - padding 4 bytes */ - - usr->ptr_3 = 1; /* pointer */ - bzero(usr->padding_6, sizeof(usr->padding_6)); /* 0 - padding 32 bytes */ - - usr->rid_user = rid_user; - usr->rid_group = rid_group; - - usr->acct_ctrl = acct_ctrl; - usr->unknown_3 = 0x0000; - - usr->unknown_4 = 0x003f; /* 0x003f - 16 bit unknown */ - usr->unknown_5 = 0x003c; /* 0x003c - 16 bit unknown */ - - bzero(usr->padding_7, sizeof(usr->padding_7)); /* 0 - padding 16 bytes */ - usr->padding_8 = 0; /* 0 - padding 4 bytes */ - - make_unistr2(&(usr->uni_mach_acct), mach_acct, len_mach_acct); /* unicode string for machine account */ - - bzero(usr->padding_9, sizeof(usr->padding_9)); /* 0 - padding 48 bytes */ -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ -void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth) -{ - if (usr == NULL) return; - - prs_debug(ps, depth, desc, "samr_io_r_unknown_24"); - depth++; - - prs_align(ps); - - prs_uint8s (False, "padding_0", ps, depth, usr->padding_0, sizeof(usr->padding_0)); - - smb_io_time("time", &(usr->expiry), ps, depth); - - prs_uint8s (False, "padding_1", ps, depth, usr->padding_1, sizeof(usr->padding_1)); - - smb_io_unihdr ("unihdr", &(usr->hdr_mach_acct), ps, depth); - prs_uint32( "padding_2", ps, depth, &(usr->padding_2)); - - prs_uint32( "ptr_1 ", ps, depth, &(usr->ptr_1 )); - prs_uint8s (False, "padding_3", ps, depth, usr->padding_3, sizeof(usr->padding_3)); - prs_uint32( "padding_4", ps, depth, &(usr->padding_4)); - - prs_uint32( "ptr_2 ", ps, depth, &(usr->ptr_2 )); - prs_uint32( "padding_5", ps, depth, &(usr->padding_5)); - - prs_uint32( "ptr_3 ", ps, depth, &(usr->ptr_3 )); - prs_uint8s (False, "padding_6", ps, depth, usr->padding_6, sizeof(usr->padding_6)); - - prs_uint32( "rid_user ", ps, depth, &(usr->rid_user )); - prs_uint32( "rid_group", ps, depth, &(usr->rid_group)); - prs_uint16( "acct_ctrl", ps, depth, &(usr->acct_ctrl)); - prs_uint16( "unknown_3", ps, depth, &(usr->unknown_3)); - prs_uint16( "unknown_4", ps, depth, &(usr->unknown_4)); - prs_uint16( "unknown_5", ps, depth, &(usr->unknown_5)); - - prs_uint8s (False, "padding_7", ps, depth, usr->padding_7, sizeof(usr->padding_7)); - prs_uint32( "padding_8", ps, depth, &(usr->padding_8)); - - smb_io_unistr2("unistr2", &(usr->uni_mach_acct), True, ps, depth); - prs_align(ps); - - prs_uint8s (False, "padding_9", ps, depth, usr->padding_9, sizeof(usr->padding_9)); -} - /************************************************************************* make_sam_user_info21 @@ -2295,7 +1907,7 @@ void make_sam_user_info21(SAM_USER_INFO_21 *usr, /******************************************************************* reads or writes a structure. ********************************************************************/ -void sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *ps, int depth) +static void sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *ps, int depth) { if (usr == NULL) return; @@ -2489,75 +2101,6 @@ void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struc prs_uint32("status", ps, depth, &(r_u->status)); } - -/******************************************************************* -makes a SAMR_Q_UNKNOWN_21 structure. -********************************************************************/ -void make_samr_q_unknown_21(SAMR_Q_UNKNOWN_21 *q_c, - POLICY_HND *hnd, uint16 unk_1, uint16 unk_2) -{ - if (q_c == NULL || hnd == NULL) return; - - DEBUG(5,("make_samr_q_unknown_21\n")); - - memcpy(&(q_c->group_pol), hnd, sizeof(q_c->group_pol)); - q_c->unknown_1 = unk_1; - q_c->unknown_2 = unk_2; -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ -void samr_io_q_unknown_21(char *desc, SAMR_Q_UNKNOWN_21 *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return; - - prs_debug(ps, depth, desc, "samr_io_q_unknown_21"); - depth++; - - prs_align(ps); - - smb_io_pol_hnd("group_pol", &(q_u->group_pol), ps, depth); - prs_align(ps); - - prs_uint16("unknown_1", ps, depth, &(q_u->unknown_1)); - prs_uint16("unknown_2", ps, depth, &(q_u->unknown_2)); -} - -/******************************************************************* -makes a SAMR_Q_UNKNOWN_13 structure. -********************************************************************/ -void make_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c, - POLICY_HND *hnd, uint16 unk_1, uint16 unk_2) -{ - if (q_c == NULL || hnd == NULL) return; - - DEBUG(5,("make_samr_q_unknown_13\n")); - - memcpy(&(q_c->alias_pol), hnd, sizeof(q_c->alias_pol)); - q_c->unknown_1 = unk_1; - q_c->unknown_2 = unk_2; -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ -void samr_io_q_unknown_13(char *desc, SAMR_Q_UNKNOWN_13 *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return; - - prs_debug(ps, depth, desc, "samr_io_q_unknown_13"); - depth++; - - prs_align(ps); - - smb_io_pol_hnd("alias_pol", &(q_u->alias_pol), ps, depth); - prs_align(ps); - - prs_uint16("unknown_1", ps, depth, &(q_u->unknown_1)); - prs_uint16("unknown_2", ps, depth, &(q_u->unknown_2)); -} - /******************************************************************* reads or writes a structure. ********************************************************************/ @@ -2603,25 +2146,6 @@ void samr_io_r_unknown_32(char *desc, SAMR_R_UNKNOWN_32 *r_u, prs_struct *ps, i /******************************************************************* -makes a SAMR_Q_CONNECT structure. -********************************************************************/ -void make_samr_q_connect(SAMR_Q_CONNECT *q_u, - char *srv_name, uint32 unknown_0) -{ - int len_srv_name = strlen(srv_name); - - if (q_u == NULL) return; - - DEBUG(5,("make_q_connect\n")); - - /* make PDC server name \\server */ - make_unistr2(&(q_u->uni_srv_name), srv_name, len_srv_name); - - /* example values: 0x0000 0002 */ - q_u->unknown_0 = unknown_0; -} - -/******************************************************************* reads or writes a structure. ********************************************************************/ void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth) @@ -2660,22 +2184,6 @@ void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int dep } /******************************************************************* -makes a SAMR_Q_OPEN_ALIAS structure. -********************************************************************/ -void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, - uint32 unknown_0, uint32 rid) -{ - if (q_u == NULL) return; - - DEBUG(5,("make_q_open_alias\n")); - - /* example values: 0x0000 0008 */ - q_u->unknown_0 = unknown_0; - - q_u->rid_alias = rid; -} - -/******************************************************************* reads or writes a structure. ********************************************************************/ void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth) @@ -2709,106 +2217,6 @@ void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, i prs_uint32("status", ps, depth, &(r_u->status)); } -/******************************************************************* -makes a SAMR_Q_UNKNOWN_38 structure. -********************************************************************/ -void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name) -{ - int len_srv_name = strlen(srv_name); - - if (q_u == NULL) return; - - DEBUG(5,("make_q_unknown_38\n")); - - q_u->ptr = 1; - make_uni_hdr(&(q_u->hdr_srv_name), len_srv_name, len_srv_name, len_srv_name != 0); - make_unistr2(&(q_u->uni_srv_name), srv_name, len_srv_name); - -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ -void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) return; - - prs_debug(ps, depth, desc, "samr_io_q_unknown_38"); - depth++; - - prs_align(ps); - - prs_uint32("ptr", ps, depth, &(q_u->ptr)); - if (q_u->ptr != 0) - { - smb_io_unihdr ("", &(q_u->hdr_srv_name), ps, depth); - smb_io_unistr2("", &(q_u->uni_srv_name), q_u->hdr_srv_name.buffer, ps, depth); - } -} - -/******************************************************************* -makes a SAMR_R_UNKNOWN_38 structure. -********************************************************************/ -void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, - uint16 level, uint32 status) -{ - if (r_u == NULL) return; - - DEBUG(5,("make_r_unknown_38\n")); - - r_u->level.value = level; - r_u->ptr_0 = 0; - r_u->status = status; -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ -void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth) -{ - if (r_u == NULL) return; - - prs_debug(ps, depth, desc, "samr_io_r_unknown_38"); - depth++; - - prs_align(ps); - - smb_io_lookup_level("level ", &(r_u->level), ps, depth); - prs_uint32("ptr_0 ", ps, depth, &(r_u->ptr_0 )); - prs_uint32("status", ps, depth, &(r_u->status)); -} - -/******************************************************************* -reads or writes a SAMR_ENC_PASSWD structure. -********************************************************************/ -void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth) -{ - if (pwd == NULL) return; - - prs_debug(ps, depth, desc, "samr_io_enc_passwd"); - depth++; - - prs_align(ps); - - prs_uint32("ptr", ps, depth, &(pwd->ptr)); - prs_uint8s(False, "pwd", ps, depth, pwd->pass, sizeof(pwd->pass)); -} - -/******************************************************************* -reads or writes a SAMR_ENC_HASH structure. -********************************************************************/ -void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth) -{ - if (hsh == NULL) return; - - prs_debug(ps, depth, desc, "samr_io_enc_hash"); - depth++; - - prs_align(ps); - - prs_uint32("ptr ", ps, depth, &(hsh->ptr)); - prs_uint8s(False, "hash", ps, depth, hsh->hash, sizeof(hsh->hash)); -} #if 0 /* SAMR_Q_CHGPASSWD_USER */ diff --git a/source3/rpc_parse/parse_srv.c b/source3/rpc_parse/parse_srv.c index 356b515f19..db557028a5 100644 --- a/source3/rpc_parse/parse_srv.c +++ b/source3/rpc_parse/parse_srv.c @@ -44,7 +44,7 @@ void make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth) +static void srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth) { if (sh1 == NULL) return; @@ -74,7 +74,7 @@ void make_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *rem /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth) +static void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth) { if (sh1 == NULL) return; @@ -91,7 +91,7 @@ void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_struct *ps, int depth) +static void srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_struct *ps, int depth) { if (ctr == NULL) return; @@ -152,7 +152,7 @@ void make_srv_share_info2_str(SH_INFO_2_STR *sh2, /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth) +static void srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth) { if (sh2 == NULL) return; @@ -193,7 +193,7 @@ void make_srv_share_info2(SH_INFO_2 *sh2, /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth) +static void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth) { if (sh2 == NULL) return; @@ -215,7 +215,7 @@ void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, int depth) +static void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, int depth) { if (ctr == NULL) return; @@ -259,7 +259,7 @@ void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth) +static void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth) { if (ctr == NULL) return; @@ -298,29 +298,6 @@ void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, - char *srv_name, - uint32 share_level, SRV_SHARE_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd) -{ - if (q_n == NULL || ctr == NULL || hnd == NULL) return; - - q_n->ctr = ctr; - - DEBUG(5,("make_q_net_share_enum\n")); - - make_buf_unistr2(&(q_n->uni_srv_name), &(q_n->ptr_srv_name), srv_name); - - q_n->share_level = share_level; - q_n->preferred_len = preferred_len; - - memcpy(&(q_n->enum_hnd), hnd, sizeof(*hnd)); -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ void srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth) { if (q_n == NULL) return; @@ -386,7 +363,7 @@ void make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth) +static void srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth) { if (ss0 == NULL) return; @@ -413,7 +390,7 @@ void make_srv_sess_info0(SESS_INFO_0 *ss0, char *name) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth) +static void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth) { if (ss0 == NULL) return; @@ -428,7 +405,7 @@ void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth) +static void srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth) { if (ss0 == NULL) return; @@ -485,7 +462,7 @@ void make_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth) +static void srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth) { if (ss1 == NULL) return; @@ -522,7 +499,7 @@ void make_srv_sess_info1(SESS_INFO_1 *ss1, /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth) +static void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth) { if (ss1 == NULL) return; @@ -543,7 +520,7 @@ void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth) +static void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth) { if (ss1 == NULL) return; @@ -587,7 +564,7 @@ void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, i /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct *ps, int depth) +static void srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct *ps, int depth) { if (ctr == NULL) return; @@ -626,30 +603,6 @@ void srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct *ps, in /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 sess_level, SRV_SESS_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd) -{ - if (q_n == NULL || ctr == NULL || hnd == NULL) return; - - q_n->ctr = ctr; - - DEBUG(5,("make_q_net_sess_enum\n")); - - make_buf_unistr2(&(q_n->uni_srv_name), &(q_n->ptr_srv_name), srv_name); - make_buf_unistr2(&(q_n->uni_qual_name), &(q_n->ptr_qual_name), qual_name); - - q_n->sess_level = sess_level; - q_n->preferred_len = preferred_len; - - memcpy(&(q_n->enum_hnd), hnd, sizeof(*hnd)); -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ void srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth) { if (q_n == NULL) return; @@ -720,7 +673,7 @@ void make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth) +static void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth) { if (ss0 == NULL) return; @@ -735,7 +688,7 @@ void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth) +static void srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth) { if (ss0 == NULL) return; @@ -784,7 +737,7 @@ void make_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_nam /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth) +static void srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth) { if (ss1 == NULL) return; @@ -822,7 +775,7 @@ void make_srv_conn_info1(CONN_INFO_1 *ss1, /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth) +static void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth) { if (ss1 == NULL) return; @@ -844,7 +797,7 @@ void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth) +static void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth) { if (ss1 == NULL) return; @@ -886,7 +839,7 @@ void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, i /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct *ps, int depth) +static void srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct *ps, int depth) { if (ctr == NULL) return; @@ -925,30 +878,6 @@ void srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct *ps, in /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 conn_level, SRV_CONN_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd) -{ - if (q_n == NULL || ctr == NULL || hnd == NULL) return; - - q_n->ctr = ctr; - - DEBUG(5,("make_q_net_conn_enum\n")); - - make_buf_unistr2(&(q_n->uni_srv_name ), &(q_n->ptr_srv_name ), srv_name ); - make_buf_unistr2(&(q_n->uni_qual_name), &(q_n->ptr_qual_name), qual_name); - - q_n->conn_level = conn_level; - q_n->preferred_len = preferred_len; - - memcpy(&(q_n->enum_hnd), hnd, sizeof(*hnd)); -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ void srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth) { if (q_n == NULL) return; @@ -1020,7 +949,7 @@ void make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_n /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth) +static void srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth) { if (sh1 == NULL) return; @@ -1055,7 +984,7 @@ void make_srv_file_info3(FILE_INFO_3 *fl3, /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth) +static void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth) { if (fl3 == NULL) return; @@ -1074,7 +1003,7 @@ void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth) /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, int depth) +static void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, int depth) { if (fl3 == NULL) return; @@ -1115,7 +1044,7 @@ void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, i /******************************************************************* reads or writes a structure. ********************************************************************/ -void srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth) +static void srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth) { if (ctr == NULL) return; @@ -1149,30 +1078,6 @@ void srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, in /******************************************************************* reads or writes a structure. ********************************************************************/ -void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 file_level, SRV_FILE_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd) -{ - if (q_n == NULL || ctr == NULL || hnd == NULL) return; - - q_n->ctr = ctr; - - DEBUG(5,("make_q_net_file_enum\n")); - - make_buf_unistr2(&(q_n->uni_srv_name), &(q_n->ptr_srv_name), srv_name); - make_buf_unistr2(&(q_n->uni_qual_name), &(q_n->ptr_qual_name), qual_name); - - q_n->file_level = file_level; - q_n->preferred_len = preferred_len; - - memcpy(&(q_n->enum_hnd), hnd, sizeof(*hnd)); -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ void srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth) { if (q_n == NULL) return; @@ -1251,7 +1156,7 @@ void make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, /******************************************************************* reads or writes a SRV_INFO_101 structure. ********************************************************************/ -void srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth) +static void srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth) { if (sv101 == NULL) return; @@ -1308,7 +1213,7 @@ void make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, /******************************************************************* reads or writes a SRV_INFO_102 structure. ********************************************************************/ -void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth) +static void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth) { if (sv102 == NULL) return; @@ -1344,7 +1249,7 @@ void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth /******************************************************************* reads or writes a SRV_INFO_102 structure. ********************************************************************/ -void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth) +static void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth) { if (ctr == NULL) return; @@ -1380,20 +1285,6 @@ void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth) } } -/******************************************************************* - makes a SRV_Q_NET_SRV_GET_INFO structure. - ********************************************************************/ -void make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv, - char *server_name, uint32 switch_value) -{ - if (srv == NULL) return; - - DEBUG(5,("make_srv_q_net_srv_get_info\n")); - - make_buf_unistr2(&(srv->uni_srv_name), &(srv->ptr_srv_name), server_name); - - srv->switch_value = switch_value; -} /******************************************************************* reads or writes a structure. @@ -1460,80 +1351,6 @@ void srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_str /******************************************************************* - makes a SRV_Q_NET_SRV_SET_INFO structure. - ********************************************************************/ -void make_srv_q_net_srv_set_info(SRV_Q_NET_SRV_SET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr) -{ - if (srv == NULL) return; - - DEBUG(5,("make_srv_r_net_srv_set_info\n")); - - srv->ctr = ctr; - - srv->ctr->switch_value = switch_value; - srv->ctr->ptr_srv_ctr = 1; -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ -void srv_io_q_net_srv_set_info(char *desc, SRV_Q_NET_SRV_SET_INFO *q_n, prs_struct *ps, int depth) -{ - if (q_n == NULL) return; - - prs_debug(ps, depth, desc, "srv_io_q_net_srv_set_info"); - depth++; - - prs_align(ps); - - prs_uint32("ptr_srv_name ", ps, depth, &(q_n->ptr_srv_name)); - smb_io_unistr2("", &(q_n->uni_srv_name), True, ps, depth); - - prs_align(ps); - - srv_io_info_ctr("ctr", q_n->ctr, ps, depth); -} - -/******************************************************************* - makes a SRV_R_NET_SRV_SET_INFO structure. - ********************************************************************/ -void make_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status) -{ - if (srv == NULL) return; - - DEBUG(5,("make_srv_r_net_srv_set_info\n")); - - if (status == 0x0) - { - srv->switch_value = switch_value; - } - else - { - srv->switch_value = 0; - } - - srv->status = status; -} - -/******************************************************************* - reads or writes a structure. - ********************************************************************/ -void srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n, prs_struct *ps, int depth) -{ - if (r_n == NULL) return; - - prs_debug(ps, depth, desc, "srv_io_q_net_srv_set_info"); - depth++; - - prs_align(ps); - - prs_uint32("switch_value", ps, depth, &(r_n->switch_value)); - prs_uint32("status ", ps, depth, &(r_n->status )); -} - -/******************************************************************* reads or writes a structure. ********************************************************************/ void srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth) @@ -1552,7 +1369,7 @@ void srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct /******************************************************************* reads or writes a TIME_OF_DAY_INFO structure. ********************************************************************/ -void srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth) +static void srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth) { if (tod == NULL) return; diff --git a/source3/rpc_parse/parse_wks.c b/source3/rpc_parse/parse_wks.c index 694acb5eec..a5e4d2318f 100644 --- a/source3/rpc_parse/parse_wks.c +++ b/source3/rpc_parse/parse_wks.c @@ -27,20 +27,6 @@ extern int DEBUGLEVEL; - -/******************************************************************* - make_wks_q_query_info - ********************************************************************/ -void make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, - char *server, uint16 switch_value) -{ - DEBUG(5,("make_wks_q_query_info: %d\n", __LINE__)); - - make_buf_unistr2(&(q_u->uni_srv_name), &(q_u->ptr_srv_name), server); - q_u->switch_value = switch_value; - -} - /******************************************************************* reads or writes a WKS_Q_QUERY_INFO structure. ********************************************************************/ @@ -81,7 +67,7 @@ void make_wks_info_100(WKS_INFO_100 *inf, /******************************************************************* reads or writes a WKS_INFO_100 structure. ********************************************************************/ -void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth) +static void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth) { if (inf == NULL) return; diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c index d65116e646..addedaec90 100644 --- a/source3/rpc_server/srv_lsa_hnd.c +++ b/source3/rpc_server/srv_lsa_hnd.c @@ -64,7 +64,7 @@ static struct bitmap *bmap; /**************************************************************************** create a unique policy handle ****************************************************************************/ -void create_pol_hnd(POLICY_HND *hnd) +static void create_pol_hnd(POLICY_HND *hnd) { static uint32 pol_hnd_low = 0; static uint32 pol_hnd_high = 0; @@ -263,26 +263,6 @@ BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name) } /**************************************************************************** - get reg name -****************************************************************************/ -BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, char *name) -{ - struct policy *p = find_lsa_policy(hnd); - - if (p && p->open) { - fstrcpy(name, p->dev.reg.name); - - DEBUG(3,("Getting policy pnum=%x name=%s\n", - p->pnum, name)); - - return True; - } - - DEBUG(3,("Error getting policy\n")); - return False; -} - -/**************************************************************************** close an lsa policy ****************************************************************************/ BOOL close_lsa_policy_hnd(POLICY_HND *hnd) diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index b030ee0e90..54b9ce1539 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -235,15 +235,6 @@ int read_pipe(pipes_struct *p, char *data, uint32 pos, int n) /**************************************************************************** - gets the name of a pipe -****************************************************************************/ -char *get_rpc_pipe_hnd_name(pipes_struct *p) -{ - return p?p->name:NULL; -} - - -/**************************************************************************** set device state on a pipe. exactly what this is for is unknown... ****************************************************************************/ BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state) diff --git a/source3/rpc_server/srv_util.c b/source3/rpc_server/srv_util.c index 0a7728aa3a..68a4f79f0b 100644 --- a/source3/rpc_server/srv_util.c +++ b/source3/rpc_server/srv_util.c @@ -81,48 +81,6 @@ rid_name domain_group_rids[] = { 0 , NULL } }; -/************************************************************************** - Check if a name matches any of the well known SID values. -***************************************************************************/ - -BOOL lookup_wellknown_sid_from_name(char *windows_name, DOM_SID *psid) -{ - rid_name *rnp; - int i; - - for( i = 0; builtin_alias_rids[i].name != NULL; i++) { - rnp = &builtin_alias_rids[i]; - if(strequal(rnp->name, windows_name)) { - string_to_sid( psid, "S-1-5-32" ); - SMB_ASSERT_ARRAY(psid->sub_auths, psid->num_auths+1); - psid->sub_auths[psid->num_auths++] = rnp->rid; - return True; - } - } - - for( i = 0; domain_user_rids[i].name != NULL; i++ ) { - rnp = &domain_user_rids[i]; - if(strequal(rnp->name, windows_name)) { - *psid = global_machine_sid; - SMB_ASSERT_ARRAY(psid->sub_auths, psid->num_auths+1); - psid->sub_auths[psid->num_auths++] = rnp->rid; - return True; - } - } - - for( i = 0; domain_group_rids[i].name != NULL; i++ ) { - rnp = &domain_group_rids[i]; - if(strequal(rnp->name, windows_name)) { - *psid = global_machine_sid; - SMB_ASSERT_ARRAY(psid->sub_auths, psid->num_auths+1); - psid->sub_auths[psid->num_auths++] = rnp->rid; - return True; - } - } - - return False; -} - int make_dom_gids(char *gids_str, DOM_GID **ppgids) { char *ptr; diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index c9478166c4..68cbe9b35b 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -292,7 +292,7 @@ static int talktochild(int master, char *chatsequence) } -BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root) +static BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root) { char *slavedev; int master; diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 656bb8997c..115ff699c7 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -28,12 +28,13 @@ extern BOOL short_case_preserve; extern fstring remote_machine; extern BOOL use_mangled_map; +static BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache); + /**************************************************************************** Check if two filenames are equal. This needs to be careful about whether we are case sensitive. ****************************************************************************/ - -BOOL fname_equal(char *name1, char *name2) +static BOOL fname_equal(char *name1, char *name2) { int l1 = strlen(name1); int l2 = strlen(name2); @@ -68,8 +69,7 @@ BOOL fname_equal(char *name1, char *name2) /**************************************************************************** Mangle the 2nd name and check if it is then equal to the first name. ****************************************************************************/ - -BOOL mangled_equal(char *name1, char *name2) +static BOOL mangled_equal(char *name1, char *name2) { pstring tmpname; @@ -633,7 +633,7 @@ scan a directory to find a filename, matching without case sensitivity If the name looks like a mangled name then try via the mangling functions ****************************************************************************/ -BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache) +static BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache) { void *cur_dir; char *dname; diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 0b72bcf0fa..0fe6a4ebd1 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -133,8 +133,9 @@ file_fd_struct *fd_get_already_open(SMB_STRUCT_STAT *sbuf) (unsigned int)fd_ptr->dev, (double)fd_ptr->inode, fd_ptr->ref_count)); #else /* LARGE_SMB_INO_T */ - DEBUG(3,("Re-used file_fd_struct dev = %x, inode = %lx, ref_count = %d\n", - (unsigned int)fd_ptr->dev, (unsigned long)fd_ptr->inode, + DEBUG(3,("Re-used file_fd_struct dev = %x, inode = %x, ref_count = %d\n", + (unsigned int)fd_ptr->dev, + (unsigned int)fd_ptr->inode, fd_ptr->ref_count)); #endif /* LARGE_SMB_INO_T */ return fd_ptr; diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index 048afe35cd..8f7b1a9e15 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -725,7 +725,7 @@ static void fill_printq_info(connection_struct *conn, int snum, int uLevel, } /* This function returns the number of files for a given driver */ -int get_printerdrivernumber(int snum) +static int get_printerdrivernumber(int snum) { int i=0,ok=0; pstring tok; diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 3fdee043dc..0f50145d7f 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -33,6 +33,8 @@ extern BOOL case_sensitive; extern BOOL case_preserve; extern BOOL short_case_preserve; +static void remove_pending_change_notify_requests_by_mid(int mid); + static char *known_nt_pipes[] = { "\\LANMAN", "\\srvsvc", @@ -1045,7 +1047,7 @@ void remove_pending_change_notify_requests_by_fid(files_struct *fsp) Delete entries by mid from the change notify pending queue. Always send reply. *****************************************************************************/ -void remove_pending_change_notify_requests_by_mid(int mid) +static void remove_pending_change_notify_requests_by_mid(int mid) { change_notify_buf *cnbp = (change_notify_buf *)ubi_slFirst( &change_notify_queue ); change_notify_buf *prev = NULL; diff --git a/source3/smbd/open.c b/source3/smbd/open.c index a72469f2b2..e6289b1cdb 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -589,6 +589,102 @@ static void truncate_unless_locked(files_struct *fsp, connection_struct *conn, i } +enum {AFAIL,AREAD,AWRITE,AALL}; + +/******************************************************************* +reproduce the share mode access table +********************************************************************/ +static int access_table(int new_deny,int old_deny,int old_mode, + int share_pid,char *fname) +{ + if (new_deny == DENY_ALL || old_deny == DENY_ALL) return(AFAIL); + + if (new_deny == DENY_DOS || old_deny == DENY_DOS) { + int pid = getpid(); + if (old_deny == new_deny && share_pid == pid) + return(AALL); + + if (old_mode == 0) return(AREAD); + + /* the new smbpub.zip spec says that if the file extension is + .com, .dll, .exe or .sym then allow the open. I will force + it to read-only as this seems sensible although the spec is + a little unclear on this. */ + if ((fname = strrchr(fname,'.'))) { + if (strequal(fname,".com") || + strequal(fname,".dll") || + strequal(fname,".exe") || + strequal(fname,".sym")) + return(AREAD); + } + + return(AFAIL); + } + + switch (new_deny) + { + case DENY_WRITE: + if (old_deny==DENY_WRITE && old_mode==0) return(AREAD); + if (old_deny==DENY_READ && old_mode==0) return(AWRITE); + if (old_deny==DENY_NONE && old_mode==0) return(AALL); + return(AFAIL); + case DENY_READ: + if (old_deny==DENY_WRITE && old_mode==1) return(AREAD); + if (old_deny==DENY_READ && old_mode==1) return(AWRITE); + if (old_deny==DENY_NONE && old_mode==1) return(AALL); + return(AFAIL); + case DENY_NONE: + if (old_deny==DENY_WRITE) return(AREAD); + if (old_deny==DENY_READ) return(AWRITE); + if (old_deny==DENY_NONE) return(AALL); + return(AFAIL); + } + return(AFAIL); +} + + +/**************************************************************************** +check if we can open a file with a share mode +****************************************************************************/ +static int check_share_mode( share_mode_entry *share, int deny_mode, + char *fname, + BOOL fcbopen, int *flags) +{ + int old_open_mode = share->share_mode &0xF; + int old_deny_mode = (share->share_mode >>4)&7; + + if (old_deny_mode > 4 || old_open_mode > 2) + { + DEBUG(0,("Invalid share mode found (%d,%d,%d) on file %s\n", + deny_mode,old_deny_mode,old_open_mode,fname)); + return False; + } + + { + int access_allowed = access_table(deny_mode,old_deny_mode,old_open_mode, + share->pid,fname); + + if ((access_allowed == AFAIL) || + (!fcbopen && (access_allowed == AREAD && *flags == O_RDWR)) || + (access_allowed == AREAD && *flags == O_WRONLY) || + (access_allowed == AWRITE && *flags == O_RDONLY)) + { + DEBUG(2,("Share violation on file (%d,%d,%d,%d,%s,fcbopen = %d, flags = %d) = %d\n", + deny_mode,old_deny_mode,old_open_mode, + share->pid,fname, fcbopen, *flags, access_allowed)); + return False; + } + + if (access_allowed == AREAD) + *flags = O_RDONLY; + + if (access_allowed == AWRITE) + *flags = O_WRONLY; + + } + return True; +} + /**************************************************************************** open a file with a share mode @@ -852,7 +948,7 @@ dev = %x, inode = %lx\n", old_shares[i].op_type, fname, (unsigned int)dev, (unsi dev = %x, inode = %.0f\n", oplock_request, fname, (unsigned int)dev, (double)inode)); #else /* LARGE_SMB_INO_T */ DEBUG(5,("open_file_shared: granted oplock (%x) on file %s, \ -dev = %x, inode = %lx\n", oplock_request, fname, (unsigned int)dev, (double)inode)); +dev = %x, inode = %lx\n", oplock_request, fname, (unsigned int)dev, (unsigned long)inode)); #endif /* LARGE_SMB_INO_T */ } @@ -953,58 +1049,6 @@ int open_directory(files_struct *fsp,connection_struct *conn, return 0; } -enum {AFAIL,AREAD,AWRITE,AALL}; - -/******************************************************************* -reproduce the share mode access table -********************************************************************/ -static int access_table(int new_deny,int old_deny,int old_mode, - int share_pid,char *fname) -{ - if (new_deny == DENY_ALL || old_deny == DENY_ALL) return(AFAIL); - - if (new_deny == DENY_DOS || old_deny == DENY_DOS) { - int pid = getpid(); - if (old_deny == new_deny && share_pid == pid) - return(AALL); - - if (old_mode == 0) return(AREAD); - - /* the new smbpub.zip spec says that if the file extension is - .com, .dll, .exe or .sym then allow the open. I will force - it to read-only as this seems sensible although the spec is - a little unclear on this. */ - if ((fname = strrchr(fname,'.'))) { - if (strequal(fname,".com") || - strequal(fname,".dll") || - strequal(fname,".exe") || - strequal(fname,".sym")) - return(AREAD); - } - - return(AFAIL); - } - - switch (new_deny) - { - case DENY_WRITE: - if (old_deny==DENY_WRITE && old_mode==0) return(AREAD); - if (old_deny==DENY_READ && old_mode==0) return(AWRITE); - if (old_deny==DENY_NONE && old_mode==0) return(AALL); - return(AFAIL); - case DENY_READ: - if (old_deny==DENY_WRITE && old_mode==1) return(AREAD); - if (old_deny==DENY_READ && old_mode==1) return(AWRITE); - if (old_deny==DENY_NONE && old_mode==1) return(AALL); - return(AFAIL); - case DENY_NONE: - if (old_deny==DENY_WRITE) return(AREAD); - if (old_deny==DENY_READ) return(AWRITE); - if (old_deny==DENY_NONE) return(AALL); - return(AFAIL); - } - return(AFAIL); -} /******************************************************************* check if the share mode on a file allows it to be deleted or unlinked @@ -1153,44 +1197,4 @@ free_and_exit: return(ret); } -/**************************************************************************** -check if we can open a file with a share mode -****************************************************************************/ -int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, - BOOL fcbopen, int *flags) -{ - int old_open_mode = share->share_mode &0xF; - int old_deny_mode = (share->share_mode >>4)&7; - - if (old_deny_mode > 4 || old_open_mode > 2) - { - DEBUG(0,("Invalid share mode found (%d,%d,%d) on file %s\n", - deny_mode,old_deny_mode,old_open_mode,fname)); - return False; - } - - { - int access_allowed = access_table(deny_mode,old_deny_mode,old_open_mode, - share->pid,fname); - - if ((access_allowed == AFAIL) || - (!fcbopen && (access_allowed == AREAD && *flags == O_RDWR)) || - (access_allowed == AREAD && *flags == O_WRONLY) || - (access_allowed == AWRITE && *flags == O_RDONLY)) - { - DEBUG(2,("Share violation on file (%d,%d,%d,%d,%s,fcbopen = %d, flags = %d) = %d\n", - deny_mode,old_deny_mode,old_open_mode, - share->pid,fname, fcbopen, *flags, access_allowed)); - return False; - } - - if (access_allowed == AREAD) - *flags = O_RDONLY; - - if (access_allowed == AWRITE) - *flags = O_WRONLY; - - } - return True; -} diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 6e675b56ef..dd882d08cc 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -34,6 +34,8 @@ BOOL global_oplock_break = False; extern int smb_read_error; +static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval); + /**************************************************************************** open the oplock IPC socket communication @@ -230,7 +232,7 @@ pid %d, port %d, dev = %x, inode = %lx\n", remotepid, from_port, (unsigned int)d /**************************************************************************** Process an oplock break directly. ****************************************************************************/ -BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval) +static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval) { extern struct current_user current_user; extern int Client; diff --git a/source3/smbd/password.c b/source3/smbd/password.c index dadbcad11e..684420f4c3 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -84,7 +84,7 @@ BOOL set_challenge(char *challenge) /******************************************************************* get the last challenge sent ********************************************************************/ -BOOL last_challenge(unsigned char *challenge) +static BOOL last_challenge(unsigned char *challenge) { if (!challenge_sent) return(False); memcpy(challenge,saved_challenge,8); @@ -299,7 +299,7 @@ void add_session_user(char *user) /**************************************************************************** update the encrypted smbpasswd file from the plaintext username and password *****************************************************************************/ -BOOL update_smbpassword_file(char *user, char *password) +static BOOL update_smbpassword_file(char *user, char *password) { struct smb_passwd *smbpw; BOOL ret; diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 63e51dc242..b72178013d 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -89,86 +89,6 @@ BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int tim } - -/**************************************************************************** - process an smb from the client - split out from the process() code so - it can be used by the oplock break code. -****************************************************************************/ -void process_smb(char *inbuf, char *outbuf) -{ - extern int Client; -#ifdef WITH_SSL - extern BOOL sslEnabled; /* don't use function for performance reasons */ - static int sslConnected = 0; -#endif /* WITH_SSL */ - static int trans_num; - int msg_type = CVAL(inbuf,0); - int32 len = smb_len(inbuf); - int nread = len + 4; - - if (trans_num == 0) { - /* on the first packet, check the global hosts allow/ hosts - deny parameters before doing any parsing of the packet - passed to us by the client. This prevents attacks on our - parsing code from hosts not in the hosts allow list */ - if (!check_access(Client, lp_hostsallow(-1), lp_hostsdeny(-1))) { - /* send a negative session response "not listining on calling - name" */ - static unsigned char buf[5] = {0x83, 0, 0, 1, 0x81}; - DEBUG( 1, ( "Connection denied from %s\n", - client_addr(Client) ) ); - send_smb(Client,(char *)buf); - exit_server("connection denied"); - } - } - - DEBUG( 6, ( "got message type 0x%x of len 0x%x\n", msg_type, len ) ); - DEBUG( 3, ( "Transaction %d of length %d\n", trans_num, nread ) ); - -#ifdef WITH_SSL - if(sslEnabled && !sslConnected){ - sslConnected = sslutil_negotiate_ssl(Client, msg_type); - if(sslConnected < 0){ /* an error occured */ - exit_server("SSL negotiation failed"); - }else if(sslConnected){ - trans_num++; - return; - } - } -#endif /* WITH_SSL */ - -#ifdef WITH_VTP - if(trans_num == 1 && VT_Check(inbuf)) - { - VT_Process(); - return; - } -#endif - - if (msg_type == 0) - show_msg(inbuf); - else if(msg_type == 0x85) - return; /* Keepalive packet. */ - - nread = construct_reply(inbuf,outbuf,nread,max_send); - - if(nread > 0) - { - if (CVAL(outbuf,0) == 0) - show_msg(outbuf); - - if (nread != smb_len(outbuf) + 4) - { - DEBUG(0,("ERROR: Invalid message response size! %d %d\n", - nread, smb_len(outbuf))); - } - else - send_smb(Client,outbuf); - } - trans_num++; -} - - /* These flags determine some of the permissions required to do an operation @@ -194,9 +114,6 @@ struct smb_message_struct char *name; int (*fn)(connection_struct *conn, char *, char *, int, int); int flags; -#if PROFILING - unsigned long time; -#endif } smb_messages[] = { @@ -302,26 +219,6 @@ struct smb_message_struct {SMBgetmac,"SMBgetmac",NULL,AS_GUEST} }; -/**************************************************************************** -return a string containing the function name of a SMB command -****************************************************************************/ -char *smb_fn_name(int type) -{ - static char *unknown_name = "SMBunknown"; - static int num_smb_messages = - sizeof(smb_messages) / sizeof(struct smb_message_struct); - int match; - - for (match=0;match<num_smb_messages;match++) - if (smb_messages[match].code == type) - break; - - if (match == num_smb_messages) - return(unknown_name); - - return(smb_messages[match].name); -} - /**************************************************************************** do a switch on the message type, and return the response size @@ -335,14 +232,6 @@ static int switch_message(int type,char *inbuf,char *outbuf,int size,int bufsize int match; extern int Client; -#if PROFILING - struct timeval msg_start_time; - struct timeval msg_end_time; - static unsigned long total_time = 0; - - GetTimeOfDay(&msg_start_time); -#endif - if (pid == -1) pid = getpid(); @@ -462,28 +351,142 @@ static int switch_message(int type,char *inbuf,char *outbuf,int size,int bufsize } } -#if PROFILING - GetTimeOfDay(&msg_end_time); - if (!(smb_messages[match].flags & TIME_INIT)) - { - smb_messages[match].time = 0; - smb_messages[match].flags |= TIME_INIT; + return(outsize); +} + + +/**************************************************************************** + construct a reply to the incoming packet +****************************************************************************/ +static int construct_reply(char *inbuf,char *outbuf,int size,int bufsize) +{ + int type = CVAL(inbuf,smb_com); + int outsize = 0; + int msg_type = CVAL(inbuf,0); + extern int chain_size; + + smb_last_time = time(NULL); + + chain_size = 0; + file_chain_reset(); + reset_chain_p(); + + if (msg_type != 0) + return(reply_special(inbuf,outbuf)); + + construct_reply_common(inbuf, outbuf); + + outsize = switch_message(type,inbuf,outbuf,size,bufsize); + + outsize += chain_size; + + if(outsize > 4) + smb_setlen(outbuf,outsize - 4); + return(outsize); +} + + +/**************************************************************************** + process an smb from the client - split out from the process() code so + it can be used by the oplock break code. +****************************************************************************/ +void process_smb(char *inbuf, char *outbuf) +{ + extern int Client; +#ifdef WITH_SSL + extern BOOL sslEnabled; /* don't use function for performance reasons */ + static int sslConnected = 0; +#endif /* WITH_SSL */ + static int trans_num; + int msg_type = CVAL(inbuf,0); + int32 len = smb_len(inbuf); + int nread = len + 4; + + if (trans_num == 0) { + /* on the first packet, check the global hosts allow/ hosts + deny parameters before doing any parsing of the packet + passed to us by the client. This prevents attacks on our + parsing code from hosts not in the hosts allow list */ + if (!check_access(Client, lp_hostsallow(-1), lp_hostsdeny(-1))) { + /* send a negative session response "not listining on calling + name" */ + static unsigned char buf[5] = {0x83, 0, 0, 1, 0x81}; + DEBUG( 1, ( "Connection denied from %s\n", + client_addr(Client) ) ); + send_smb(Client,(char *)buf); + exit_server("connection denied"); + } } + + DEBUG( 6, ( "got message type 0x%x of len 0x%x\n", msg_type, len ) ); + DEBUG( 3, ( "Transaction %d of length %d\n", trans_num, nread ) ); + +#ifdef WITH_SSL + if(sslEnabled && !sslConnected){ + sslConnected = sslutil_negotiate_ssl(Client, msg_type); + if(sslConnected < 0){ /* an error occured */ + exit_server("SSL negotiation failed"); + }else if(sslConnected){ + trans_num++; + return; + } + } +#endif /* WITH_SSL */ + +#ifdef WITH_VTP + if(trans_num == 1 && VT_Check(inbuf)) { - unsigned long this_time = - (msg_end_time.tv_sec - msg_start_time.tv_sec)*1e6 + - (msg_end_time.tv_usec - msg_start_time.tv_usec); - smb_messages[match].time += this_time; - total_time += this_time; + VT_Process(); + return; } - DEBUG(2,("TIME %s %d usecs %g pct\n", - smb_fn_name(type),smb_messages[match].time, - (100.0*smb_messages[match].time) / total_time)); #endif - return(outsize); + if (msg_type == 0) + show_msg(inbuf); + else if(msg_type == 0x85) + return; /* Keepalive packet. */ + + nread = construct_reply(inbuf,outbuf,nread,max_send); + + if(nread > 0) + { + if (CVAL(outbuf,0) == 0) + show_msg(outbuf); + + if (nread != smb_len(outbuf) + 4) + { + DEBUG(0,("ERROR: Invalid message response size! %d %d\n", + nread, smb_len(outbuf))); + } + else + send_smb(Client,outbuf); + } + trans_num++; +} + + + +/**************************************************************************** +return a string containing the function name of a SMB command +****************************************************************************/ +char *smb_fn_name(int type) +{ + static char *unknown_name = "SMBunknown"; + static int num_smb_messages = + sizeof(smb_messages) / sizeof(struct smb_message_struct); + int match; + + for (match=0;match<num_smb_messages;match++) + if (smb_messages[match].code == type) + break; + + if (match == num_smb_messages) + return(unknown_name); + + return(smb_messages[match].name); } + /**************************************************************************** Helper function for contruct_reply. ****************************************************************************/ @@ -591,37 +594,6 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize) } /**************************************************************************** - construct a reply to the incoming packet -****************************************************************************/ - -int construct_reply(char *inbuf,char *outbuf,int size,int bufsize) -{ - int type = CVAL(inbuf,smb_com); - int outsize = 0; - int msg_type = CVAL(inbuf,0); - extern int chain_size; - - smb_last_time = time(NULL); - - chain_size = 0; - file_chain_reset(); - reset_chain_p(); - - if (msg_type != 0) - return(reply_special(inbuf,outbuf)); - - construct_reply_common(inbuf, outbuf); - - outsize = switch_message(type,inbuf,outbuf,size,bufsize); - - outsize += chain_size; - - if(outsize > 4) - smb_setlen(outbuf,outsize - 4); - return(outsize); -} - -/**************************************************************************** process commands from the client ****************************************************************************/ void smbd_process(void) diff --git a/source3/smbd/server.c b/source3/smbd/server.c index dadf2018c8..5af62fd4a7 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -52,7 +52,7 @@ extern pstring myhostname; /**************************************************************************** when exiting, take the whole family ****************************************************************************/ -void *dflt_sig(void) +static void *dflt_sig(void) { exit_server("caught signal"); return NULL; @@ -61,7 +61,7 @@ void *dflt_sig(void) /**************************************************************************** Send a SIGTERM to our process group. *****************************************************************************/ -void killkids(void) +static void killkids(void) { if(am_parent) kill(0,SIGTERM); } diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index dd1aa8f48b..f0ed77bd97 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1587,7 +1587,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn, #ifdef LARGE_SMB_OFF_T DEBUG(6,("size: %.0f ", (double)size)); #else /* LARGE_SMB_OFF_T */ - DEBUG(6,("size: %x " , size)); + DEBUG(6,("size: %x " , (int)size)); #endif /* LARGE_SMB_OFF_T */ DEBUG(6,("mode: %x\n" , mode)); diff --git a/source3/utils/make_printerdef.c b/source3/utils/make_printerdef.c index 4745127175..76545b9903 100644 --- a/source3/utils/make_printerdef.c +++ b/source3/utils/make_printerdef.c @@ -32,12 +32,12 @@ char buffer[50][sizeof(pstring)]; char sbuffer[50][sizeof(pstring)]; char sub_dir[50][2][sizeof(pstring)]; -void usage(char *name) +static void usage(char *name) { fprintf(stderr,"%s: printer.def \"Printer Name\"\n", name); } -char *myfgets(char *s, int n, FILE *stream) +static char *myfgets(char *s, int n, FILE *stream) { char *LString1; char *LString2; @@ -76,7 +76,7 @@ char *myfgets(char *s, int n, FILE *stream) on both side of the equal sign "entry=value" */ -char *scan(char *chaine,char **entry) +static char *scan(char *chaine,char **entry) { char *value; char *temp; @@ -94,7 +94,7 @@ char *scan(char *chaine,char **entry) return (value); } -void build_subdir(void) +static void build_subdir(void) { int i=0; char *entry; @@ -126,7 +126,7 @@ void build_subdir(void) Return all the lines between the entry and the next one or the end of file An entry is something between braces. */ -void lookup_strings(FILE *fichier) +static void lookup_strings(FILE *fichier) { int found=0,pointeur=0,i=0; char *temp,*temp2; @@ -176,7 +176,7 @@ void lookup_strings(FILE *fichier) Return all the lines between the entry and the next one or the end of file An entry is something between braces. */ -void lookup_entry(FILE *fichier,char *chaine) +static void lookup_entry(FILE *fichier,char *chaine) { int found=0,pointeur=0,i=0; char *temp,*temp2; @@ -222,7 +222,7 @@ void lookup_entry(FILE *fichier,char *chaine) #endif } -char *find_desc(FILE *fichier,char *text) +static char *find_desc(FILE *fichier,char *text) { char *chaine; char *long_desc; @@ -271,7 +271,7 @@ char *find_desc(FILE *fichier,char *text) return(short_desc); } -void scan_copyfiles(FILE *fichier, char *chaine) +static void scan_copyfiles(FILE *fichier, char *chaine) { char *part; char *mpart; @@ -354,7 +354,7 @@ void scan_copyfiles(FILE *fichier, char *chaine) } -void scan_short_desc(FILE *fichier, char *short_desc) +static void scan_short_desc(FILE *fichier, char *short_desc) { int i=0; char *chaine; diff --git a/source3/utils/make_smbcodepage.c b/source3/utils/make_smbcodepage.c index 67cd3d4f6f..0653fd31f1 100644 --- a/source3/utils/make_smbcodepage.c +++ b/source3/utils/make_smbcodepage.c @@ -28,7 +28,7 @@ static char *prog_name = NULL; * Print program usage and die. */ -void codepage_usage(char *progname) +static void codepage_usage(char *progname) { fprintf(stderr, "Usage is : %s [c|d] <codepage> <inputfile> <outputfile>\n", progname); @@ -40,7 +40,7 @@ void codepage_usage(char *progname) * terminated. */ -void read_line( char **buf, char *line_buf, int size) +static void read_line( char **buf, char *line_buf, int size) { char *p = *buf; int num = 0; @@ -62,7 +62,7 @@ void read_line( char **buf, char *line_buf, int size) * Returns the number of lines copied. */ -int clean_data( char **buf, uint32 *size) +static int clean_data( char **buf, uint32 *size) { pstring linebuf; char *p = *buf; @@ -108,7 +108,7 @@ int clean_data( char **buf, uint32 *size) * Parse a byte from a codepage file. */ -BOOL parse_byte(char *buf, unsigned char *bp) +static BOOL parse_byte(char *buf, unsigned char *bp) { unsigned int b; char *endptr = NULL; @@ -125,7 +125,7 @@ BOOL parse_byte(char *buf, unsigned char *bp) * Parse a bool from a codepage file. */ -BOOL parse_bool(char *buf, unsigned char *bp) +static BOOL parse_bool(char *buf, unsigned char *bp) { if(isdigit((int)*buf)) { @@ -151,7 +151,7 @@ BOOL parse_bool(char *buf, unsigned char *bp) * Print a parse error and exit. */ -void parse_error(char *buf, char *msg) +static void parse_error(char *buf, char *msg) { fprintf(stderr, "%s: %s whilst parsing line \n%s\n", prog_name, msg, buf); @@ -162,7 +162,7 @@ void parse_error(char *buf, char *msg) * Create a compiled codepage file from a codepage definition file. */ -int do_compile(int codepage, char *input_file, char *output_file) +static int do_compile(int codepage, char *input_file, char *output_file) { FILE *fp = NULL; uint32 size = 0; @@ -307,7 +307,7 @@ definition file. File %s has %d.\n", prog_name, MAXCODEPAGELINES, input_file, nu * Placeholder for now. */ -int do_decompile( int codepage, char *input_file, char *output_file) +static int do_decompile( int codepage, char *input_file, char *output_file) { uint32 size = 0; SMB_STRUCT_STAT st; diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c index d41e8b9f66..6697dc7fd9 100644 --- a/source3/utils/testparm.c +++ b/source3/utils/testparm.c @@ -44,8 +44,7 @@ extern pstring myhostname; Here we do a set of 'hard coded' checks for bad configuration settings. ************************************************/ - -void do_global_checks(void) +static void do_global_checks(void) { SMB_STRUCT_STAT st; if (lp_security() > SEC_SHARE && lp_revalidate(-1)) { diff --git a/source3/utils/torture.c b/source3/utils/torture.c index 164bc4f743..2bee5f3769 100644 --- a/source3/utils/torture.c +++ b/source3/utils/torture.c @@ -608,7 +608,7 @@ static void run_unlinktest(void) } /* generate a random buffer */ -void rand_buf(char *buf, int len) +static void rand_buf(char *buf, int len) { while (len--) { *buf = random(); diff --git a/source3/web/cgi.c b/source3/web/cgi.c index 97dac86668..874447359b 100644 --- a/source3/web/cgi.c +++ b/source3/web/cgi.c @@ -248,174 +248,6 @@ char *cgi_variable(char *name) } /*************************************************************************** -return a particular cgi variable - ***************************************************************************/ -char *cgi_vnum(int i, char **name) -{ - if (i < 0 || i >= num_variables) return NULL; - *name = variables[i].name; - return variables[i].value; -} - -/*************************************************************************** - return the value of a CGI boolean variable. - ***************************************************************************/ -int cgi_boolean(char *name, int def) -{ - char *p = cgi_variable(name); - - if (!p) return def; - - return strcmp(p, "1") == 0; -} - -/*************************************************************************** -like strdup() but quotes < > and & - ***************************************************************************/ -char *quotedup(char *s) -{ - int i, n=0; - int len; - char *ret; - char *d; - - if (!s) return strdup(""); - - len = strlen(s); - - for (i=0;i<len;i++) - if (s[i] == '<' || s[i] == '>' || s[i] == '&') - n++; - - ret = malloc(len + n*6 + 1); - - if (!ret) return NULL; - - d = ret; - - for (i=0;i<len;i++) { - switch (s[i]) { - case '<': - safe_strcpy(d, "<", len + n*6 - (d - ret)); - d += 4; - break; - - case '>': - safe_strcpy(d, ">", len + n*6 - (d - ret)); - d += 4; - break; - - case '&': - safe_strcpy(d, "&", len + n*6 - (d - ret)); - d += 5; - break; - - default: - *d++ = s[i]; - } - } - - *d = 0; - - return ret; -} - - -/*************************************************************************** -like strdup() but quotes a wide range of characters - ***************************************************************************/ -char *urlquote(char *s) -{ - int i, n=0; - int len; - char *ret; - char *d; - char *qlist = "\"\n\r'&<> \t+;"; - - if (!s) return strdup(""); - - len = strlen(s); - - for (i=0;i<len;i++) - if (strchr(qlist, s[i])) n++; - - ret = malloc(len + n*2 + 1); - - if (!ret) return NULL; - - d = ret; - - for (i=0;i<len;i++) { - if (strchr(qlist,s[i])) { - slprintf(d, len + n*2 - (d - ret), "%%%02X", (int)s[i]); - d += 3; - } else { - *d++ = s[i]; - } - } - - *d = 0; - - return ret; -} - - -/*************************************************************************** -like strdup() but quotes " characters - ***************************************************************************/ -char *quotequotes(char *s) -{ - int i, n=0; - int len; - char *ret; - char *d; - - if (!s) return strdup(""); - - len = strlen(s); - - for (i=0;i<len;i++) - if (s[i] == '"') - n++; - - ret = malloc(len + n*6 + 1); - - if (!ret) return NULL; - - d = ret; - - for (i=0;i<len;i++) { - switch (s[i]) { - case '"': - safe_strcpy(d, """, len + n*6 - (d - ret)); - d += 6; - break; - - default: - *d++ = s[i]; - } - } - - *d = 0; - - return ret; -} - - -/*************************************************************************** -quote spaces in a buffer - ***************************************************************************/ -void quote_spaces(char *buf) -{ - while (*buf) { - if (*buf == ' ') *buf = '+'; - buf++; - } -} - - - -/*************************************************************************** tell a browser about a fatal error in the http processing ***************************************************************************/ static void cgi_setup_error(char *err, char *header, char *info) |