summaryrefslogtreecommitdiffstats
path: root/source/smbd/filename.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/smbd/filename.c')
-rw-r--r--source/smbd/filename.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/smbd/filename.c b/source/smbd/filename.c
index ad707a2b9dd..9dd1523c73d 100644
--- a/source/smbd/filename.c
+++ b/source/smbd/filename.c
@@ -248,6 +248,16 @@ BOOL unix_convert(pstring name,connection_struct *conn,char *saved_last_componen
return(False);
}
+ if (!end) {
+ /*
+ * We just scanned for, and found the end of the path.
+ * We must return the valid stat struct.
+ * JRA.
+ */
+
+ *pst = st;
+ }
+
} else {
pstring rest;
@@ -373,7 +383,8 @@ BOOL unix_convert(pstring name,connection_struct *conn,char *saved_last_componen
/*
* If we ended up resolving the entire path then return a valid
- * stat struct if we got one.
+ * stat struct if we got one. Note this doesn't catch mangled paths,
+ * but the check in the for loop above will do that. JRA.
*/
if (VALID_STAT(st) && (strlen(orig_path) == strlen(name)))