I found lots of places where we assume error will be set when calling
commit377017b3a14140a8a74623c2fdf00299de441317
authorAndrew Tridgell <tridge@samba.org>
Sun, 10 Aug 2008 00:43:36 +0000 (10 10:43 +1000)
committerKarolin Seeger <kseeger@samba.org>
Wed, 13 Aug 2008 14:12:09 +0000 (13 16:12 +0200)
treebdab8b566c4e2204ef8b812b89edfeae12a54ed0
parent40dc7e9a38e6c5f9c551625a7553fb0c9eb1d867
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)
(cherry picked from commit 8c66020a82d9b92fb10d14359b1381d58ad4972b)
source/lib/errmap_unix.c
source/smbd/reply.c