summaryrefslogtreecommitdiffstats
path: root/source3/smbd/dir.c
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1997-07-24 17:25:11 +0000
committerSamba Release Account <samba-bugs@samba.org>1997-07-24 17:25:11 +0000
commit15ae50ca5203bc4c04567e400ba041a4d1757b2b (patch)
treeed7d0fcf569f9a793db2d37dd8b40b55d2c845d7 /source3/smbd/dir.c
parent7020afbd03402f68113dfd60ec078b2a68b5be6f (diff)
downloadsamba-15ae50ca5203bc4c04567e400ba041a4d1757b2b.tar.gz
samba-15ae50ca5203bc4c04567e400ba041a4d1757b2b.tar.xz
samba-15ae50ca5203bc4c04567e400ba041a4d1757b2b.zip
Makefile: Added UNIXWARE 2.x with shadow passwords from fja@extratech.com
client.c: Made prompt appear at debug level 0. Fixed strcasecmp redefinition. Caused client to use set_blocking rather than making fcntl calls itself. dir.c: Removed redundent snum parameters. includes.h: Added SCO fixes. loadparm.c: Made default 'files to hide' a null string. nmbd.c: Removed O_NONBLOCK from pid file open for platforms that dont have it. proto.h: Changed snum to cnum where needed. Changed is_xx_path to is_in_path (now called via MACRO). quotas.c: Swapped setuid/seteuid calls when restoring uid. reply.c: Removed redundent snum parameters. server.c: Changed snum to cnum where needed. Setup new veto_list, hide_list namelists. Added standard_sub changes from Stefaan A Eeckels <Stefaan.Eeckels@ecc.lu> and Paul Rippin <pr3245@nopc.eurostat.cec.be> shmem.c: Changed cast for sizeof to be int before negating. smb.h: Added new veto_list, hide_list entries to connections. Added IS_PRINT, IS_HIDDEN_PATH, IS_VETO_PATH macros. trans2.c: Removed redundent snum parameters. util.c: Added standard_sub_basic changes from Stefaan A Eeckels <Stefaan.Eeckels@ecc.lu> and Paul Rippin <pr3245@nopc.eurostat.cec.be> Fixed up veto/hidden path processing so the paths are pres-parsed and checked for wildcards (for speed). Jeremy (jallison@whistle.com) (This used to be commit 9afa36f7874cfd527aa6ef1e7965c1d35d46ab1f)
Diffstat (limited to 'source3/smbd/dir.c')
-rw-r--r--source3/smbd/dir.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 2a219e0281a..5bd5b1d5736 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -108,18 +108,20 @@ static void dptr_idleoldest(void)
/****************************************************************************
get the dir ptr for a dir index
****************************************************************************/
-static void *dptr_get(int snum, int key,uint32 lastused)
+static void *dptr_get(int key,uint32 lastused)
{
- if (dirptrs[key].valid) {
- if (lastused) dirptrs[key].lastused = lastused;
- if (!dirptrs[key].ptr) {
+ struct dptr_struct *dp = &dirptrs[key];
+
+ if (dp->valid) {
+ if (lastused) dp->lastused = lastused;
+ if (!dp->ptr) {
if (dptrs_open >= MAXDIR)
dptr_idleoldest();
DEBUG(4,("Reopening dptr key %d\n",key));
- if ((dirptrs[key].ptr = OpenDir(snum, dirptrs[key].path, True)))
+ if ((dp->ptr = OpenDir(dp->cnum, dp->path, True)))
dptrs_open++;
}
- return(dirptrs[key].ptr);
+ return(dp->ptr);
}
return(NULL);
}
@@ -259,7 +261,7 @@ static BOOL start_dir(int cnum,char *directory)
if (! *directory)
directory = ".";
- Connections[cnum].dirptr = OpenDir(SNUM(cnum), directory, True);
+ Connections[cnum].dirptr = OpenDir(cnum, directory, True);
if (Connections[cnum].dirptr) {
dptrs_open++;
string_set(&Connections[cnum].dirpath,directory);
@@ -345,10 +347,10 @@ int dptr_create(int cnum,char *path, BOOL expect_close,int pid)
/****************************************************************************
fill the 5 byte server reserved dptr field
****************************************************************************/
-BOOL dptr_fill(int snum, char *buf1,unsigned int key)
+BOOL dptr_fill(char *buf1,unsigned int key)
{
unsigned char *buf = (unsigned char *)buf1;
- void *p = dptr_get(snum, key,0);
+ void *p = dptr_get(key,0);
uint32 offset;
if (!p) {
DEBUG(1,("filling null dirptr %d\n",key));
@@ -373,10 +375,10 @@ BOOL dptr_zero(char *buf)
/****************************************************************************
fetch the dir ptr and seek it given the 5 byte server field
****************************************************************************/
-void *dptr_fetch(int snum, char *buf,int *num)
+void *dptr_fetch(char *buf,int *num)
{
unsigned int key = *(unsigned char *)buf;
- void *p = dptr_get(snum, key,dircounter++);
+ void *p = dptr_get(key,dircounter++);
uint32 offset;
if (!p) {
DEBUG(3,("fetched null dirptr %d\n",key));
@@ -393,9 +395,9 @@ void *dptr_fetch(int snum, char *buf,int *num)
/****************************************************************************
fetch the dir ptr and seek it given the lanman2 parameter block
****************************************************************************/
-void *dptr_fetch_lanman2(int snum, char *params,int dptr_num)
+void *dptr_fetch_lanman2(char *params,int dptr_num)
{
- void *p = dptr_get(snum, dptr_num,dircounter++);
+ void *p = dptr_get(dptr_num,dircounter++);
uint32 resume_key = SVAL(params,6);
BOOL uses_resume_key = BITSETW(params+10,2);
BOOL continue_bit = BITSETW(params+10,3);
@@ -520,7 +522,7 @@ typedef struct
/*******************************************************************
open a directory
********************************************************************/
-void *OpenDir(int snum, char *name, BOOL use_veto)
+void *OpenDir(int cnum, char *name, BOOL use_veto)
{
Dir *dirp;
char *n;
@@ -541,7 +543,7 @@ void *OpenDir(int snum, char *name, BOOL use_veto)
int l = strlen(n)+1;
/* If it's a vetoed file, pretend it doesn't even exist */
- if (use_veto && is_vetoed_name(snum, n)) continue;
+ if (use_veto && IS_VETO_PATH(cnum, n)) continue;
if (used + l > dirp->mallocsize) {
int s = MAX(used+l,used+2000);