On 14 May 2011 19:53, RiCH <r...@richud.com> wrote:
> Hi,
>
> I was hoping I could modify a locally mounted registry hive using
> regpatch and a .reg file but the -F argument seems to have no function.

Try this patch (untested, but based on what regtree does).  I haven't
looked at the other issues you mention, though.

> (Strace shows it ignores it and just operates
> on /var/lib/samba/private/hklm.ldb)
> Below is output with debug on.
>
> rfm6@ubuntuSSDx64:cp /mnt/xp/WINDOWS/system32/config/software /tmp/software
> rfm6@ubuntuSSDx64:/tmp/config$ sudo regpatch -d=10 -F software
> RunOnceSoftware.reg
> lpcfg_load: refreshing parameters from /etc/samba/smb.conf
> params.c:pm_process() - Processing configuration file
> "/etc/samba/smb.conf"
> Processing section "[global]"
> Unknown parameter encountered: "max log size"
> Ignoring unknown parameter "max log size"
> Unknown parameter encountered: "syslog"
> Ignoring unknown parameter "syslog"
> Unknown parameter encountered: "passdb backend"
> Ignoring unknown parameter "passdb backend"
> Unknown parameter encountered: "unix password sync"
> Ignoring unknown parameter "unix password sync"
> Unknown parameter encountered: "passwd program"
> Ignoring unknown parameter "passwd program"
> Unknown parameter encountered: "pam password change"
> Ignoring unknown parameter "pam password change"
> Unknown parameter encountered: "map to guest"
> Ignoring unknown parameter "map to guest"
> Unknown parameter encountered: "usershare allow guests"
> Ignoring unknown parameter "usershare allow guests"
> Processing section "[printers]"
> Unknown parameter encountered: "guest ok"
> Ignoring unknown parameter "guest ok"
> Processing section "[print$]"
> Unknown parameter encountered: "guest ok"
> Ignoring unknown parameter "guest ok"
> pm_process() returned Yes
> ldb: ldb_trace_request: SEARCH
>  dn: @MODULES
>  scope: base
>  expr: (@LIST=*)
>  attr: @LIST
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->search
> ldb: no modules required by the db
> ldb: No modules specified for this database
> ldb: ldb_trace_request: REGISTER_CONTROL
> 1.2.840.113556.1.4.1413
>  control: <NONE>
>
> ldb: ldb_trace_request: SEARCH
>  dn: <rootDSE>
>  scope: base
>  expr: (objectClass=*)
>  attr: rootDomainNamingContext
>  attr: configurationNamingContext
>  attr: schemaNamingContext
>  attr: defaultNamingContext
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->search
> ldb_wrap open of /var/lib/samba/private/hklm.ldb
> ldb: start ldb transaction (nesting: 0)
> ldb: ldb_trace_request: (tdb)->start_transaction
> ldb: start ldb transaction error: (null)
> ldb: ldb_trace_request: ADD
> dn: @ATTRIBUTES
> changetype: add
> key: CASE_INSENSITIVE
> value: CASE_INSENSITIVE
>
>
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->add
> ldb: ldb_trace_request: (tdb)->prepare_commit
> ldb: commit ldb transaction (nesting: 0)
> ldb: ldb_trace_request: (tdb)->end_transaction
> ldb: ldb_trace_request: SEARCH
>  dn: @MODULES
>  scope: base
>  expr: (@LIST=*)
>  attr: @LIST
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->search
> ldb: no modules required by the db
> ldb: No modules specified for this database
> ldb: ldb_trace_request: REGISTER_CONTROL
> 1.2.840.113556.1.4.1413
>  control: <NONE>
>
> ldb: ldb_trace_request: SEARCH
>  dn: <rootDSE>
>  scope: base
>  expr: (objectClass=*)
>  attr: rootDomainNamingContext
>  attr: configurationNamingContext
>  attr: schemaNamingContext
>  attr: defaultNamingContext
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->search
> ldb_wrap open of /var/lib/samba/private/hkcr.ldb
> ldb: start ldb transaction (nesting: 0)
> ldb: ldb_trace_request: (tdb)->start_transaction
> ldb: start ldb transaction error: (null)
> ldb: ldb_trace_request: ADD
> dn: @ATTRIBUTES
> changetype: add
> key: CASE_INSENSITIVE
> value: CASE_INSENSITIVE
>
>
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->add
> ldb: ldb_trace_request: (tdb)->prepare_commit
> ldb: commit ldb transaction (nesting: 0)
> ldb: ldb_trace_request: (tdb)->end_transaction
> ldb: ldb_trace_request: SEARCH
>  dn: @MODULES
>  scope: base
>  expr: (@LIST=*)
>  attr: @LIST
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->search
> ldb: no modules required by the db
> ldb: No modules specified for this database
> ldb: ldb_trace_request: REGISTER_CONTROL
> 1.2.840.113556.1.4.1413
>  control: <NONE>
>
> ldb: ldb_trace_request: SEARCH
>  dn: <rootDSE>
>  scope: base
>  expr: (objectClass=*)
>  attr: rootDomainNamingContext
>  attr: configurationNamingContext
>  attr: schemaNamingContext
>  attr: defaultNamingContext
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->search
> ldb_wrap open of /var/lib/samba/private/hkcu.ldb
> ldb: start ldb transaction (nesting: 0)
> ldb: ldb_trace_request: (tdb)->start_transaction
> ldb: start ldb transaction error: (null)
> ldb: ldb_trace_request: ADD
> dn: @ATTRIBUTES
> changetype: add
> key: CASE_INSENSITIVE
> value: CASE_INSENSITIVE
>
>
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->add
> ldb: ldb_trace_request: (tdb)->prepare_commit
> ldb: commit ldb transaction (nesting: 0)
> ldb: ldb_trace_request: (tdb)->end_transaction
> ldb: ldb_trace_request: SEARCH
>  dn: @MODULES
>  scope: base
>  expr: (@LIST=*)
>  attr: @LIST
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->search
> ldb: no modules required by the db
> ldb: No modules specified for this database
> ldb: ldb_trace_request: REGISTER_CONTROL
> 1.2.840.113556.1.4.1413
>  control: <NONE>
>
> ldb: ldb_trace_request: SEARCH
>  dn: <rootDSE>
>  scope: base
>  expr: (objectClass=*)
>  attr: rootDomainNamingContext
>  attr: configurationNamingContext
>  attr: schemaNamingContext
>  attr: defaultNamingContext
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->search
> ldb_wrap open of /var/lib/samba/private/hku.ldb
> ldb: start ldb transaction (nesting: 0)
> ldb: ldb_trace_request: (tdb)->start_transaction
> ldb: start ldb transaction error: (null)
> ldb: ldb_trace_request: ADD
> dn: @ATTRIBUTES
> changetype: add
> key: CASE_INSENSITIVE
> value: CASE_INSENSITIVE
>
>
>  control: <NONE>
>
> ldb: ldb_trace_request: (tdb)->add
> ldb: ldb_trace_request: (tdb)->prepare_commit
> ldb: commit ldb transaction (nesting: 0)
> ldb: ldb_trace_request: (tdb)->end_transaction
> Key 'key=SOFTWARE,hive=NONE' not found
> key added: key=SOFTWARE,hive=NONE
> Key 'key=Microsoft,key=SOFTWARE,hive=NONE' not found
> key added: key=Microsoft,key=SOFTWARE,hive=NONE
> Key 'key=Windows NT,key=Microsoft,key=SOFTWARE,hive=NONE' not found
> key added: key=Windows NT,key=Microsoft,key=SOFTWARE,hive=NONE
> Key 'key=CurrentVersion,key=Windows
> NT,key=Microsoft,key=SOFTWARE,hive=NONE' not found
> key added: key=CurrentVersion,key=Windows
> NT,key=Microsoft,key=SOFTWARE,hive=NONE
> Key 'key=Winlogon,key=CurrentVersion,key=Windows
> NT,key=Microsoft,key=SOFTWARE,hive=NONE' not found
> key added: key=Winlogon,key=CurrentVersion,key=Windows
> NT,key=Microsoft,key=SOFTWARE,hive=NONE
> About to write LegalNoticeCaption with type (null), length 0:
> About to write LegalNoticeText with type (null), length 0:
> About to write allocatecdroms with type (null), length 1: 1
> About to write AutoAdminLogon with type (null), length 1: 1
>
> regdiff also seems to ignore any .reg files passed to it.
> conversely regtree and regshell both seem to work fine operating on a
> local hive though. (actually regtree borks reading the software hive but
> is ok on others)
>
> The man pages elude to it being able to do this so is it me being thick
> or is it not meant to work?
> http://manpages.ubuntu.com/manpages/natty/en/man1/regpatch.1.html
>
> I am using 4.0.0~alpha15~git20110124.dfsg1-2ubuntu1
>
> Regards
>
> Rich

-- 
Michael Wood <esiot...@gmail.com>
From 16dd88ae48ea3e5b5d765e3fe1383b68747fef65 Mon Sep 17 00:00:00 2001
From: Michael Wood <esiot...@gmail.com>
Date: Sat, 14 May 2011 22:04:37 +0200
Subject: [PATCH] regpatch: Don't ignore the -F option.

---
 source4/lib/registry/tools/regpatch.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c
index a8c1843..c45eaf3 100644
--- a/source4/lib/registry/tools/regpatch.c
+++ b/source4/lib/registry/tools/regpatch.c
@@ -53,6 +53,8 @@ int main(int argc, char **argv)
 
 	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);
 	}
-- 
1.7.0

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba

Reply via email to