void dptr_idlecnum(int cnum);
void dptr_closepath(char *path,int pid);
int dptr_create(int cnum,char *path, BOOL expect_close,int pid);
-BOOL dptr_fill(char *buf1,unsigned int key);
+BOOL dptr_fill(int cnum, char *buf1,unsigned int key);
BOOL dptr_zero(char *buf);
-void *dptr_fetch(char *buf,int *num);
-void *dptr_fetch_lanman2(char *params,int dptr_num);
+void *dptr_fetch(int cnum, char *buf,int *num);
+void *dptr_fetch_lanman2(int cnum, char *params,int dptr_num);
BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype);
BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend);
-void *OpenDir(char *name);
+void *OpenDir(int cnum, char *name);
void CloseDir(void *p);
char *ReadDirName(void *p);
BOOL SeekDir(void *p,int pos);
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);
char *lp_writelist(int );
char *lp_volume(int );
char *lp_mangled_map(int );
+char *lp_veto_files(int );
+char *lp_hide_files(int );
BOOL lp_alternate_permissions(int );
BOOL lp_revalidate(int );
BOOL lp_casesensitive(int );
void BlockSignals(BOOL block,int signum);
void ajt_panic(void);
char *readdirname(void *p);
-BOOL is_vetoed_name(char *name);
-BOOL is_hidden_path(char *path);
-BOOL is_vetoed_path(char *path);
+BOOL is_vetoed_name(int snum, char *name);
+BOOL is_hidden_path(int cnum, char *path);
+BOOL is_vetoed_path(int cnum, 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);
}
-BOOL is_vetoed_name(char *name)
+BOOL is_vetoed_name(int snum, char *name)
{
- char *namelist = lp_veto_files();
+ char *namelist = lp_veto_files(snum);
char *nameptr = namelist;
char *name_end;
/****************************************************************************
used to make files hidden, but still accessible
****************************************************************************/
-BOOL is_hidden_path(char *path)
+BOOL is_hidden_path(int cnum, char *path)
{
- return is_in_path(path, lp_hide_files());
+ return is_in_path(path, lp_hide_files(cnum));
}
/****************************************************************************
used to make files _completely_ inaccessible
****************************************************************************/
-BOOL is_vetoed_path(char *path)
+BOOL is_vetoed_path(int cnum, char *path)
{
- return is_in_path(path, lp_veto_files());
+ return is_in_path(path, lp_veto_files(cnum));
}
/****************************************************************************
char *szCharacterSet;
char *szLogonScript;
char *szLogonPath;
- char *szVetoFiles;
- char *szHideFiles;
char *szSmbrun;
char *szWINSserver;
char *szInterfaces;
char *szMagicScript;
char *szMagicOutput;
char *szMangledMap;
+ char *szVetoFiles;
+ char *szHideFiles;
char *comment;
char *force_user;
char *force_group;
NULL, /* szMagicScript */
NULL, /* szMagicOutput */
NULL, /* szMangledMap */
+ NULL, /* szVetoFiles */
+ DEFAULT_FILES_TO_HIDE, /* szHideFiles */
NULL, /* comment */
NULL, /* force user */
NULL, /* force group */
{"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL},
{"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},
{"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL},
{"status", P_BOOL, P_LOCAL, &sDefault.status, NULL},
{"hide dot files", P_BOOL, P_LOCAL, &sDefault.bHideDotFiles, NULL},
+ {"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL},
+ {"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL},
{"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL},
{"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL},
{"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL},
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");
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)
FN_LOCAL_STRING(lp_writelist,writelist)
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)
FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm)
FN_LOCAL_BOOL(lp_revalidate,bRevalidate)
/****************************************************************************
get the dir ptr for a dir index
****************************************************************************/
-static void *dptr_get(int key,uint32 lastused)
+static void *dptr_get(int cnum, int key,uint32 lastused)
{
if (dirptrs[key].valid) {
if (lastused) dirptrs[key].lastused = lastused;
if (dptrs_open >= MAXDIR)
dptr_idleoldest();
DEBUG(4,("Reopening dptr key %d\n",key));
- if ((dirptrs[key].ptr = OpenDir(dirptrs[key].path)))
+ if ((dirptrs[key].ptr = OpenDir(cnum, dirptrs[key].path)))
dptrs_open++;
}
return(dirptrs[key].ptr);
if (! *directory)
directory = ".";
- Connections[cnum].dirptr = OpenDir(directory);
+ Connections[cnum].dirptr = OpenDir(cnum, directory);
if (Connections[cnum].dirptr) {
dptrs_open++;
string_set(&Connections[cnum].dirpath,directory);
/****************************************************************************
fill the 5 byte server reserved dptr field
****************************************************************************/
-BOOL dptr_fill(char *buf1,unsigned int key)
+BOOL dptr_fill(int cnum, char *buf1,unsigned int key)
{
unsigned char *buf = (unsigned char *)buf1;
- void *p = dptr_get(key,0);
+ void *p = dptr_get(cnum, key,0);
uint32 offset;
if (!p) {
DEBUG(1,("filling null dirptr %d\n",key));
/****************************************************************************
fetch the dir ptr and seek it given the 5 byte server field
****************************************************************************/
-void *dptr_fetch(char *buf,int *num)
+void *dptr_fetch(int cnum, char *buf,int *num)
{
unsigned int key = *(unsigned char *)buf;
- void *p = dptr_get(key,dircounter++);
+ void *p = dptr_get(cnum, key,dircounter++);
uint32 offset;
if (!p) {
DEBUG(3,("fetched null dirptr %d\n",key));
/****************************************************************************
fetch the dir ptr and seek it given the lanman2 parameter block
****************************************************************************/
-void *dptr_fetch_lanman2(char *params,int dptr_num)
+void *dptr_fetch_lanman2(int cnum, char *params,int dptr_num)
{
- void *p = dptr_get(dptr_num,dircounter++);
+ void *p = dptr_get(cnum, dptr_num,dircounter++);
uint32 resume_key = SVAL(params,6);
BOOL uses_resume_key = BITSETW(params+10,2);
BOOL continue_bit = BITSETW(params+10,3);
/*******************************************************************
open a directory
********************************************************************/
-void *OpenDir(char *name)
+void *OpenDir(int cnum, char *name)
{
Dir *dirp;
char *n;
while ((n = readdirname(p))) {
int l = strlen(n)+1;
/* If it's a vetoed file, pretend it doesn't even exist */
- if(is_vetoed_name(n))
+ if(is_vetoed_name(cnum, n))
continue;
if (used + l > dirp->mallocsize) {
int s = MAX(used+l,used+2000);
result |= aHIDDEN;
}
- if (is_hidden_path(path))
+ if (is_hidden_path(SNUM(cnum), path))
{
result |= aHIDDEN;
}
check_mangled_stack(name);
/* open the directory */
- if (!(cur_dir = OpenDir(path)))
+ if (!(cur_dir = OpenDir(snum, path)))
{
DEBUG(3,("scan dir didn't open dir [%s]\n",path));
return(False);
errno = 0;
- if( is_vetoed_path(name))
+ if( is_vetoed_path(SNUM(cnum), name))
{
DEBUG(5,("file path name %s vetoed\n",name));
return(0);