tools to read/write registry files
Jelmer Vernooij
jelmer at vernstok.nl
Mon Jan 15 13:19:37 GMT 2007
Hi Ingo,
On Mon, 2007-01-15 at 13:48 +0100, Ingo Steuwer wrote:
> I'm looking for tools to read and write windows registry files (.reg or .pol)
> under Linux.
>
> I first tried "editreg" in 3.0.10 which was removed in 3.0.14. It seems to
> meet my needs, but has no write support. The changelog says
>
> * Remove editreg utility (needs to be rewritten using regfio.c).
>
> Is a new Tool with similar fuctionality planed or already somewhere in SVN?
I'm not sure if there are any plans for that in Samba 3. Jerry would know more about that.
> regfio.c contains several write-routines, do you consider write-access
> to .reg-files (add, modify and delete keys) stable?
>
> Is the included tool "profiles" a good example to start working with regfio,
> or are there better/newer ones or other documentation?
>
> I also tried the registry tools coming with samba4, a SVN-Snapshot from friday
> delivers various errors (see below). I found no documentation for this tools
> so far, is it true that they access a registry remote using rpc and can't
> open .reg-files?
These tools only work without arguments if you have a configured Samba 4 installation. Without such an
installation, you should be able to use them for individual hives or
non-local registries. Admittedly, the default error messages could be
improved :-)
Example commands that should work:
regshell -b nt4 NTUSER.DAT (browse existing NTUSER.DAT file)
regshell -b nt4 NTConfig.pol (browse NTConfig policy file)
regpatch -R ncacn_ip_tcp:192.168.4.1 < foo.reg (apply .reg patch file to
remote hosts registry)
Coincidentally, Wilco Baan Hofman and I have been working on write
support for nt4 (regf) registries, which is almost done now.
Cheers,
Jelmer
> stbase:~# regshell
> unable to load tdb
> from /usr/local/samba/modules/ldb/tdb.so: /usr/local/samba/modules/ldb/tdb.so:
> cannot open shared object file: No such file or directory
> Unable to find backend for '/usr/local/samba/private/hklm.ldb'
> unable to load tdb
> from /usr/local/samba/modules/ldb/tdb.so: /usr/local/samba/modules/ldb/tdb.so:
> cannot open shared object file: No such file or directory
> Unable to find backend for '/usr/local/samba/private/hku.ldb'
> Unable to access any of the predefined keys
>
> stbase:~# regdiff
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> INTERNAL ERROR: Signal 11 in pid 11856 (4.0.0tp4-SVN-build-UNKNOWN)
> Please read the file BUGS.txt in the distribution
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> PANIC: internal error
> BACKTRACE: 9 stack frames:
> #0 regdiff(call_backtrace+0x2b) [0x83ec2b3]
> #1 regdiff(smb_panic+0x21c) [0x83ec5a9]
> #2 regdiff [0x83ec6f7]
> #3 regdiff [0x83ec72b]
> #4 [0xb7f0a420]
> #5 regdiff(reg_generate_diff+0x67) [0x80971c5]
> #6 regdiff(main+0x474) [0x808fa48]
> #7 /lib/tls/libc.so.6(__libc_start_main+0xf4) [0xb7da3974]
> #8 regdiff [0x808f531]
> Abgebrochen
>
> stbase:~# regtree
> Skipping HKEY_CLASSES_ROOT
> Skipping HKEY_CURRENT_USER
> unable to load tdb
> from /usr/local/samba/modules/ldb/tdb.so: /usr/local/samba/modules/ldb/tdb.so:
> cannot open shared object file: No such file or directory
> Unable to find backend for '/usr/local/samba/private/hklm.ldb'
> Skipping HKEY_LOCAL_MACHINE
> Skipping HKEY_PERFORMANCE_DATA
> unable to load tdb
> from /usr/local/samba/modules/ldb/tdb.so: /usr/local/samba/modules/ldb/tdb.so:
> cannot open shared object file: No such file or directory
> Unable to find backend for '/usr/local/samba/private/hku.ldb'
> Skipping HKEY_USERS
> Skipping HKEY_CURRENT_CONFIG
> Skipping HKEY_DYN_DATA
> Skipping HKEY_PERFORMANCE_TEXT
> Skipping HKEY_PERFORMANCE_NLSTEXT
>
> stbase:~# regpatch
> Error: WERR_OK
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20070115/d3036f2a/attachment.bin
More information about the samba-technical
mailing list