diff options
Diffstat (limited to 'source/include')
-rw-r--r-- | source/include/charset.h | 10 | ||||
-rw-r--r-- | source/include/includes.h | 8 | ||||
-rw-r--r-- | source/include/kanji.h | 18 | ||||
-rw-r--r-- | source/include/local.h | 7 | ||||
-rw-r--r-- | source/include/proto.h | 93 | ||||
-rw-r--r-- | source/include/smb.h | 146 | ||||
-rw-r--r-- | source/include/version.h | 2 |
7 files changed, 80 insertions, 204 deletions
diff --git a/source/include/charset.h b/source/include/charset.h index fb184897c07..5f5e2016ee1 100644 --- a/source/include/charset.h +++ b/source/include/charset.h @@ -63,13 +63,3 @@ extern void charset_initialise(void); #define issafe(c) (isalnum((c&0xff)) || strchr("-._",c)) #endif -/* Dynamic codepage files defines. */ - -/* Version id for dynamically loadable codepage files. */ -#define CODEPAGE_FILE_VERSION_ID 0x1 -/* Version 1 codepage file header size. */ -#define CODEPAGE_HEADER_SIZE 8 -/* Offsets for codepage file header entries. */ -#define CODEPAGE_VERSION_OFFSET 0 -#define CODEPAGE_CLIENT_CODEPAGE_OFFSET 2 -#define CODEPAGE_LENGTH_OFFSET 4 diff --git a/source/include/includes.h b/source/include/includes.h index 2329553d234..4e48e87a7c1 100644 --- a/source/include/includes.h +++ b/source/include/includes.h @@ -563,7 +563,9 @@ char *mktemp(char *); /* No standard include */ #define USE_SETSID #define USE_SETRES #define DEFAULT_PRINTING PRINT_HPUX -#define SIGCLD_IGNORE +/* Ken Weiss <krweiss@ucdavis.edu> tells us that SIGCLD_IGNORE is + not good for HPUX */ +/* #define SIGCLD_IGNORE */ #endif /* HPUX */ @@ -1194,10 +1196,6 @@ it works and getting lots of bug reports */ #define QSORT_CAST (int (*)()) #endif -#ifndef INADDR_LOOPBACK -#define INADDR_LOOPBACK 0x7f000001 -#endif /* INADDR_LOOPBACK */ - /* this is a rough check to see if this machine has a lstat() call. it is not guaranteed to work */ #if !(defined(S_ISLNK) || defined(S_IFLNK)) diff --git a/source/include/kanji.h b/source/include/kanji.h index cf303659208..865ac3b2c90 100644 --- a/source/include/kanji.h +++ b/source/include/kanji.h @@ -27,6 +27,8 @@ #ifndef _KANJI_H_ #define _KANJI_H_ +#ifdef KANJI + /* FOR SHIFT JIS CODE */ #define is_shift_jis(c) \ ((0x81 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0x9f) \ @@ -105,8 +107,16 @@ #else /* not _KANJI_C_ */ -extern char *(*_dos_to_unix)(char *str, BOOL overwrite); -extern char *(*_unix_to_dos)(char *str, BOOL overwrite); +extern char* (*_dos_to_unix) (const char *str, BOOL overwrite); +extern char* (*_unix_to_dos) (const char *str, BOOL overwrite); + +#define unix_to_dos (*_unix_to_dos) +#define dos_to_unix (*_dos_to_unix) + +extern char *sj_strtok (char *s1, const char *s2); +extern char *sj_strchr (const char *s, int c); +extern char *sj_strrchr (const char *s, int c); +extern char *sj_strstr (const char *s1, const char *s2); #define strchr sj_strchr #define strrchr sj_strrchr @@ -127,7 +137,11 @@ extern char *(*_unix_to_dos)(char *str, BOOL overwrite); int interpret_coding_system (char *str, int def); +#else + #define unix_to_dos(x,y) unix2dos_format(x,y) #define dos_to_unix(x,y) dos2unix_format(x,y) +#endif /* not KANJI */ + #endif /* _KANJI_H_ */ diff --git a/source/include/local.h b/source/include/local.h index 3ce75eeb4e7..f5f2c318180 100644 --- a/source/include/local.h +++ b/source/include/local.h @@ -43,7 +43,7 @@ #define WORDMAX 0xFFFF /* the maximum password length before we declare a likely attack */ -#define MAX_PASSWORD_LENGTH 200 +#define MAX_PASS_LEN 200 /* separators for lists */ #define LIST_SEP " \t,;:\n\r" @@ -159,9 +159,4 @@ /* the directory to sit in when idle */ /* #define IDLE_DIR "/" */ -/* Timout (in seconds) to wait for an oplock breal - message to return. */ - -#define OPLOCK_BREAK_TIMEOUT 30 - #endif diff --git a/source/include/proto.h b/source/include/proto.h index 8818b9b5274..d7cbc4cc4c4 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -114,10 +114,6 @@ int reply_trans(char *inbuf,char *outbuf); /*The following definitions come from kanji.c */ -char *sj_strtok(char *s1, char *s2); -char *sj_strstr(char *s1, char *s2); -char *sj_strchr (char *s, int c); -char *sj_strrchr(char *s, int c); int interpret_coding_system(char *str, int def); /*The following definitions come from loadparm.c */ @@ -183,7 +179,6 @@ int lp_maxmux(void); int lp_maxpacket(void); int lp_keepalive(void); int lp_passwordlevel(void); -int lp_usernamelevel(void); int lp_readsize(void); int lp_shmem_size(void); int lp_shmem_hash_size(void); @@ -248,7 +243,6 @@ BOOL lp_map_archive(int ); BOOL lp_locking(int ); BOOL lp_strict_locking(int ); BOOL lp_share_modes(int ); -BOOL lp_oplocks(int ); BOOL lp_onlyuser(int ); BOOL lp_manglednames(int ); BOOL lp_widelinks(int ); @@ -257,7 +251,6 @@ BOOL lp_syncalways(int ); BOOL lp_map_system(int ); BOOL lp_delete_readonly(int ); BOOL lp_fake_oplocks(int ); -BOOL lp_recursive_veto_delete(int ); int lp_create_mode(int ); int lp_force_create_mode(int ); int lp_dir_mode(int ); @@ -270,20 +263,14 @@ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); int lp_add_service(char *pszService, int iDefaultService); BOOL lp_add_printer(char *pszPrintername, int iDefaultService); BOOL lp_file_list_changed(void); -BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); -int lp_next_parameter(int snum, int *i, char *label, - char *value, int allparameters); BOOL lp_snum_ok(int iService); BOOL lp_loaded(void); void lp_killunused(BOOL (*snumused)(int )); BOOL lp_load(char *pszFname,BOOL global_only); int lp_numservices(void); -void lp_dump(FILE *f); +void lp_dump(void); 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); int lp_major_announce_version(void); int lp_minor_announce_version(void); @@ -300,15 +287,13 @@ BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token tok int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, min_share_mode_entry **old_shares); void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token, int fnum, uint16 port, uint16 op_type); -BOOL remove_share_oplock(int fnum, share_lock_token token); +BOOL set_share_mode(share_lock_token token, int fnum); BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, min_share_mode_entry **old_shares); void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token,int fnum, uint16 port, uint16 op_type); -BOOL remove_share_oplock(int fnum, share_lock_token token); +BOOL set_share_mode(share_lock_token token,int fnum); /*The following definitions come from mangle.c */ @@ -322,7 +307,6 @@ BOOL name_map_mangle(char *OutName,BOOL need83,int snum); /*The following definitions come from md4.c */ -void mdfour(unsigned char *out, unsigned char *in, int n); /*The following definitions come from message.c */ @@ -362,6 +346,20 @@ struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, struct in_addr ip, BOOL local); void do_browser_lists(time_t t); +/*The following definitions come from nameconf.c */ + +int get_num_workgroups(void); +int conf_workgroup_name_to_token(char *workgroup_name,char *default_name); +char *conf_workgroup_name(int token); +int conf_should_workgroup_member(int token); +int conf_should_local_master(int token); +int conf_should_domain_master(int token); +char *conf_browsing_alias(int token); +char *conf_browsing_alias_comment(int token); +char *conf_alias_to_workgroup(char *alias); +int conf_alias_to_token(char *alias); +void read_smbbrowse_conf(char *default_name); + /*The following definitions come from namedbname.c */ void set_samba_nb_type(void); @@ -543,7 +541,6 @@ BOOL reload_services(BOOL test); /*The following definitions come from nmblib.c */ -char *lookup_opcode_name( int opcode ); void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); void free_nmb_packet(struct nmb_packet *nmb); @@ -704,13 +701,14 @@ BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_pa int disk_free(char *path,int *bsize,int *dfree,int *dsize); int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); BOOL check_name(char *name,int cnum); +int fd_attempt_open(char *fname, int flags, int mode); +void fd_attempt_reopen(char *fname, int mode, file_fd_struct *fd_ptr); +int fd_attempt_close(file_fd_struct *fd_ptr); void sync_file(int fnum); -void close_file(int fnum); +void close_file(int fnum, int normal_close); BOOL check_file_sharing(int cnum,char *fname); -int check_share_mode( min_share_mode_entry *share, int deny_mode, char *fname, - BOOL fcbopen, int *flags); void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, - int mode,int oplock_request, int *Access,int *action); + int mode,int *Access,int *action); int seek_file(int fnum,uint32 pos); int read_file(int fnum,char *data,uint32 pos,int n); int write_file(int fnum,char *data,int n); @@ -719,9 +717,6 @@ int find_service(char *service); int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); -BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); -BOOL request_oplock_break(min_share_mode_entry *share_entry, - uint32 dev, uint32 inode); BOOL snum_used(int snum); BOOL reload_services(BOOL test); int setup_groups(char *user, int uid, int gid, int *p_ngroups, @@ -751,7 +746,7 @@ smb_shm_offset_t smb_shm_alloc(int size); BOOL smb_shm_free(smb_shm_offset_t offset); smb_shm_offset_t smb_shm_get_userdef_off(void); BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); -void *smb_shm_offset2addr(smb_shm_offset_t offset); +void * smb_shm_offset2addr(smb_shm_offset_t offset); smb_shm_offset_t smb_shm_addr2offset(void *addr); BOOL smb_shm_lock_hash_entry( unsigned int entry); BOOL smb_shm_unlock_hash_entry( unsigned int entry ); @@ -759,13 +754,13 @@ BOOL smb_shm_get_usage(int *bytes_free, int *bytes_used, int *bytes_overhead); -/*The following definitions come from smbdes.c */ - -void E_P16(unsigned char *p14,unsigned char *p16); -void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); - /*The following definitions come from smbencrypt.c */ +void str_to_key(uchar *str,uchar *key); +void D1(uchar *k, uchar *d, uchar *out); +void E1(uchar *k, uchar *d, uchar *out); +void E_P16(uchar *p14,uchar *p16); +void E_P24(uchar *p21, uchar *c8, uchar *p24); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); @@ -852,6 +847,8 @@ BOOL become_guest(void); BOOL become_user(int cnum, uint16 vuid); BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile,BOOL shared); +void become_root(int save_dir) ; +void unbecome_root(int restore_dir); /*The following definitions come from username.c */ @@ -882,10 +879,10 @@ time_t file_modtime(char *fname); BOOL directory_exist(char *dname,struct stat *st); uint32 file_size(char *file_name); char *attrib_string(int mode); -int StrCaseCmp(char *s, char *t); -int StrnCaseCmp(char *s, char *t, int n); -BOOL strequal(char *s1, char *s2); -BOOL strnequal(char *s1,char *s2,int n); +int StrCaseCmp(const char *s, const char *t); +int StrnCaseCmp(const char *s, const char *t, int n); +BOOL strequal(const char *s1, const char *s2); +BOOL strnequal(const char *s1,const char *s2,int n); BOOL strcsequal(char *s1,char *s2); void strlower(char *s); void strupper(char *s); @@ -928,12 +925,7 @@ int read_data(int fd,char *buffer,int N); int write_data(int fd,char *buffer,int N); int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); int read_smb_length(int fd,char *inbuf,int timeout); -BOOL receive_smb(int fd,char *buffer, int timeout); -BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout); -BOOL push_local_message(char *buf, int msg_len); -BOOL receive_message_or_smb(int smbfd, int oplock_fd, - char *buffer, int buffer_len, - int timeout, BOOL *got_smb); +BOOL receive_smb(int fd,char *buffer,int timeout); BOOL send_smb(int fd,char *buffer); char *name_ptr(char *buf,int ofs); int name_extract(char *buf,int ofs,char *name); @@ -983,8 +975,21 @@ void free_namearray(name_compare_entry *name_array); BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); -BOOL is_myname(char *s); +BOOL is_myname(const char *s); void set_remote_arch(enum remote_arch_types type); enum remote_arch_types get_remote_arch(); void fstrcpy(char *dest, char *src); void pstrcpy(char *dest, char *src); + +/*The following definitions come from vt_mode.c */ + +int VT_Check(char *buffer); +int VT_Start_utmp(void); +int VT_Stop_utmp(void); +void VT_AtExit(void); +void VT_SigCLD(int sig); +void VT_SigEXIT(int sig); +int VT_Start(void); +int VT_Output(char *Buffer); +int VT_Input(char *Buffer,int Size); +void VT_Process(void); diff --git a/source/include/smb.h b/source/include/smb.h index 66da2099c77..b55c180f361 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -330,7 +330,6 @@ typedef struct BOOL share_mode; BOOL print_file; BOOL modified; - BOOL granted_oplock; char *name; } files_struct; @@ -453,10 +452,6 @@ typedef struct { smb_shm_offset_t next_share_mode_entry; int pid; -#ifdef USE_OPLOCKS - uint16 op_port; - uint16 op_type; -#endif /* USE_OPLOCKS */ int share_mode; struct timeval time; } share_mode_entry; @@ -465,10 +460,6 @@ typedef struct typedef struct { int pid; -#ifdef USE_OPLOCKS - uint16 op_port; - uint16 op_type; -#endif /* USE_OPLOCKS */ int share_mode; struct timeval time; } min_share_mode_entry; @@ -493,48 +484,8 @@ struct connect_record time_t start; }; -#ifndef LOCKING_VERSION -#ifdef USE_OPLOCKS -#define LOCKING_VERSION 4 -#else /* USE_OPLOCKS */ -#define LOCKING_VERSION 3 -#endif /* USE_OPLOCKS */ -#endif /* LOCKING_VERSION */ - -#if !defined(FAST_SHARE_MODES) -/* - * Defines for slow share modes. - */ - -/* - * Locking file header lengths & offsets. - */ -#define SMF_VERSION_OFFSET 0 -#define SMF_NUM_ENTRIES_OFFSET 4 -#define SMF_FILENAME_LEN_OFFSET 8 -#define SMF_HEADER_LENGTH 10 - -#ifdef USE_OPLOCKS -#define SMF_ENTRY_LENGTH 20 -#else /* USE_OPLOCKS */ -#define SMF_ENTRY_LENGTH 16 -#endif /* USE_OPLOCKS */ - -/* - * Share mode record offsets. - */ - -#define SME_SEC_OFFSET 0 -#define SME_USEC_OFFSET 4 -#define SME_SHAREMODE_OFFSET 8 -#define SME_PID_OFFSET 12 - -#ifdef USE_OPLOCKS -#define SME_PORT_OFFSET 16 -#define SME_OPLOCK_TYPE_OFFSET 18 -#endif /* USE_OPLOCKS */ -#endif /* FAST_SHARE_MODES */ +#define LOCKING_VERSION 3 /* these are useful macros for checking validity of handles */ #define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_OPEN_FILES)) @@ -575,7 +526,11 @@ struct connect_record #define IS_HIDDEN_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].hide_list)) #define IS_VETO_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].veto_list)) +#ifdef SMB_PASSWD #define SMBENCRYPT() (lp_encrypted_passwords()) +#else +#define SMBENCRYPT() (False) +#endif /* the basic packet size, assuming no words or bytes */ #define smb_size 39 @@ -971,99 +926,18 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; #endif -/* Defines needed for multi-codepage support. */ -#define KANJI_CODEPAGE 932 - #ifdef KANJI -/* - * Default client code page - Japanese - */ -#define DEFAULT_CLIENT_CODE_PAGE KANJI_CODEPAGE +/* Default client code page - 932 - Japanese */ +#define DEFAULT_CLIENT_CODE_PAGE 932 #else /* KANJI */ -/* - * Default client code page - 850 - Western European - */ +/* Default client code page - 850 - Western European */ #define DEFAULT_CLIENT_CODE_PAGE 850 #endif /* KANJI */ -/* - * Size of buffer to use when moving files across filesystems. - */ +/* Size of buffer to use when moving files across filesystems. */ #define COPYBUF_SIZE (8*1024) -/* - * Integers used to override error codes. - */ +/* Integers used to override error codes. */ extern int unix_ERR_class; extern int unix_ERR_code; - -/* - * Map the Core and Extended Oplock requesst bits down - * to common bits (EXCLUSIVE_OPLOCK & BATCH_OPLOCK). - */ - -/* - * Core protocol. - */ -#define CORE_OPLOCK_REQUEST(inbuf) (((CVAL(inbuf,smb_flg)|(1<<5))>>5) | \ - ((CVAL(inbuf,smb_flg)|(1<<6))>>5)) - -/* - * Extended protocol. - */ -#define EXTENDED_OPLOCK_REQUEST(inbuf) (((SVAL(inbuf,smb_vwv2)|(1<<1))>>1) | \ - ((SVAL(inbuf,smb_vwv2)|(1<<2))>>1)) - -/* Lock types. */ -#define LOCKING_ANDX_SHARED_LOCK 0x1 -#define LOCKING_ANDX_OPLOCK_RELEASE 0x2 -#define LOCKING_ANDX_CHANGE_LOCKTYPE 0x4 -#define LOCKING_ANDX_CANCEL_LOCK 0x8 -#define LOCKING_ANDX_LARGE_FILES 0x10 - -/* Oplock levels */ -#define OPLOCKLEVEL_NONE 0 -#define OPLOCKLEVEL_II 1 - -/* - * Bits we test with. - */ -#define EXCLUSIVE_OPLOCK 1 -#define BATCH_OPLOCK 2 - -#define CORE_OPLOCK_GRANTED (1<<5) -#define EXTENDED_OPLOCK_GRANTED (1<<15) - -/* - * Loopback command offsets. - */ - -#define UDP_CMD_LEN_OFFSET 0 -#define UDP_CMD_PORT_OFFSET 4 -#define UDP_CMD_HEADER_LEN 6 - -#define UDP_MESSAGE_CMD_OFFSET 0 - -/* - * Oplock break command code to send over the udp socket. - * - * Form of this is : - * - * 0 2 6 10 14 18 22 - * +----+--------+--------+--------+-------+--------+ - * | cmd| pid | dev | inode | sec | usec | - * +----+--------+--------+--------+-------+--------+ - */ - -#define OPLOCK_BREAK_CMD 0x1 -#define OPLOCK_BREAK_PID_OFFSET 2 -#define OPLOCK_BREAK_DEV_OFFSET 6 -#define OPLOCK_BREAK_INODE_OFFSET 10 -#define OPLOCK_BREAK_SEC_OFFSET 14 -#define OPLOCK_BREAK_USEC_OFFSET 18 -#define OPLOCK_BREAK_MSG_LEN 22 - - -#define CMD_REPLY 0x8000 - /* _SMB_H */ diff --git a/source/include/version.h b/source/include/version.h index 33c9d240baf..7bea7836bc6 100644 --- a/source/include/version.h +++ b/source/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha1" +#define VERSION "1.9.17p3" |