Ideas on using locking.tdb from Netatalk to implement combined share mode database

Frank Lahm franklahm at googlemail.com
Wed Feb 23 13:54:27 MST 2011


2011/2/23 Jeremy Allison <jra at samba.org>:
> On Wed, Feb 23, 2011 at 08:51:03PM +0100, Frank Lahm wrote:
>> 2011/2/23 Jeremy Allison <jra at samba.org>:
>> > On Wed, Feb 23, 2011 at 08:24:52PM +0100, Frank Lahm wrote:
>> >> 2011/2/23 Jeremy Allison <jra at samba.org>:
>> >> > On Wed, Feb 23, 2011 at 04:06:00PM +0100, Frank Lahm wrote:
>> >> >> Dear hackers,
>> >> >>
>> >> >> I'm in the process of a decent rewrite of certain Netatalk (Opensource
>> >> >> AFP filserver) subsystems. One of them is acess/deny mode subsytem
>> >> >> which is the AFP pendant to share modes in CIFS. We're currently
>> >> >> storing these as brls -- an ancient but working hack.
>> >> >>
>> >> >> I'm now about to rewrite this stuff to use a tbd database. In order to
>> >> >> have a fully spec conforming cross-platform server (Samba for Win
>> >> >> clients, Netatlak for AFP clients) it would be necessary to integrate
>> >> >> both sytems.
>> >> >>
>> >> >> So I went ahead poking around in source3, hoping I could find a way where
>> >> >> - Netatalk's afpd processes would be able to use Samba's locking.tdb
>> >> >> (if configured to do so)
>> >> >>
>> >> >> I've found "include/smb_share_modes.h" and libsmbsharemodes which look
>> >> >> promising.
>> >> >>
>> >> >> Semantic differences [1] let aside for now, could this approach work out!
>> >> >
>> >> > libsmbsharemodes was designed for exactly this purpose and used
>> >> > by the NetWare file sharing daemon code on Linux.
>> >>
>> >> Great!
>> >>
>> >> >
>> >> > Let me know if it will work for you - changes and updates
>> >> > are welcome !
>> >>
>> >> How is cleanup in case of eg a crash supposed to happen? There's no
>> >> way to go through the locks by pid, deleting any lock for which the
>> >> process is gone, is there?
>> >> Or is such cleanup builtin ?
>> >
>> > smbd has this cleanup builtin. It's not built into the libsmbsharemodes
>> > api.
>>
>> So this cleanup has to be build into afpd, but for that ideally there
>> should be an API in "smb_share_modes.h". Until that happens, any
>> pointer how I could manually do the cleanup in afpd ?
>
> You'll have to look at the Samba code. Might be worth while
> adding a "cleanup" call into the API I suppose.

It's a must have, because otherwise I'd have to bypass the abstraction
and fiddle around with the tdb directly.

Thanks!
-f


More information about the samba-technical mailing list