From 939f6d6794e1dc0677624ac67d1f00950417b713 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 15 Jul 1999 20:44:24 +0000 Subject: more dfs stuff. this looks like it's going to be more appropriate to use the vfs tables. at the moment, i replaced all calls to unix_convert() with unix_dfs_convert(). this does the job, but it's not very nice. (This used to be commit 00d4aebce9f268a737ef9df9bdbe59f8fe831979) --- source3/smbd/filename.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'source3/smbd/filename.c') diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index fb2f57339b..1d9c5ef754 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -26,6 +26,7 @@ extern BOOL case_sensitive; extern BOOL case_preserve; extern BOOL short_case_preserve; extern fstring remote_machine; +extern pstring global_myname; extern BOOL use_mangled_map; static BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache); @@ -308,6 +309,35 @@ static BOOL stat_cache_lookup(struct connection_struct *conn, char *name, return (namelen == longest_hit->name_len); } +/**************************************************************************** + this routine converts from the dos and dfs namespace to the unix namespace. +****************************************************************************/ +BOOL unix_dfs_convert(char *name,connection_struct *conn, + char *saved_last_component, + BOOL *bad_path, SMB_STRUCT_STAT *pst) +{ + pstring local_path; + + DEBUG(10,("unix_dfs_convert: %s\n", name)); + + if (name != NULL && + under_dfs(conn, name, local_path, sizeof(local_path))) + { + DEBUG(10,("%s is in dfs map.\n", name)); + + /* check for our own name */ + if (StrCaseCmp(global_myname, name+1) > 0) + { + return False; + } + + pstrcpy(name, local_path); + + DEBUG(10,("removed name: %s\n", name)); + } + return unix_convert(name, conn, saved_last_component, bad_path, pst); +} + /**************************************************************************** This routine is called to convert names from the dos namespace to unix namespace. It needs to handle any case conversions, mangling, format @@ -329,9 +359,9 @@ used to pick the correct error code to return between ENOENT and ENOTDIR as Windows applications depend on ERRbadpath being returned if a component of a pathname does not exist. ****************************************************************************/ - -BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, - BOOL *bad_path, SMB_STRUCT_STAT *pst) +BOOL unix_convert(char *name,connection_struct *conn, + char *saved_last_component, + BOOL *bad_path, SMB_STRUCT_STAT *pst) { SMB_STRUCT_STAT st; char *start, *end; -- cgit