summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_resolve.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ntvfs/posix/pvfs_resolve.c')
-rw-r--r--source4/ntvfs/posix/pvfs_resolve.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c
index 5c535c9880..dfd6744eff 100644
--- a/source4/ntvfs/posix/pvfs_resolve.c
+++ b/source4/ntvfs/posix/pvfs_resolve.c
@@ -164,10 +164,18 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name,
name->stream_name = NULL;
name->has_wildcard = False;
- if (*cifs_name == '\\') {
+ while (*cifs_name == '\\') {
cifs_name++;
}
+ if (*cifs_name == 0) {
+ name->full_name = talloc_asprintf(name, "%s/.", pvfs->base_directory);
+ if (name->full_name == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ return NT_STATUS_OK;
+ }
+
ret = talloc_asprintf(name, "%s/%s", pvfs->base_directory, cifs_name);
if (ret == NULL) {
return NT_STATUS_NO_MEMORY;
@@ -175,6 +183,10 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name,
p = ret + strlen(pvfs->base_directory) + 1;
+ if (p[strlen(cifs_name)-1] == '\\') {
+ p[strlen(cifs_name)-1] = 0;
+ }
+
/* now do an in-place conversion of '\' to '/', checking
for legal characters */
for (;*p;p++) {