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@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@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 It looks like an easy fix, but just not for me. Hope someone can fix this. I can use manually compiled samba so a patch would enough for now. Best Regards, Peter