[PATCH] Error, rather than segfault on invalid attributes in replicated updates

Andrew Bartlett abartlet at samba.org
Tue Jun 4 18:04:21 MDT 2013


On Wed, 2013-06-05 at 09:53 +1000, Andrew Bartlett wrote:
> This patch causes us to error, rather than segfault (as seen in recent
> autobuilds) if we are given an attribute that can't be found in the
> local schema.
> 
> My hope is that this may assist us in finding the real bug.
> 
> Andrew Bartlett

Curiously, I seem to have added this in (but I don't recall why I made
this change):

commit d799b25dd3ed0f72ee03949225ba241c5538d7d6
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Aug 9 16:16:03 2012 +1000

    s4-dsdb: Remove strcasecmp() fallback in
replmd_ldb_message_element_attid_sort
    
    In all callers, we must already have a attributeID for each of the
    values or else we would have already given an error, or could not
have
    obtained the message over DRS.
    
    Andrew Bartlett
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu Aug  9 11:39:54 CEST 2012 on
sn-devel-104

However, what has me more curious is why we sort at all:

The sorting seems to have been added very early:

commit c84d8124b2c61e9ef5d3c43333b76009b5f79a5b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jan 23 10:21:14 2007 +0000

    r20968: - add functions to sort the meta data and attribute arrays
    - we should use them before we store records to disk
    
    metze
    (This used to be commit a5200ef0cae5e8b0cedf196c9d76afc46e08c316)

The curious thing is that in replmd_modify() and
replmd_replicated_apply_merge() we sort only the modifies being made,
not the whole record, so I don't think it is stored sorted.  It makes no
sense to me to only sort in the add case.  Should we just drop the sort?

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list