[Samba] regpatch problem ?

denis.bonnenfant denis.bonnenfant at diderot.org
Mon Mar 23 14:29:25 GMT 2009


I'm trying to use the samba4 registry tools for server-side editing of 
HKCU (ntuser.dat) on a Debian Etch samba 3 server.
I was very pleased to see that backporting Debian experimental's samba4 
package was very easy, so now I have a backported-to-Etch registry-tools 
package to start experiments :

- regshell -F ntuser.dat works, one can manually add, remove, modify 
keys and values. But this is not really suitable for batch process

- regtree -F ntuser.dat works too,

- regpatch -F ntuser.dat  patch.reg doesn't load the ntuser.dat (I 
verified with strace, it is not opened ).  It looks like the -F option 
is silentely ignored . The .reg file is correctly parsed.

Did I missed something ? 

It looks like the file option is not used, so regpatch defaults to local 
registry,  wich doesn't exists, as i'm using regpatch standalone

What about something like that  ?

    if (remote) {
        h = reg_common_open_remote (remote, ev_ctx, cmdline_lp_ctx, 
+    } else if (file != NULL) {
+       start_key = reg_common_open_file(file, ev_ctx, cmdline_lp_ctx, 
    } else {
        h = reg_common_open_local (cmdline_credentials, ev_ctx, 

But the problem is that start_key is a reg_key struct, and 
reg_diff_apply needs a reg_context struct, so start_key has to be 
"mounted" over a predefined key, passed by the user ? maybe by an option 
:  -K, for example :

regpatch -F ntuser.dat -K HKEY_CURRENT_USER patch.reg

Thanks for your comments, ideas,


More information about the samba mailing list