[Samba] regpatch writing to local registry hive with -F not working (registery-utils 4.0.0~alpha15~git20110124.dfsg1-2ubuntu1)

Wilco Baan Hofman wilco at baanhofman.nl
Wed May 18 07:07:41 MDT 2011


On Wed, 2011-05-18 at 12:33 +0200, Michael Wood wrote:

> 
> Then it seems the -F option should be removed from regpatch.  Or
> should regpatch be replaced with something similar to the Python script
> you included below?

The latter would be preferable, but you'd have to be able to specify
mountpoints for the hives.

> >>---<
> > sys.path.append(samba_python_path)
> > from samba import registry
> > import samba.getopt as options
> >
> > # Open the hive
> > lp = sambaopts.get_loadparm()
> > creds = credopts.get_credentials(lp)
> > hive = registry.open_hive(hivepath, lp_ctx=lp, credentials=creds)
> 
> So "hivepath" here is the path to e.g. some user's "NTUSER.DAT"?

Indeed.

> > # Mount the hive to HKEY_CURRENT_USER
> > reg = registry.Registry()
> > reg.mount_hive(hive, registry.HKEY_CURRENT_USER)
> > reg.diff_apply(patchfile)
> >>---<

Regards,

Wilco Baan Hofman




More information about the samba mailing list