summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-08-24 13:08:13 +0200
committerMichael Adam <obnox@samba.org>2011-10-11 14:17:56 +0200
commit0e28448a780cf231ae38fe03a85cf6e1ea9dded0 (patch)
tree91878c39866520bc06d968cd44cd8a86995cc8ad /source3/param
parent25a9978c2c4d00eb64b212170f64f5cc136e032a (diff)
downloadsamba-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.c21
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;
}
}