1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

s3: lib: In adouble_path(), if the parent directory name is ".", don't prepend "./" to the outgoing filename.

We expect smb_fname->base_name values to not contain "./name".

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2021-06-16 21:10:55 -07:00 committed by Noel Power
parent c04df97ee5
commit ec0c271071

View File

@ -2717,8 +2717,13 @@ int adouble_path(TALLOC_CTX *ctx,
return -1;
}
smb_fname->base_name = talloc_asprintf(smb_fname,
if (ISDOT(parent)) {
smb_fname->base_name = talloc_asprintf(smb_fname,
"._%s", base);
} else {
smb_fname->base_name = talloc_asprintf(smb_fname,
"%s/._%s", parent, base);
}
if (smb_fname->base_name == NULL) {
TALLOC_FREE(smb_fname);
return -1;