Solving: samba registry with client programs

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Apr 24 12:13:47 MDT 2012


On Wed, Apr 18, 2012 at 06:23:34PM +0200, Stef Walter wrote:
> On 04/17/2012 10:14 PM, Volker Lendecke wrote:
> > On Tue, Apr 17, 2012 at 03:08:35PM -0400, simo wrote:
> >> Stef, FWIW, you do not need to code up a new daemon, running smbd would
> >> suffice as it provides access to the registry RPC enpoint over NCACN_NP
> >> or the new NCALRPC. But you would need to write some client logic to do
> >> that and you would require smbd running.
> > 
> > We've also had repeated requests for an lgpl library to
> > access samba's registry. Doing it via some form of RPC would
> > IMHO be the right way to do it. Simo is right, smbd already
> > supports registry access. It should be simple to add a
> > unix-domain socket only mode for smbd, just to access the
> > registry. The major piece that's missing is the NDR support
> > library required to do the RPC marshalling. That's only
> > available as GPL code.
> 
> Until someone has time to implement that, attached is a patch which
> implements the registry mirroring suggested.
> 
> It mirrors the global settings of the smbconf registry to a file next to
> registry.tdb called registry-mirror.conf. This is seamlessly used when
> running from an smbclient that is not root.
> 
> What do you think?

Ok, now that we settled the details, I have some comments:
First, I think we could do with a talloc_stackframe()
instead of talloc_new(NULL). Then, I think you could speed
up the code by doing a talloc_strdup() on the header, and
then in the loop do a talloc_asprintf_append_buffer. Then
you can write the whole thing in one bunch.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba-technical mailing list