diff options
author | Tim Potter <tpot@samba.org> | 2000-02-17 23:10:18 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2000-02-17 23:10:18 +0000 |
commit | 56f87000c9feb33a8050b83fb1bc86195fff4c69 (patch) | |
tree | 1f97474e8c9bcd8fd416e802725326c888d417b3 /source/smbd | |
parent | 44495482739bf5bd6a633695003f43fa14f727d6 (diff) | |
download | samba-56f87000c9feb33a8050b83fb1bc86195fff4c69.tar.gz |
Merge from HEAD branch of missing calls to dos_do_unix() in VFS
functions.
Diffstat (limited to 'source/smbd')
-rw-r--r-- | source/smbd/dir.c | 9 | ||||
-rw-r--r-- | source/smbd/dosmode.c | 2 | ||||
-rw-r--r-- | source/smbd/filename.c | 7 | ||||
-rw-r--r-- | source/smbd/open.c | 11 | ||||
-rw-r--r-- | source/smbd/reply.c | 14 | ||||
-rw-r--r-- | source/smbd/vfs.c | 2 |
6 files changed, 26 insertions, 19 deletions
diff --git a/source/smbd/dir.c b/source/smbd/dir.c index b7ae2af47cb..b7c3177ce2c 100644 --- a/source/smbd/dir.c +++ b/source/smbd/dir.c @@ -518,7 +518,7 @@ void *OpenDir(connection_struct *conn, char *name, BOOL use_veto) { Dir *dirp; char *n; - DIR *p = conn->vfs_ops.opendir(name); + DIR *p = conn->vfs_ops.opendir(dos_to_unix(name,False)); int used=0; if (!p) return(NULL); @@ -533,9 +533,12 @@ void *OpenDir(connection_struct *conn, char *name, BOOL use_veto) while ((n = vfs_readdirname(conn, p))) { int l = strlen(n)+1; + pstring zn; + + pstrcpy(zn, unix_to_dos(n, True)); /* If it's a vetoed file, pretend it doesn't even exist */ - if (use_veto && conn && IS_VETO_PATH(conn, n)) continue; + if (use_veto && conn && IS_VETO_PATH(conn, zn)) continue; if (used + l > dirp->mallocsize) { int s = MAX(used+l,used+2000); @@ -549,7 +552,7 @@ void *OpenDir(connection_struct *conn, char *name, BOOL use_veto) dirp->mallocsize = s; dirp->current = dirp->data; } - pstrcpy(dirp->data+used,n); + pstrcpy(dirp->data+used,zn); used += l; dirp->numentries++; } diff --git a/source/smbd/dosmode.c b/source/smbd/dosmode.c index e6f1dc72064..2923959b038 100644 --- a/source/smbd/dosmode.c +++ b/source/smbd/dosmode.c @@ -186,7 +186,7 @@ int file_chmod(connection_struct *conn,char *fname,int dosmode,SMB_STRUCT_STAT * unixmode |= tmp; } - return(conn->vfs_ops.chmod(fname,unixmode)); + return(conn->vfs_ops.chmod(dos_to_unix(fname,False),unixmode)); } diff --git a/source/smbd/filename.c b/source/smbd/filename.c index 4280508d559..504c35aeec4 100644 --- a/source/smbd/filename.c +++ b/source/smbd/filename.c @@ -285,7 +285,8 @@ static BOOL stat_cache_lookup(struct connection_struct *conn, char *name, * and then promote it to the top. */ - if(conn->vfs_ops.stat(longest_hit->translated_name, pst) != 0) { + if(conn->vfs_ops.stat(dos_to_unix(longest_hit->translated_name,False), + pst) != 0) { /* * Discard this entry. */ @@ -509,7 +510,7 @@ BOOL unix_convert(char *name,connection_struct *conn, * stat the name - if it exists then we are all done! */ - if (conn->vfs_ops.stat(name,&st) == 0) { + if (conn->vfs_ops.stat(dos_to_unix(name,False),&st) == 0) { stat_cache_add(orig_path, name); DEBUG(5,("conversion finished %s -> %s\n",orig_path, name)); if(pst) @@ -578,7 +579,7 @@ BOOL unix_convert(char *name,connection_struct *conn, * Check if the name exists up to this point. */ - if (conn->vfs_ops.stat(name, &st) == 0) { + if (conn->vfs_ops.stat(dos_to_unix(name,False), &st) == 0) { /* * It exists. it must either be a directory or this must be * the last part of the path for it to be OK. diff --git a/source/smbd/open.c b/source/smbd/open.c index 7608a25d80f..d63de45c7e0 100644 --- a/source/smbd/open.c +++ b/source/smbd/open.c @@ -33,14 +33,14 @@ fd support routines - attempt to do a dos_open static int fd_attempt_open(struct connection_struct *conn, char *fname, int flags, mode_t mode) { - int fd = conn->vfs_ops.open(fname,flags,mode); + int fd = conn->vfs_ops.open(dos_to_unix(fname,False),flags,mode); /* Fix for files ending in '.' */ if((fd == -1) && (errno == ENOENT) && (strchr(fname,'.')==NULL)) { pstrcat(fname,"."); - fd = conn->vfs_ops.open(fname,flags,mode); + fd = conn->vfs_ops.open(dos_to_unix(fname,False),flags,mode); } #if (defined(ENAMETOOLONG) && defined(HAVE_PATHCONF)) @@ -71,7 +71,8 @@ static int fd_attempt_open(struct connection_struct *conn, char *fname, char tmp = p[max_len]; p[max_len] = '\0'; - if ((fd = conn->vfs_ops.open(fname,flags,mode)) == -1) + if ((fd = conn->vfs_ops.open(dos_to_unix(fname,False),flags,mode)) + == -1) p[max_len] = tmp; } } @@ -458,10 +459,10 @@ static void open_file(files_struct *fsp,connection_struct *conn, pstrcpy(dname,fname); p = strrchr(dname,'/'); if (p) *p = 0; - if (conn->vfs_ops.disk_free(dname,&dum1,&dum2,&dum3) < + if (conn->vfs_ops.disk_free(dos_to_unix(dname,False),&dum1,&dum2,&dum3) < (SMB_BIG_UINT)lp_minprintspace(SNUM(conn))) { if(fd_attempt_close(fsp) == 0) - conn->vfs_ops.unlink(fname); + conn->vfs_ops.unlink(dos_to_unix(fname,False)); fsp->fd_ptr = 0; errno = ENOSPC; return; diff --git a/source/smbd/reply.c b/source/smbd/reply.c index b4fcfb29b9c..d83aed39fc4 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -1662,7 +1662,7 @@ static BOOL can_delete(char *fname,connection_struct *conn, int dirtype) if (!CAN_WRITE(conn)) return(False); - if (conn->vfs_ops.lstat(fname,&sbuf) != 0) return(False); + if (conn->vfs_ops.lstat(dos_to_unix(fname,False),&sbuf) != 0) return(False); fmode = dos_mode(conn,fname,&sbuf); if (fmode & aDIR) return(False); if (!lp_delete_readonly(SNUM(conn))) { @@ -1723,7 +1723,8 @@ int reply_unlink(connection_struct *conn, char *inbuf,char *outbuf, int dum_size if (!has_wild) { pstrcat(directory,"/"); pstrcat(directory,mask); - if (can_delete(directory,conn,dirtype) && !conn->vfs_ops.unlink(directory)) + if (can_delete(directory,conn,dirtype) && + !conn->vfs_ops.unlink(dos_to_unix(directory,False))) count++; if (!count) exists = vfs_file_exist(conn,dos_to_unix(directory,False),NULL); @@ -1756,7 +1757,7 @@ int reply_unlink(connection_struct *conn, char *inbuf,char *outbuf, int dum_size error = ERRnoaccess; slprintf(fname,sizeof(fname)-1, "%s/%s",directory,dname); if (!can_delete(fname,conn,dirtype)) continue; - if (!conn->vfs_ops.unlink(fname)) count++; + if (!conn->vfs_ops.unlink(dos_to_unix(fname,False))) count++; DEBUG(3,("reply_unlink : doing unlink on %s\n",fname)); } CloseDir(dirptr); @@ -2929,7 +2930,7 @@ static BOOL recursive_rmdir(connection_struct *conn, char *directory) pstrcat(fullname, "/"); pstrcat(fullname, dname); - if(conn->vfs_ops.lstat(fullname, &st) != 0) + if(conn->vfs_ops.lstat(dos_to_unix(fullname,False), &st) != 0) { ret = True; break; @@ -3024,7 +3025,8 @@ int reply_rmdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, pstrcat(fullname, "/"); pstrcat(fullname, dname); - if(conn->vfs_ops.lstat(fullname, &st) != 0) + if(conn->vfs_ops.lstat(dos_to_unix(fullname,False), + &st) != 0) break; if(st.st_mode & S_IFDIR) { @@ -3147,7 +3149,7 @@ static BOOL can_rename(char *fname,connection_struct *conn) if (!CAN_WRITE(conn)) return(False); - if (conn->vfs_ops.lstat(fname,&sbuf) != 0) return(False); + if (conn->vfs_ops.lstat(dos_to_unix(fname,False),&sbuf) != 0) return(False); if (!check_file_sharing(conn,fname,True)) return(False); return(True); diff --git a/source/smbd/vfs.c b/source/smbd/vfs.c index 95bb4c94143..18aaf0d3604 100644 --- a/source/smbd/vfs.c +++ b/source/smbd/vfs.c @@ -226,7 +226,7 @@ BOOL vfs_file_exist(connection_struct *conn,char *fname,SMB_STRUCT_STAT *sbuf) SMB_STRUCT_STAT st; if (!sbuf) sbuf = &st; - if (conn->vfs_ops.stat(fname,sbuf) != 0) + if (conn->vfs_ops.stat(dos_to_unix(fname,False),sbuf) != 0) return(False); return(S_ISREG(sbuf->st_mode)); |