s3: lib: In adouble_path(), if the parent directory name is ".", don't prepend "...
authorJeremy Allison <jra@samba.org>
Thu, 17 Jun 2021 04:10:55 +0000 (21:10 -0700)
committerNoel Power <npower@samba.org>
Tue, 22 Jun 2021 13:44:34 +0000 (13:44 +0000)
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>
source3/lib/adouble.c

index bfbdb3f9709c157d2142694692d61842a4e5fe21..3dcabeb5739cfcbbe0b7cccc6e14fe8af613d40c 100644 (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;