summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/include/proto.h25
-rw-r--r--source/include/smb.h7
-rw-r--r--source/lib/util.c19
-rw-r--r--source/param/loadparm.c4
-rw-r--r--source/smbd/server.c5
5 files changed, 47 insertions, 13 deletions
diff --git a/source/include/proto.h b/source/include/proto.h
index 3929348da6d..bbfd0835b75 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -142,6 +142,7 @@ char *lp_character_set(void);
char *lp_logon_script(void);
char *lp_logon_path(void);
char *lp_veto_files(void);
+char *lp_hide_files(void);
char *lp_remote_announce(void);
char *lp_wins_server(void);
char *lp_interfaces(void);
@@ -273,12 +274,18 @@ BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ec
BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
BOOL start_share_mode_mgmt(void);
BOOL stop_share_mode_mgmt(void);
-BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *);
-BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token);
+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);
+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);
/*The following definitions come from mangle.c */
@@ -302,7 +309,6 @@ int reply_sendend(char *inbuf,char *outbuf);
/*The following definitions come from nameannounce.c */
-void reset_announce_timer();
void announce_request(struct work_record *work, struct in_addr ip);
void do_announce_request(char *info, char *to_name, int announce_type,
int from,
@@ -320,6 +326,7 @@ void announce_my_servers_removed(void);
void announce_server(struct subnet_record *d, struct work_record *work,
char *name, char *comment, time_t ttl, int server_type);
void announce_host(time_t t);
+void reset_announce_timer();
void announce_master(time_t t);
void announce_remote(time_t t);
@@ -327,8 +334,7 @@ void announce_remote(time_t t);
void expire_browse_cache(time_t t);
struct browse_cache_record *add_browser_entry(char *name, int type, char *wg,
- time_t ttl,
- struct subnet_record *d,
+ time_t ttl, struct subnet_record *d,
struct in_addr ip, BOOL local);
void do_browser_lists(time_t t);
@@ -718,16 +724,12 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize);
/*The following definitions come from shmem.c */
+BOOL smb_shm_create_hash_table( unsigned int size );
BOOL smb_shm_open( char *file_name, int size);
BOOL smb_shm_close( void );
BOOL smb_shm_free(smb_shm_offset_t offset);
BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off);
void * smb_shm_offset2addr(smb_shm_offset_t offset);
-BOOL smb_shm_lock(void);
-BOOL smb_shm_unlock(void);
-smb_shm_offset_t smb_shm_alloc(int size);
-smb_shm_offset_t smb_shm_addr2offset(void *addr);
-smb_shm_offset_t smb_shm_get_userdef_off(void);
BOOL smb_shm_lock_hash_entry( unsigned int entry);
BOOL smb_shm_unlock_hash_entry( unsigned int entry );
BOOL smb_shm_get_usage(int *bytes_free,
@@ -947,7 +949,8 @@ void BlockSignals(BOOL block,int signum);
void ajt_panic(void);
char *readdirname(void *p);
BOOL is_vetoed_name(char *name);
-BOOL is_vetoed_path(char *name);
+BOOL is_hidden_path(char *path);
+BOOL is_vetoed_path(char *path);
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);
diff --git a/source/include/smb.h b/source/include/smb.h
index ddbd05792df..b36943bfe2f 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -915,4 +915,11 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
/* Size of buffer to use when moving files across filesystems. */
#define COPYBUF_SIZE (8*1024)
+/* Default files that will be hidden, but accessible. intended
+ to replace the "hide dot files" parameter if the "hide files"
+ parameter moves to the service section instead of the global
+ section.
+ */
+#define DEFAULT_FILES_TO_HIDE ".*"
+
/* _SMB_H */
diff --git a/source/lib/util.c b/source/lib/util.c
index 9ebfdca88ea..889aa0b976b 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -3469,9 +3469,8 @@ BOOL is_vetoed_name(char *name)
return 0;
}
-BOOL is_vetoed_path(char *name)
+static BOOL is_in_path(char *name, char *namelist)
{
- char *namelist = lp_veto_files();
char *nameptr = namelist;
char *sub;
char *name_end;
@@ -3523,6 +3522,22 @@ BOOL is_vetoed_path(char *name)
}
/****************************************************************************
+used to make files hidden, but still accessible
+****************************************************************************/
+BOOL is_hidden_path(char *path)
+{
+ return is_in_path(path, lp_hide_files());
+}
+
+/****************************************************************************
+used to make files _completely_ inaccessible
+****************************************************************************/
+BOOL is_vetoed_path(char *path)
+{
+ return is_in_path(path, lp_veto_files());
+}
+
+/****************************************************************************
routine to do file locking
****************************************************************************/
BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type)
diff --git a/source/param/loadparm.c b/source/param/loadparm.c
index 9d3850b2428..9947aca5eaf 100644
--- a/source/param/loadparm.c
+++ b/source/param/loadparm.c
@@ -130,6 +130,7 @@ typedef struct
char *szLogonScript;
char *szLogonPath;
char *szVetoFiles;
+ char *szHideFiles;
char *szSmbrun;
char *szWINSserver;
char *szInterfaces;
@@ -395,6 +396,7 @@ struct parm_struct
{"netbios name", P_UGSTRING,P_GLOBAL, myname, NULL},
{"smbrun", P_STRING, P_GLOBAL, &Globals.szSmbrun, NULL},
{"veto files", P_STRING, P_GLOBAL, &Globals.szVetoFiles, NULL},
+ {"hide files", P_STRING, P_GLOBAL, &Globals.szHideFiles, NULL},
{"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL},
{"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL},
{"smb passwd file", P_STRING, P_GLOBAL, &Globals.szSMBPasswdFile, NULL},
@@ -621,6 +623,7 @@ static void init_globals(void)
Globals.shmem_size = SHMEM_SIZE;
Globals.shmem_hash_size = SHMEM_HASH_SIZE;
Globals.bUnixRealname = False;
+ Globals.szHideFiles = DEFAULT_FILES_TO_HIDE;
#if (defined(NETGROUP) && defined(AUTOMOUNT))
Globals.bNISHomeMap = False;
string_set(&Globals.szNISHomeMapName, "auto.home");
@@ -796,6 +799,7 @@ 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_veto_files,&Globals.szVetoFiles)
+FN_GLOBAL_STRING(lp_hide_files,&Globals.szHideFiles)
FN_GLOBAL_STRING(lp_remote_announce,&Globals.szRemoteAnnounce)
FN_GLOBAL_STRING(lp_wins_server,&Globals.szWINSserver)
FN_GLOBAL_STRING(lp_interfaces,&Globals.szInterfaces)
diff --git a/source/smbd/server.c b/source/smbd/server.c
index 8c40734ce42..30cf9cb016a 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -222,6 +222,11 @@ int dos_mode(int cnum,char *path,struct stat *sbuf)
result |= aHIDDEN;
}
+ if (is_hidden_path(path))
+ {
+ result |= aHIDDEN;
+ }
+
return(result);
}