diff options
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/sysdb.c | 10 | ||||
-rw-r--r-- | src/db/sysdb.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c index 7b3757e74..fe508818b 100644 --- a/src/db/sysdb.c +++ b/src/db/sysdb.c @@ -508,6 +508,16 @@ int sysdb_attrs_add_string(struct sysdb_attrs *attrs, return sysdb_attrs_add_val(attrs, name, &v); } +int sysdb_attrs_add_mem(struct sysdb_attrs *attrs, const char *name, + const void *mem, size_t size) +{ + struct ldb_val v; + + v.data = discard_const(mem); + v.length = size; + return sysdb_attrs_add_val(attrs, name, &v); +} + int sysdb_attrs_add_bool(struct sysdb_attrs *attrs, const char *name, bool value) { diff --git a/src/db/sysdb.h b/src/db/sysdb.h index 879196a5d..ddf531bb2 100644 --- a/src/db/sysdb.h +++ b/src/db/sysdb.h @@ -208,6 +208,8 @@ int sysdb_attrs_add_val(struct sysdb_attrs *attrs, const char *name, const struct ldb_val *val); int sysdb_attrs_add_string(struct sysdb_attrs *attrs, const char *name, const char *str); +int sysdb_attrs_add_mem(struct sysdb_attrs *, const char *, + const void *, size_t); int sysdb_attrs_add_bool(struct sysdb_attrs *attrs, const char *name, bool value); int sysdb_attrs_add_long(struct sysdb_attrs *attrs, |