From e3569df15b28896f4f79733df28498da2c021efe Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 1 Feb 2009 17:17:37 +0100 Subject: If we receive a DOS error code, nt_errstr should display it --- source3/Makefile.in | 4 ++-- source3/libsmb/nterr.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source3/Makefile.in b/source3/Makefile.in index 6e453c9a86..03463e9cd2 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -423,7 +423,7 @@ LIBNBT_OBJ = ../libcli/nbt/nbtname.o \ LIBNMB_OBJ = libsmb/unexpected.o libsmb/namecache.o libsmb/nmblib.o \ libsmb/namequery.o libsmb/conncache.o libads/dns.o -NTERR_OBJ = libsmb/nterr.o +NTERR_OBJ = libsmb/nterr.o libsmb/smberr.o DOSERR_OBJ = ../libcli/util/doserr.o ERRORMAP_OBJ = libsmb/errormap.o DCE_RPC_ERR_OBJ = ../librpc/rpc/dcerpc_error.o @@ -451,7 +451,7 @@ LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \ libsmb/clireadwrite.o libsmb/clilist.o libsmb/cliprint.o \ libsmb/clitrans.o libsmb/clisecdesc.o libsmb/clidgram.o \ libsmb/clistr.o libsmb/cliquota.o libsmb/clifsinfo.o libsmb/clidfs.o \ - libsmb/smberr.o libsmb/credentials.o libsmb/pwd_cache.o \ + libsmb/credentials.o libsmb/pwd_cache.o \ libsmb/clioplock.o libsmb/clirap2.o \ libsmb/smb_seal.o libsmb/async_smb.o \ $(LIBSAMBA_OBJ) \ diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 465d88a9b6..52e81acbc3 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -659,6 +659,11 @@ const char *nt_errstr(NTSTATUS nt_code) } #endif + if (NT_STATUS_IS_DOS(nt_code)) { + return smb_dos_err_name(NT_STATUS_DOS_CLASS(nt_code), + NT_STATUS_DOS_CODE(nt_code)); + } + while (nt_errs[idx].nt_errstr != NULL) { if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) { return nt_errs[idx].nt_errstr; -- cgit