diff options
author | Simo Sorce <idra@samba.org> | 2008-12-22 15:54:56 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-12-22 18:52:48 -0500 |
commit | 41718e315ea78998fab0893fd5f148a49d8faab8 (patch) | |
tree | ecbc13fb3abce56481ba04e13d9aa1b69b19783b /ldb/common/ldb_controls.c | |
parent | a93a69380dc6718c49879af628ed69f8e2b70797 (diff) | |
download | sssd-41718e315ea78998fab0893fd5f148a49d8faab8.tar.gz sssd-41718e315ea78998fab0893fd5f148a49d8faab8.tar.bz2 sssd-41718e315ea78998fab0893fd5f148a49d8faab8.zip |
Rebase ldb code with all changes in samba master
Diffstat (limited to 'ldb/common/ldb_controls.c')
-rw-r--r-- | ldb/common/ldb_controls.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ldb/common/ldb_controls.c b/ldb/common/ldb_controls.c index e3f85514..6fad5012 100644 --- a/ldb/common/ldb_controls.c +++ b/ldb/common/ldb_controls.c @@ -53,6 +53,26 @@ struct ldb_control *ldb_request_get_control(struct ldb_request *req, const char return NULL; } +/* check if a control with the specified "oid" exist and return it */ +/* returns NULL if not found */ +struct ldb_control *ldb_reply_get_control(struct ldb_reply *rep, const char *oid) +{ + int i; + + /* check if there's a paged request control */ + if (rep->controls != NULL) { + for (i = 0; rep->controls[i]; i++) { + if (strcmp(oid, rep->controls[i]->oid) == 0) { + break; + } + } + + return rep->controls[i]; + } + + return NULL; +} + /* saves the current controls list into the "saver" and replace the one in req with a new one excluding the "exclude" control */ /* returns False on error */ |