summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-19 20:00:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:56 -0500
commitf5ab9ddd760321ed983f0ef3354410e0a05decfc (patch)
tree3a485beade45923f9a9c43d0a41b76d378a18b57 /source3
parent2efabbbf4b97a62247aa080249d3de21f044b1cb (diff)
downloadsamba-f5ab9ddd760321ed983f0ef3354410e0a05decfc.tar.gz
samba-f5ab9ddd760321ed983f0ef3354410e0a05decfc.tar.bz2
samba-f5ab9ddd760321ed983f0ef3354410e0a05decfc.zip
r24549: Fix unix_convert to return the already converted part
This API will change anyway when moving away from pstrings. It took so long to fix, because that rename bug I just fixed gave make test failures that had nothing to do with this one. I have samba4 tests for both bugs, will check them in when the build farm has caught up (This used to be commit d4f442ed9b145990af4db26859663954ddd70926)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/filename.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index d5c22e81c3..73e3869f50 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -173,7 +173,7 @@ NTSTATUS unix_convert(connection_struct *conn,
result =determine_path_error(
&orig_path[2], allow_wcard_last_component);
}
- goto fail;
+ return result;
}
/*
@@ -222,8 +222,8 @@ NTSTATUS unix_convert(connection_struct *conn,
if ((dirpath == NULL) && (!(dirpath = SMB_STRDUP("")))) {
DEBUG(0, ("strdup failed\n"));
- result = NT_STATUS_NO_MEMORY;
- goto fail;
+ SAFE_FREE(name);
+ return NT_STATUS_NO_MEMORY;
}
/*
@@ -602,9 +602,15 @@ NTSTATUS unix_convert(connection_struct *conn,
DEBUG(5,("conversion finished %s -> %s\n",orig_path, name));
done:
- result = NT_STATUS_OK;
pstrcpy(orig_path, name);
+ SAFE_FREE(name);
+ SAFE_FREE(dirpath);
+ return NT_STATUS_OK;
fail:
+ DEBUG(10, ("dirpath = [%s] start = [%s]\n", dirpath, start));
+ pstrcpy(orig_path, dirpath);
+ pstrcat(orig_path, "/");
+ pstrcat(orig_path, start);
SAFE_FREE(name);
SAFE_FREE(dirpath);
return result;