summaryrefslogtreecommitdiff
path: root/source3/smbd/filename.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-07-15 20:44:24 +0000
committerLuke Leighton <lkcl@samba.org>1999-07-15 20:44:24 +0000
commit939f6d6794e1dc0677624ac67d1f00950417b713 (patch)
treeed2b5e91fe8040b455647ef552d1430138f9d6d9 /source3/smbd/filename.c
parent2b354d7330785337558a678f2b2484691ad7f2eb (diff)
downloadsamba-939f6d6794e1dc0677624ac67d1f00950417b713.tar.gz
samba-939f6d6794e1dc0677624ac67d1f00950417b713.tar.bz2
samba-939f6d6794e1dc0677624ac67d1f00950417b713.zip
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)
Diffstat (limited to 'source3/smbd/filename.c')
-rw-r--r--source3/smbd/filename.c36
1 files changed, 33 insertions, 3 deletions
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);
@@ -309,6 +310,35 @@ static BOOL stat_cache_lookup(struct connection_struct *conn, char *name,
}
/****************************************************************************
+ 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
changes etc.
@@ -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;