s4-pvfs: when reporting the file name, don't include the :$DATA suffix
authorAndrew Tridgell <tridge@samba.org>
Sun, 18 Oct 2009 03:14:16 +0000 (14:14 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sun, 18 Oct 2009 04:06:12 +0000 (15:06 +1100)
source4/ntvfs/posix/pvfs_resolve.c

index 8c5806d93ffceac1047b268cfbd65622ae702f18..c01799e68cce3b7ed66f02930eac06def2a31efa 100644 (file)
@@ -263,6 +263,16 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name,
        NTSTATUS status;
 
        name->original_name = talloc_strdup(name, cifs_name);
+
+       /* remove any :$DATA */
+       p = strrchr(name->original_name, ':');
+       if (p && strcasecmp_m(p, ":$DATA") == 0) {
+               if (p > name->original_name && p[-1] == ':') {
+                       p--;
+               }
+               *p = 0;
+       }
+
        name->stream_name = NULL;
        name->stream_id = 0;
        name->has_wildcard = false;