I found lots of places where we assume error will be set when calling
commit834684a524a24bb4eb46b4af583d39947dc87d95
authorAndrew Tridgell <tridge@samba.org>
Sun, 10 Aug 2008 00:43:36 +0000 (10 10:43 +1000)
committerMichael Adam <obnox@samba.org>
Tue, 12 Aug 2008 19:37:16 +0000 (12 21:37 +0200)
treec32f712800046fd6cdd8ef6121fc98cca76de650
parent469ba9b87103aa0053c371e481acc5acf0f98ac1
I found lots of places where we assume error will be set when calling
one of our virtualised functions, such as db_open(), but error is only
set when a system call fails, and it is not uncommon for us to fail a
function internally without ever making a system call. That led to us
passing back success when a function had in fact failed.

I found two places where we relied on map_nt_error_from_unix()
returning success when errno==0, but lots and lots of places where we
relied on the reverse, so I fixed those two places.

map_nt_error_from_unix() will now always return an error, returning
NT_STATUS_UNSUCCESSFUL if errno is 0
(cherry picked from commit 69d40ca4c1af925d4b0e59ddc69ef8c26e6501d1)
source/lib/errmap_unix.c
source/smbd/reply.c