This occurs on first CHDIR to the root of the share.
Ensure we don't add conn->connectpath twice when doing
creating the file name hash.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
/* Set the hash of the full pathname. */
- len = full_path_tos(conn->connectpath, name, tmpbuf, sizeof(tmpbuf),
- &fullpath, &to_free);
+ if (name[0] == '/') {
+ strlcpy(tmpbuf, name, sizeof(tmpbuf));
+ fullpath = tmpbuf;
+ len = strlen(fullpath);
+ to_free = NULL;
+ } else {
+ len = full_path_tos(conn->connectpath,
+ name,
+ tmpbuf,
+ sizeof(tmpbuf),
+ &fullpath,
+ &to_free);
+ }
if (len == -1) {
return NT_STATUS_NO_MEMORY;
}