[Samba] ldb transaction question

Andrew Bartlett abartlet at samba.org
Fri Feb 24 08:11:52 UTC 2023


On Fri, 2023-02-24 at 15:56 +0800, d tbsky via samba wrote:
> Hi:
>     I want to add rfc2307 attribute to machine account. I saw I can do
> it via "samba-tool computer". but I want to try if there is a simpler
> method, so I issue the command:
> 
>  ./samba-tool user addunixattrs 'machine$' 9999
> 
> and result:
> 
>  You are setting a Unix/RFC2307 UID & GID. You may want to set
> 'idmap_ldb:use rfc2307 = Yes' in smb.conf to use the attributes for
> XID/SID-mapping.
> ERROR: Failed to modify user 'machine$': (21, "objectclass_attrs:
> attribute 'gidnumber' on entry
> 'CN=MACHINE,OU=Workstation,OU=PC,DC=ad,DC=samdom,DC=com, contains at
> least one invalid value!")
> A transaction is still active in ldb context [0x56268385f090] on
> tdb:///usr/local/samba/private/sam.ldb
> 
> I don't mind the command failed. but last line worried me. should I do
> something to revert the ldb transaction or even restore my samba
> backup?
> is that message safe to ignore?

What this means is that at the next open of that LDB for writes (if I
recall correctly) the incomplete transaction will be removed from the
journal, and no evidence of the failed command above will be present.

It is a coding error on Samba's part not to cancel the transaction
before returning from the tool, but not a dangerous one.

Andrew Bartlett
-- 
Andrew Bartlett (he/him)        https://samba.org/~abartlet/
Samba Team Member (since 2001)  https://samba.org
Samba Developer, Catalyst IT    https://catalyst.net.nz/services/samba




More information about the samba mailing list