diff options
author | Michael Adam <obnox@samba.org> | 2011-08-24 13:08:13 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-10-11 14:17:56 +0200 |
commit | 0e28448a780cf231ae38fe03a85cf6e1ea9dded0 (patch) | |
tree | 91878c39866520bc06d968cd44cd8a86995cc8ad /source3/param | |
parent | 25a9978c2c4d00eb64b212170f64f5cc136e032a (diff) | |
download | samba-0e28448a780cf231ae38fe03a85cf6e1ea9dded0.tar.gz samba-0e28448a780cf231ae38fe03a85cf6e1ea9dded0.tar.bz2 samba-0e28448a780cf231ae38fe03a85cf6e1ea9dded0.zip |
s3:dbwrap: convert dbwrap_fetch(), dbwrap_fetch_bystring() and dbwrap_fetch_bystring_upper() to NTSTATUS
Diffstat (limited to 'source3/param')
-rw-r--r-- | source3/param/loadparm.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a8d16a7162..aa27d2cba3 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6399,6 +6399,7 @@ static int getservicebyname(const char *pszServiceName, struct loadparm_service int iService = -1; char *canon_name; TDB_DATA data; + NTSTATUS status; if (ServiceHash == NULL) { return -1; @@ -6406,9 +6407,13 @@ static int getservicebyname(const char *pszServiceName, struct loadparm_service canon_name = canonicalize_servicename(talloc_tos(), pszServiceName); - data = dbwrap_fetch_bystring(ServiceHash, canon_name, canon_name); + status = dbwrap_fetch_bystring(ServiceHash, canon_name, canon_name, + &data); - if ((data.dptr != NULL) && (data.dsize == sizeof(iService))) { + if (NT_STATUS_IS_OK(status) && + (data.dptr != NULL) && + (data.dsize == sizeof(iService))) + { iService = *(int *)data.dptr; } @@ -8541,12 +8546,18 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i } { - TDB_DATA data = dbwrap_fetch_bystring( - ServiceHash, canon_name, canon_name); + TDB_DATA data; + NTSTATUS status; + + status = dbwrap_fetch_bystring(ServiceHash, canon_name, + canon_name, &data); iService = -1; - if ((data.dptr != NULL) && (data.dsize == sizeof(iService))) { + if (NT_STATUS_IS_OK(status) && + (data.dptr != NULL) && + (data.dsize == sizeof(iService))) + { iService = *(int *)data.dptr; } } |