summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-07 19:08:52 +0200
committerVolker Lendecke <vl@samba.org>2009-06-07 23:14:40 +0200
commitbee9fda243f43b63ad460081b72316c172303541 (patch)
tree9bdc2ef3518d510412b3d1a139ec55542133c090
parent27fcab98e7095ea48d35c421f221cb8ac33f6ad2 (diff)
downloadsamba-bee9fda243f43b63ad460081b72316c172303541.tar.gz
samba-bee9fda243f43b63ad460081b72316c172303541.tar.bz2
samba-bee9fda243f43b63ad460081b72316c172303541.zip
Add tldap_pull_uint32
-rw-r--r--source3/include/tldap_util.h2
-rw-r--r--source3/lib/tldap_util.c12
2 files changed, 14 insertions, 0 deletions
diff --git a/source3/include/tldap_util.h b/source3/include/tldap_util.h
index 2d5cf57a9c..1c993769d7 100644
--- a/source3/include/tldap_util.h
+++ b/source3/include/tldap_util.h
@@ -49,5 +49,7 @@ int tldap_search_fmt(struct tldap_context *ld, const char *base, int scope,
const char *fmt, ...);
bool tldap_pull_uint64(struct tldap_message *msg, const char *attr,
uint64_t *presult);
+bool tldap_pull_uint32(struct tldap_message *msg, const char *attr,
+ uint32_t *presult);
#endif
diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c
index 1f2cc1d8de..1b0c3446ee 100644
--- a/source3/lib/tldap_util.c
+++ b/source3/lib/tldap_util.c
@@ -349,3 +349,15 @@ bool tldap_pull_uint64(struct tldap_message *msg, const char *attr,
*presult = result;
return true;
}
+
+bool tldap_pull_uint32(struct tldap_message *msg, const char *attr,
+ uint32_t *presult)
+{
+ uint64_t result;
+
+ if (!tldap_pull_uint64(msg, attr, &result)) {
+ return false;
+ }
+ *presult = (uint32_t)result;
+ return true;
+}