When Windows initially creates a new value, the value name is "New Value #1".
authorAndrew Kroeger <andrew@sprocks.gotdns.com>
Fri, 18 Jan 2008 00:50:33 +0000 (01:50 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 18 Jan 2008 02:41:59 +0000 (03:41 +0100)
commit94fb39cfd967455ce5a554720c1c7e6183f91056
treec154509acd68ef935e73308b839245950cb98825
parent0ed6f1b1628da5b922f02a5f9a6c60071b6277f2
When Windows initially creates a new value, the value name is "New Value #1".
The '#' character was causing problems, as it was not being escaped for the dn,
but the failure returned by ldb_dn_add_child_fmt() was not being caught.  This
was causing the new value to be added on the parent key, not the current key.
When attempting to delete the new value (now on the parent key) the same
escaping error was returned by ldb_dn_add_child_fmt(), causing the delete to
delete the key and not the value.

When attempting to rename a value, Windows first tries to ensure the new name
does not already exist.  When a value does not exist, Windows expects a return
value of WERR_BADFILE, but WERR_NOT_FOUND was being returned instead.
Providing the WERR_BADFILE that Windows expects allows values to be renamed.
source/lib/registry/ldb.c
source/rpc_server/winreg/rpc_winreg.c