mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
dbwrap_rbt: support TDB_INSERT and TDB_MODIFY store flags
These flags provide insert-new and overwrite-existing record semantics respectively. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
f501881a1c
commit
c5b10466c3
@ -138,6 +138,14 @@ static NTSTATUS db_rbt_storev(struct db_record *rec,
|
||||
return NT_STATUS_MEDIA_WRITE_PROTECTED;
|
||||
}
|
||||
|
||||
if ((flag == TDB_INSERT) && (rec_priv->node != NULL)) {
|
||||
return NT_STATUS_OBJECT_NAME_COLLISION;
|
||||
}
|
||||
|
||||
if ((flag == TDB_MODIFY) && (rec_priv->node == NULL)) {
|
||||
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (num_dbufs == 1) {
|
||||
data = dbufs[0];
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user