summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-11-18 02:06:41 +0000
committerJeremy Allison <jra@samba.org>2003-11-18 02:06:41 +0000
commit013a0511030729bf84f4c703dca3fa39ded5fe12 (patch)
treedca4ab71f587de0bf3a870bda0b7e319a570c5e1
parent7b39861342279a3ecfb4b2b854162f2ec602afbd (diff)
downloadsamba-013a0511030729bf84f4c703dca3fa39ded5fe12.tar.gz
samba-013a0511030729bf84f4c703dca3fa39ded5fe12.tar.bz2
samba-013a0511030729bf84f4c703dca3fa39ded5fe12.zip
Remove unneeded second open for filename ending in '.' now we know it's
a mangled name. Added const. Fix inspired by Andrew Bartlett ideas. Jeremy. (This used to be commit 87eb336d659dfa5e92b495dd76a0f2e534931293)
-rw-r--r--source3/lib/util.c2
-rw-r--r--source3/smbd/open.c16
2 files changed, 4 insertions, 14 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index ce1389c8e9..39515c6599 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2234,7 +2234,7 @@ char *parent_dirname(const char *path)
Determine if a pattern contains any Microsoft wildcard characters.
*******************************************************************/
-BOOL ms_has_wild(char *s)
+BOOL ms_has_wild(const char *s)
{
char c;
while ((c = *s++)) {
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index ef7ace862a..3807c18e78 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -30,7 +30,7 @@ extern BOOL global_client_failed_oplock_break;
fd support routines - attempt to do a dos_open.
****************************************************************************/
-static int fd_open(struct connection_struct *conn, char *fname,
+static int fd_open(struct connection_struct *conn, const char *fname,
int flags, mode_t mode)
{
int fd;
@@ -41,13 +41,6 @@ static int fd_open(struct connection_struct *conn, char *fname,
fd = SMB_VFS_OPEN(conn,fname,flags,mode);
- /* Fix for files ending in '.' */
- if((fd == -1) && (errno == ENOENT) &&
- (strchr_m(fname,'.')==NULL)) {
- pstrcat(fname,".");
- fd = SMB_VFS_OPEN(conn,fname,flags,mode);
- }
-
DEBUG(10,("fd_open: name %s, flags = 0%o mode = 0%o, fd = %d. %s\n", fname,
flags, (int)mode, fd, (fd == -1) ? strerror(errno) : "" ));
@@ -70,7 +63,7 @@ int fd_close(struct connection_struct *conn, files_struct *fsp)
Check a filename for the pipe string.
****************************************************************************/
-static void check_for_pipe(char *fname)
+static void check_for_pipe(const char *fname)
{
/* special case of pipe opens */
char s[10];
@@ -89,10 +82,9 @@ static void check_for_pipe(char *fname)
****************************************************************************/
static BOOL open_file(files_struct *fsp,connection_struct *conn,
- const char *fname1,SMB_STRUCT_STAT *psbuf,int flags,mode_t mode, uint32 desired_access)
+ const char *fname,SMB_STRUCT_STAT *psbuf,int flags,mode_t mode, uint32 desired_access)
{
extern struct current_user current_user;
- pstring fname;
int accmode = (flags & O_ACCMODE);
int local_flags = flags;
@@ -100,8 +92,6 @@ static BOOL open_file(files_struct *fsp,connection_struct *conn,
fsp->oplock_type = NO_OPLOCK;
errno = EPERM;
- pstrcpy(fname,fname1);
-
/* Check permissions */
/*