From 0615b72a6b62d590831f1c24c5678dd29b9a2338 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Wed, 3 Jun 2015 17:07:46 +0200 Subject: [PATCH] smbd/trans2: add a useful diagnostic for files with bad encoding Catch conversion error and log the path of the offending file. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Tue Jun 9 21:00:02 CEST 2015 on sn-devel-104 --- source3/smbd/trans2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 6c77e85f20e..e518c7b48ef 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -2374,6 +2374,10 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx, ppdata, end_data, &last_entry_off); + if (NT_STATUS_EQUAL(status, NT_STATUS_ILLEGAL_CHARACTER)) { + DEBUG(1,("Conversion error: illegal character: %s\n", + smb_fname_str_dbg(smb_fname))); + } TALLOC_FREE(fname); TALLOC_FREE(smb_fname); if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {