Re: [Samba] regpatch writing to local registry hive with -F not working (registery-utils 4.0.0~alpha15~git20110124.dfsg1-2ubuntu1)
Wilco Baan Hofman a écrit : On Wed, 2011-05-18 at 16:01 +0200, denis bonnenfant wrote: Le mercredi 18 mai 2011 à 15:07 +0200, Wilco Baan Hofman a écrit : 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? My patch adds a -K option to regpatch for specifying the predef key where -F registry should be mounted. I will submit it for review soon, I'm currently experimenting a little bit, and there are still some bugs in .reg parsing In fact it doesn't make sense to mount regf files to anything but HKCU , so -K option is not necessary, and HKCU can be hardcoded as mountpoint for files specified by -F option. I use this quite a bit and I'm aware of two bugs, which is not directly related to the parsing, but that on windows unicode is implicit for certain data types even when the data is given in binary format, it's still converted. The other 'bug' is that unicode .reg files are not yet supported. I'd be very interested to know what other bugs there are. I found some problems with value deletion, sometimes values are not deleted, reg_expand_sz data not correctly saved, but i'm not sure that the problem is in parsing. I'm going to experiment a little bit more. Denis -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
[Samba] regpatch problem ?
Hi, 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, cmdline_credentials); +} else if (file != NULL) { + start_key = reg_common_open_file(file, ev_ctx, cmdline_lp_ctx, cmdline_credentials); } else { h = reg_common_open_local (cmdline_credentials, ev_ctx, cmdline_lp_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, Denis -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba