? client_oplocks.txt ? include/.vfs_macros.h.swp ? msdfs/.msdfs.c.swp Index: msdfs/msdfs.c =================================================================== RCS file: /data/cvs/samba/source/msdfs/msdfs.c,v retrieving revision 1.28.2.17 diff -u -r1.28.2.17 msdfs.c --- msdfs/msdfs.c 22 Oct 2003 23:38:20 -0000 1.28.2.17 +++ msdfs/msdfs.c 25 Oct 2003 00:37:48 -0000 @@ -161,7 +161,8 @@ /********************************************************************** Returns true if the unix path is a valid msdfs symlink **********************************************************************/ -BOOL is_msdfs_link(connection_struct* conn, char* path, + +BOOL is_msdfs_link(connection_struct* conn, char * path, struct referral** reflistp, int* refcnt, SMB_STRUCT_STAT *sbufp) { @@ -172,8 +173,6 @@ if (!path || !conn) return False; - strlower_m(path); - if (sbufp == NULL) sbufp = &st; @@ -213,16 +212,19 @@ consumedcntp: how much of the dfs path is being redirected. the client should try the remaining path on the redirected server. *****************************************************************/ -static BOOL resolve_dfs_path(char* dfspath, struct dfs_path* dp, + +static BOOL resolve_dfs_path(pstring dfspath, struct dfs_path* dp, connection_struct* conn, BOOL findfirst_flag, struct referral** reflistpp, int* refcntp, BOOL* self_referralp, int* consumedcntp) { - fstring localpath; + pstring localpath; int consumed_level = 1; char *p; - fstring reqpath; + BOOL bad_path = False; + SMB_STRUCT_STAT sbuf; + pstring reqpath; if (!dp || !conn) { DEBUG(1,("resolve_dfs_path: NULL dfs_path* or NULL connection_struct*!\n")); @@ -237,10 +239,10 @@ return False; } + unix_convert(dp->reqpath,conn,0,&bad_path,&sbuf,True); + pstrcat(localpath, dp->reqpath); + /* check if need to redirect */ - fstrcpy(localpath, conn->connectpath); - fstrcat(localpath, "/"); - fstrcat(localpath, dp->reqpath); if (is_msdfs_link(conn, localpath, reflistpp, refcntp, NULL)) { if (findfirst_flag) { DEBUG(6,("resolve_dfs_path (FindFirst) No redirection " @@ -256,13 +258,13 @@ } /* redirect if any component in the path is a link */ - fstrcpy(reqpath, dp->reqpath); + pstrcpy(reqpath, dp->reqpath); p = strrchr(reqpath, '/'); while (p) { *p = '\0'; - fstrcpy(localpath, conn->connectpath); - fstrcat(localpath, "/"); - fstrcat(localpath, reqpath); + pstrcpy(localpath, conn->connectpath); + pstrcat(localpath, "/"); + pstrcat(localpath, reqpath); if (is_msdfs_link(conn, localpath, reflistpp, refcntp, NULL)) { DEBUG(4, ("resolve_dfs_path: Redirecting %s because parent %s is dfs link\n", dfspath, localpath)); @@ -278,7 +280,8 @@ trim_char(buf, '\0', '\\'); for (; consumed_level; consumed_level--) { q = strrchr(buf, '\\'); - if (q) *q = 0; + if (q) + *q = 0; } *consumedcntp = strlen(buf); DEBUG(10, ("resolve_dfs_path: Path consumed: %s (%d)\n", buf, *consumedcntp)); @@ -297,7 +300,8 @@ Decides if a dfs pathname should be redirected or not. If not, the pathname is converted to a tcon-relative local unix path *****************************************************************/ -BOOL dfs_redirect(char* pathname, connection_struct* conn, + +BOOL dfs_redirect(pstring pathname, connection_struct* conn, BOOL findfirst_flag) { struct dfs_path dp; @@ -310,7 +314,7 @@ /* if dfs pathname for a non-dfs share, convert to tcon-relative path and return false */ if (!lp_msdfs_root(SNUM(conn))) { - fstrcpy(pathname, dp.reqpath); + pstrcpy(pathname, dp.reqpath); return False; } @@ -325,7 +329,7 @@ DEBUG(3,("dfs_redirect: Not redirecting %s.\n", pathname)); /* Form non-dfs tcon-relative path */ - fstrcpy(pathname, dp.reqpath); + pstrcpy(pathname, dp.reqpath); DEBUG(3,("dfs_redirect: Path converted to non-dfs path %s\n", pathname)); return False; @@ -752,7 +756,6 @@ safe_strcpy(path, lp_pathname(snum), max_pathlen-1); safe_strcat(path, "/", max_pathlen-1); - strlower_m(jn->volume_name); safe_strcat(path, jn->volume_name, max_pathlen-1); pstrcpy(conn_path, lp_pathname(snum)); Index: printing/nt_printing.c =================================================================== RCS file: /data/cvs/samba/source/printing/nt_printing.c,v retrieving revision 1.204.2.44 diff -u -r1.204.2.44 nt_printing.c --- printing/nt_printing.c 20 Oct 2003 14:02:02 -0000 1.204.2.44 +++ printing/nt_printing.c 25 Oct 2003 00:37:48 -0000 @@ -978,7 +978,7 @@ /* Get file version info (if available) for previous file (if it exists) */ pstrcpy(filepath, old_file); - unix_convert(filepath,conn,NULL,&bad_path,&stat_buf); + unix_convert(filepath,conn,NULL,&bad_path,&stat_buf,False); fsp = open_file_shared(conn, filepath, &stat_buf, SET_OPEN_MODE(DOS_OPEN_RDONLY), @@ -1007,7 +1007,7 @@ /* Get file version info (if available) for new file */ pstrcpy(filepath, new_file); - unix_convert(filepath,conn,NULL,&bad_path,&stat_buf); + unix_convert(filepath,conn,NULL,&bad_path,&stat_buf,False); fsp = open_file_shared(conn, filepath, &stat_buf, SET_OPEN_MODE(DOS_OPEN_RDONLY), @@ -1123,7 +1123,7 @@ * deriver the cversion. */ slprintf(driverpath, sizeof(driverpath)-1, "%s/%s", architecture, driverpath_in); - unix_convert(driverpath,conn,NULL,&bad_path,&st); + unix_convert(driverpath,conn,NULL,&bad_path,&st,False); fsp = open_file_shared(conn, driverpath, &st, SET_OPEN_MODE(DOS_OPEN_RDONLY), Index: rpc_server/srv_srvsvc_nt.c =================================================================== RCS file: /data/cvs/samba/source/rpc_server/srv_srvsvc_nt.c,v retrieving revision 1.70.2.15 diff -u -r1.70.2.15 srv_srvsvc_nt.c --- rpc_server/srv_srvsvc_nt.c 19 Sep 2003 21:57:43 -0000 1.70.2.15 +++ rpc_server/srv_srvsvc_nt.c 25 Oct 2003 00:37:49 -0000 @@ -1886,7 +1886,7 @@ became_user = True; unistr2_to_ascii(filename, &q_u->uni_file_name, sizeof(filename)); - unix_convert(filename, conn, NULL, &bad_path, &st); + unix_convert(filename, conn, NULL, &bad_path, &st,False); fsp = open_file_shared(conn, filename, &st, SET_OPEN_MODE(DOS_OPEN_RDONLY), (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), 0, 0, &access_mode, &action); @@ -1989,7 +1989,7 @@ became_user = True; unistr2_to_ascii(filename, &q_u->uni_file_name, sizeof(filename)); - unix_convert(filename, conn, NULL, &bad_path, &st); + unix_convert(filename, conn, NULL, &bad_path, &st,False); fsp = open_file_shared(conn, filename, &st, SET_OPEN_MODE(DOS_OPEN_RDWR), (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), 0, 0, &access_mode, &action); Index: smbd/filename.c =================================================================== RCS file: /data/cvs/samba/source/smbd/filename.c,v retrieving revision 1.48.2.12 diff -u -r1.48.2.12 filename.c --- smbd/filename.c 5 Sep 2003 19:59:55 -0000 1.48.2.12 +++ smbd/filename.c 25 Oct 2003 00:37:49 -0000 @@ -89,7 +89,7 @@ ****************************************************************************/ BOOL unix_convert(pstring name,connection_struct *conn,char *saved_last_component, - BOOL *bad_path, SMB_STRUCT_STAT *pst) + BOOL *bad_path, SMB_STRUCT_STAT *pst, BOOL statlink) { SMB_STRUCT_STAT st; char *start, *end; @@ -97,7 +97,9 @@ pstring orig_path; BOOL component_was_mangled = False; BOOL name_has_wildcard = False; - + int (*statcall)(struct vfs_handle_struct *, struct connection_struct *, const char *, SMB_STRUCT_STAT *) = + (statlink ? (conn)->vfs.ops.lstat : (conn)->vfs.ops.stat); + struct vfs_handle_struct *stathnd = (statlink ? (conn)->vfs.handles.lstat : (conn)->vfs.handles.stat); ZERO_STRUCTP(pst); *dirpath = 0; @@ -169,7 +171,7 @@ pstrcpy(orig_path, name); - if(!case_sensitive && stat_cache_lookup(conn, name, dirpath, &start, &st)) { + if(!case_sensitive && stat_cache_lookup(conn, name, dirpath, &start, &st, statlink)) { *pst = st; return True; } @@ -178,7 +180,7 @@ * stat the name - if it exists then we are all done! */ - if (SMB_VFS_STAT(conn,name,&st) == 0) { + if ((*statcall)(stathnd,conn,name,&st) == 0) { stat_cache_add(orig_path, name); DEBUG(5,("conversion finished %s -> %s\n",orig_path, name)); *pst = st; @@ -234,7 +236,7 @@ * Check if the name exists up to this point. */ - if (SMB_VFS_STAT(conn,name, &st) == 0) { + if ((*statcall)(stathnd,conn,name, &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. @@ -342,7 +344,7 @@ * JRA. */ - if (SMB_VFS_STAT(conn,name, &st) == 0) { + if ((*statcall)(stathnd,conn,name, &st) == 0) { *pst = st; } else { ZERO_STRUCT(st); Index: smbd/nttrans.c =================================================================== RCS file: /data/cvs/samba/source/smbd/nttrans.c,v retrieving revision 1.154.2.33 diff -u -r1.154.2.33 nttrans.c --- smbd/nttrans.c 16 Oct 2003 20:44:43 -0000 1.154.2.33 +++ smbd/nttrans.c 25 Oct 2003 00:37:49 -0000 @@ -756,7 +756,7 @@ set_posix_case_semantics(file_attributes); - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); unixmode = unix_mode(conn,smb_attr | aARCH, fname); @@ -1280,7 +1280,7 @@ RESOLVE_DFSPATH(fname, conn, inbuf, outbuf); - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); unixmode = unix_mode(conn,smb_attr | aARCH, fname); Index: smbd/reply.c =================================================================== RCS file: /data/cvs/samba/source/smbd/reply.c,v retrieving revision 1.381.2.57 diff -u -r1.381.2.57 reply.c --- smbd/reply.c 16 Oct 2003 18:17:44 -0000 1.381.2.57 +++ smbd/reply.c 25 Oct 2003 00:37:50 -0000 @@ -422,7 +422,7 @@ RESOLVE_DFSPATH(name, conn, inbuf, outbuf); - unix_convert(name,conn,0,&bad_path,&sbuf); + unix_convert(name,conn,0,&bad_path,&sbuf,False); mode = SVAL(inbuf,smb_vwv0); @@ -510,7 +510,7 @@ mtime = 0; ok = True; } else { - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); if (check_name(fname,conn)) { if (VALID_STAT(sbuf) || SMB_VFS_STAT(conn,fname,&sbuf) == 0) { mode = dos_mode(conn,fname,&sbuf); @@ -573,7 +573,7 @@ return ERROR_NT(status); } - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); mode = SVAL(inbuf,smb_vwv0); mtime = make_unix_date3(inbuf+smb_vwv1); @@ -713,7 +713,7 @@ pstrcpy(directory,path); pstrcpy(dir2,path); - unix_convert(directory,conn,0,&bad_path,&sbuf); + unix_convert(directory,conn,0,&bad_path,&sbuf,False); unix_format(dir2); if (!check_name(directory,conn)) @@ -931,7 +931,7 @@ RESOLVE_DFSPATH(fname, conn, inbuf, outbuf); - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); unixmode = unix_mode(conn,aARCH,fname); @@ -1023,7 +1023,7 @@ RESOLVE_DFSPATH(fname, conn, inbuf, outbuf); - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); unixmode = unix_mode(conn,smb_attr | aARCH, fname); @@ -1139,7 +1139,7 @@ RESOLVE_DFSPATH(fname, conn, inbuf, outbuf); - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); if (createmode & aVOLID) DEBUG(0,("Attempt to create file (%s) with volid set - please report this\n",fname)); @@ -1209,7 +1209,7 @@ RESOLVE_DFSPATH(fname, conn, inbuf, outbuf); - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); unixmode = unix_mode(conn,createmode,fname); @@ -1392,7 +1392,7 @@ has_wild = ms_has_wild(name); - rc = unix_convert(name,conn,0,&bad_path,&sbuf); + rc = unix_convert(name,conn,0,&bad_path,&sbuf,False); p = strrchr_m(name,'/'); if (!p) { @@ -3001,7 +3001,7 @@ SMB_STRUCT_STAT sbuf; int ret= -1; - unix_convert(directory,conn,0,&bad_path,&sbuf); + unix_convert(directory,conn,0,&bad_path,&sbuf,False); if (ms_has_wild(directory)) { return NT_STATUS_OBJECT_NAME_INVALID; @@ -3219,7 +3219,7 @@ RESOLVE_DFSPATH(directory, conn, inbuf, outbuf) - unix_convert(directory,conn, NULL,&bad_path,&sbuf); + unix_convert(directory,conn, NULL,&bad_path,&sbuf,False); if (check_name(directory,conn)) { dptr_closepath(directory,SVAL(inbuf,smb_pid)); @@ -3346,7 +3346,7 @@ BOOL dest_exists; ZERO_STRUCT(sbuf); - unix_convert(newname,conn,newname_last_component,&bad_path,&sbuf); + unix_convert(newname,conn,newname_last_component,&bad_path,&sbuf,False); /* Ensure newname contains a '/' */ if(strrchr_m(newname,'/') == 0) { @@ -3458,8 +3458,8 @@ ZERO_STRUCT(sbuf1); ZERO_STRUCT(sbuf2); - rc = unix_convert(name,conn,0,&bad_path1,&sbuf1); - unix_convert(newname,conn,newname_last_component,&bad_path2,&sbuf2); + rc = unix_convert(name,conn,0,&bad_path1,&sbuf1,False); + unix_convert(newname,conn,newname_last_component,&bad_path2,&sbuf2,False); /* * Split the old name into directory and last component @@ -3877,8 +3877,8 @@ RESOLVE_DFSPATH(name, conn, inbuf, outbuf); RESOLVE_DFSPATH(newname, conn, inbuf, outbuf); - rc = unix_convert(name,conn,0,&bad_path1,&sbuf1); - unix_convert(newname,conn,0,&bad_path2,&sbuf2); + rc = unix_convert(name,conn,0,&bad_path1,&sbuf1,False); + unix_convert(newname,conn,0,&bad_path2,&sbuf2,False); target_is_directory = VALID_STAT_OF_DIR(sbuf2); Index: smbd/statcache.c =================================================================== RCS file: /data/cvs/samba/source/smbd/statcache.c,v retrieving revision 1.13.2.13 diff -u -r1.13.2.13 statcache.c --- smbd/statcache.c 15 Sep 2003 12:22:34 -0000 1.13.2.13 +++ smbd/statcache.c 25 Oct 2003 00:37:50 -0000 @@ -195,7 +195,7 @@ */ BOOL stat_cache_lookup(connection_struct *conn, pstring name, pstring dirpath, - char **start, SMB_STRUCT_STAT *pst) + char **start, SMB_STRUCT_STAT *pst, BOOL statlink) { stat_cache_entry *scp; char *chk_name; @@ -204,6 +204,9 @@ char *sp; BOOL sizechanged = False; unsigned int num_components = 0; + int (*statcall)(struct vfs_handle_struct *, struct connection_struct *, const char *, SMB_STRUCT_STAT *) = + (statlink ? (conn)->vfs.ops.lstat : (conn)->vfs.ops.stat); + struct vfs_handle_struct *stathnd = (statlink ? (conn)->vfs.handles.lstat : (conn)->vfs.handles.stat); if (!lp_stat_cache()) return False; @@ -280,7 +283,7 @@ scp = (stat_cache_entry *)(hash_elem->value); DEBUG(10,("stat_cache_lookup: lookup succeeded for name [%s] -> [%s]\n", chk_name, scp->translated_path )); DO_PROFILE_INC(statcache_hits); - if(SMB_VFS_STAT(conn,scp->translated_path, pst) != 0) { + if((*statcall)(stathnd,conn,scp->translated_path, pst) != 0) { /* Discard this entry - it doesn't exist in the filesystem. */ hash_remove(&stat_cache, hash_elem); SAFE_FREE(chk_name); Index: smbd/trans2.c =================================================================== RCS file: /data/cvs/samba/source/smbd/trans2.c,v retrieving revision 1.217.2.55 diff -u -r1.217.2.55 trans2.c --- smbd/trans2.c 16 Oct 2003 20:44:43 -0000 1.217.2.55 +++ smbd/trans2.c 25 Oct 2003 00:37:51 -0000 @@ -258,7 +258,7 @@ /* XXXX we need to handle passed times, sattr and flags */ - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); if (!check_name(fname,conn)) { return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRnoaccess); @@ -972,7 +972,7 @@ RESOLVE_FINDFIRST_DFSPATH(directory, conn, inbuf, outbuf); - unix_convert(directory,conn,0,&bad_path,&sbuf); + unix_convert(directory,conn,0,&bad_path,&sbuf,False); if(!check_name(directory,conn)) { return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath); } @@ -1860,7 +1860,7 @@ */ pstrcpy(fname, fsp->fsp_name); - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); if (!check_name(fname,conn)) { DEBUG(3,("call_trans2qfilepathinfo: fileinfo of %s failed for fake_file(%s)\n",fname,strerror(errno))); return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath); @@ -1873,7 +1873,7 @@ * to do this call. JRA. */ pstrcpy(fname, fsp->fsp_name); - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); if (!check_name(fname,conn)) { DEBUG(3,("call_trans2qfilepathinfo: fileinfo of %s failed (%s)\n",fname,strerror(errno))); return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath); @@ -1918,7 +1918,7 @@ RESOLVE_DFSPATH(fname, conn, inbuf, outbuf); - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); if (!check_name(fname,conn)) { DEBUG(3,("call_trans2qfilepathinfo: fileinfo of %s failed (%s)\n",fname,strerror(errno))); return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath); @@ -2415,7 +2415,7 @@ SMB_STRUCT_STAT sbuf; pstrcpy(link_dest, link_dest_in); - unix_convert(link_dest,conn,0,&bad_path,&sbuf); + unix_convert(link_dest,conn,0,&bad_path,&sbuf,False); /* Store the UNIX converted path. */ pstrcpy(link_dest_out, link_dest); @@ -2497,7 +2497,7 @@ * to do this call. JRA. */ pstrcpy(fname, fsp->fsp_name); - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); if (!check_name(fname,conn) || (!VALID_STAT(sbuf))) { DEBUG(3,("call_trans2setfilepathinfo: fileinfo of %s failed (%s)\n",fname,strerror(errno))); return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath); @@ -2537,7 +2537,7 @@ info_level = SVAL(params,0); srvstr_pull(inbuf, fname, ¶ms[6], sizeof(fname), -1, STR_TERMINATE); - unix_convert(fname,conn,0,&bad_path,&sbuf); + unix_convert(fname,conn,0,&bad_path,&sbuf,False); if(!check_name(fname, conn)) { return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath); } @@ -3176,7 +3176,7 @@ DEBUG(3,("call_trans2mkdir : name = %s\n", directory)); - unix_convert(directory,conn,0,&bad_path,&sbuf); + unix_convert(directory,conn,0,&bad_path,&sbuf,False); if (check_name(directory,conn)) ret = vfs_MkDir(conn,directory,unix_mode(conn,aDIR,directory));