[Samba] Problem with registry tools in samba

Peter Gerritsen peter at etict.nl
Sun Sep 11 12:36:01 UTC 2022


Hi Y'all,

I've found a problem that seems to exist in all registry tools. No 
matter which tool you use when adding a key or setting a value an error 
shows up: "error lseeking in regf file". Happens with Regshell but also 
when using python bindings. I've checked with versions ranging from 
prebuild packages atleast from 4.12 until the latest 4.18git1 manually 
compiled. The problem seems to be in regf.c, specifically in the 
regf_save_hbin function. I've have tried finding a solution myself but I 
ain't that great at C and filehandling. Looks to me that the file 
descripter is already closed or something.

root at builder:/usr/src/samba# /usr/local/samba/bin/regshell -F SECURITY
DEBUG LEVEL 10:
pm_process() returned Yes
Attempting to load registry file
9 HBIN blocks read
\> mkkey Test
Subkeys in LH list
Found free block of size 104 (needing 88) in middle of HBIN
Storing key Test
Error lseeking in regf file
Open/Creation of key Test failed: WERR_GEN_FAILURE
Error adding new subkey 'Test': WERR_GEN_FAILURE

After adding the printing of the error code to the source and 
recompiling I get:

root at builder:/usr/src/samba# /usr/local/samba/bin/regshell -F SECURITY
DEBUG LEVEL 10:
pm_process() returned Yes
Attempting to load registry file
9 HBIN blocks read
\> mkkey Test
Subkeys in LH list
Found free block of size 104 (needing 88) in middle of HBIN
Storing key Test
Error lseeking in regf file: 9, Bad file descriptor
Open/Creation of key Test failed: WERR_GEN_FAILURE
Error adding new subkey 'Test': WERR_GEN_FAILURE

I do have some very old 32bit versions of regshell (4.0.0alpha12 and 
alpha18) compiled ages ago, they work perfectly on the same file...

Hope some can help to get this fixed.

Best regards,
Peter


More information about the samba mailing list