[PATCH] s4:samdb: respect SEARCH_FLAG_PRESERVEONDELETE

David Disseldorp ddiss at suse.de
Tue Feb 4 15:47:37 MST 2014


On Wed, 05 Feb 2014 11:37:45 +1300
Andrew Bartlett <abartlet at samba.org> wrote:

> On Mon, 2014-02-03 at 19:33 +0100, Arvid Requate wrote:
> > According to MS-ADTS section 3.1.1.5.5.1.1 the searchFlags must be
> > checked.
> > ---
> >  source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
> > index ddbff8b..4518c32 100644
> > --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
> > +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
> > @@ -3226,8 +3226,13 @@ static int replmd_delete_internals(struct ldb_module *module, struct ldb_request
> >  				*/
> >  				continue;
> >  			}
> > -			if (!sa->linkID && ldb_attr_in_list(preserved_attrs, el->name)) {
> > -				continue;
> > +			if (!sa->linkID) {
> > +				if (ldb_attr_in_list(preserved_attrs, el->name)) {
> > +					continue;
> > +				}
> > +				if (sa->searchFlags & SEARCH_FLAG_PRESERVEONDELETE) {
> > +					continue;
> > +				}
> >  			}
> >  			ret = ldb_msg_add_empty(msg, el->name, LDB_FLAG_MOD_DELETE, &el);
> >  			if (ret != LDB_SUCCESS) {
> 
> This looks reasonable.  
> 
> Reviewed-by: Andrew Bartlett <abartlet at samba.org>
> 
> Can I get a second Team reviewer please?

Reviewed-by: David Disseldorp <ddiss at samba.org>
LGTM. @Arvid, please add your Signed-off-by tag[1] to the commit and
re-post.

Cheers, David

1: http://www.samba.org/samba/devel/copyright-policy.html


More information about the samba-technical mailing list