Turns out with Win9x, we could occasionally return from unix_convert() given
authorJeremy Allison <jra@samba.org>
Fri, 11 Oct 2002 01:19:00 +0000 (01:19 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 11 Oct 2002 01:19:00 +0000 (01:19 +0000)
a mangled name without a valid stat struct if the file existed. This would
then cause open_file_shared1() to erroneously think the file open was new,
thus not check for oplock break, thus causing a spurious EAGAIN reply to
the open on a file we already had kernel oplocked.... (phew - that was fun
to track down :-).
Jeremy.
(This used to be commit af80b033a5374da9163e3484f7d8707813490597)

source3/smbd/filename.c

index d343db26f6b6d57cb7acd65fe642ef37e2918ac9..202bd75d4c87be9aff779bf2698aadc3e60ffc7f 100644 (file)
@@ -318,6 +318,18 @@ BOOL unix_convert(pstring name,connection_struct *conn,char *saved_last_componen
                                pstrcat(start,"/");
                                pstrcat(start,rest);
                                *end = '\0';
+                       } else {
+                               /*
+                                * We just scanned for, and found the end of the path.
+                                * We must return a valid stat struct if it exists.
+                                * JRA.
+                                */
+
+                               if (vfs_stat(conn,name, &st) == 0) {
+                                       *pst = st;
+                               } else {
+                                       ZERO_STRUCT(st);
+                               }
                        }
                } /* end else */