*base = path;
- p = strchr( path, '/' );
+ p = strchr( path, '\\' );
if ( p ) {
*p = '\0';
DEBUG(8,("pathtree_add: Enter\n"));
- if ( !path || *path != '/' ) {
+ if ( !path || *path != '\\' ) {
DEBUG(0,("pathtree_add: Attempt to add a node with a bad path [%s]\n",
path ? path : "NULL" ));
return WERR_INVALID_PARAM;
return WERR_INVALID_PARAM;
}
- /* move past the first '/' */
+ /* move past the first '\\' */
path++;
path2 = SMB_STRDUP( path );
do {
/* break off the remaining part of the path */
- str = strchr( str, '/' );
+ str = strchr( str, '\\' );
if ( str )
*str = '\0';
base = str;
if ( base ) {
- *base = '/';
+ *base = '\\';
base++;
str = base;
}
/* make a copy to play with */
- if ( *key == '/' )
+ if ( *key == '\\' )
keystr = SMB_STRDUP( key+1 );
else
keystr = SMB_STRDUP( key );
if (prefix == NULL) {
path = discard_const_p(char, keyname);
} else {
- path = talloc_asprintf(mem_ctx, "%s/%s", prefix, keyname);
+ path = talloc_asprintf(mem_ctx, "%s\\%s", prefix, keyname);
if (path == NULL) {
goto done;
}
werr = regdb_delete_values(db, keyname);
if (!W_ERROR_IS_OK(werr)) {
- DEBUG(1, (__location__ " Deleting %s/%s failed: %s\n",
+ DEBUG(1, (__location__ " Deleting %s\\%s failed: %s\n",
REG_VALUE_PREFIX, keyname, win_errstr(werr)));
goto done;
}
werr = regdb_delete_secdesc(db, keyname);
if (!W_ERROR_IS_OK(werr)) {
- DEBUG(1, (__location__ " Deleting %s/%s failed: %s\n",
+ DEBUG(1, (__location__ " Deleting %s\\%s failed: %s\n",
REG_SECDESC_PREFIX, keyname, win_errstr(werr)));
goto done;
}
* Delete a sorted subkey cache for regdb_key_exists, will be
* recreated automatically
*/
- keyname = talloc_asprintf(ctx, "%s/%s", REG_SORTED_SUBKEYS_PREFIX,
+ keyname = talloc_asprintf(ctx, "%s\\%s", REG_SORTED_SUBKEYS_PREFIX,
keyname);
if (keyname == NULL) {
werr = WERR_NOMEM;
continue;
}
- path = talloc_asprintf(mem_ctx, "%s/%s", store_ctx->key,
+ path = talloc_asprintf(mem_ctx, "%s\\%s", store_ctx->key,
oldkeyname);
if (!path) {
werr = WERR_NOMEM;
}
for (i=0; i<num_subkeys; i++) {
- path = talloc_asprintf(mem_ctx, "%s/%s", store_ctx->key,
+ path = talloc_asprintf(mem_ctx, "%s\\%s", store_ctx->key,
regsubkey_ctr_specific_key(store_ctx->ctr, i));
if (!path) {
werr = WERR_NOMEM;
goto done;
}
- path = talloc_asprintf(mem_ctx, "%s/%s", key, subkey);
+ path = talloc_asprintf(mem_ctx, "%s\\%s", key, subkey);
if (path == NULL) {
werr = WERR_NOMEM;
goto done;
/**
* check whether a given key name represents a base key,
- * i.e one without a subkey separator ('/' or '\').
+ * i.e one without a subkey separator ('\').
*/
static bool regdb_key_is_base_key(const char *key)
{
goto done;
}
- ret = (strrchr(path, '/') == NULL);
+ ret = (strrchr(path, '\\') == NULL);
done:
TALLOC_FREE(mem_ctx);
goto fail;
}
- key = talloc_asprintf(talloc_tos(), "%s/%s",
+ key = talloc_asprintf(talloc_tos(), "%s\\%s",
REG_SORTED_SUBKEYS_PREFIX, path);
if (key == NULL) {
goto fail;
goto done;
}
- p = strrchr(path, '/');
+ p = strrchr(path, '\\');
if (p == NULL) {
/* this is a base key */
value = regdb_fetch_key_internal(db, mem_ctx, path);
goto done;
}
- keystr = talloc_asprintf(ctx, "%s/%s", REG_VALUE_PREFIX, key);
+ keystr = talloc_asprintf(ctx, "%s\\%s", REG_VALUE_PREFIX, key);
if (!keystr) {
goto done;
}
SMB_ASSERT( len == data.dsize );
- keystr = talloc_asprintf(ctx, "%s/%s", REG_VALUE_PREFIX, key );
+ keystr = talloc_asprintf(ctx, "%s\\%s", REG_VALUE_PREFIX, key );
if (!keystr) {
goto done;
}
goto done;
}
- tdbkey = talloc_asprintf(tmp_ctx, "%s/%s", REG_SECDESC_PREFIX, key);
+ tdbkey = talloc_asprintf(tmp_ctx, "%s\\%s", REG_SECDESC_PREFIX, key);
if (tdbkey == NULL) {
err = WERR_NOMEM;
goto done;
goto done;
}
- tdbkey = talloc_asprintf(mem_ctx, "%s/%s", REG_SECDESC_PREFIX, key);
+ tdbkey = talloc_asprintf(mem_ctx, "%s\\%s", REG_SECDESC_PREFIX, key);
if (tdbkey == NULL) {
goto done;
}
}
/**
- * The full path to the registry key is used as database key
- * after the \'s are converted to /'s.
- * Leading and trailing '/' and '\' characters are stripped.
+ * The full path to the registry key is used as database key.
+ * Leading and trailing '\' characters are stripped.
* Key string is also normalized to UPPER case.
*/
char *p;
char *nkeyname;
- /* skip leading '/' and '\' chars */
+ /* skip leading '\' chars */
p = (char *)keyname;
- while ((*p == '/') || (*p == '\\')) {
+ while (*p == '\\') {
p++;
}
- nkeyname = talloc_string_sub(ctx, p, "\\", "/");
+ nkeyname = talloc_strdup(ctx, p);
if (nkeyname == NULL) {
return NULL;
}
- /* strip trailing '/' chars */
- p = strrchr(nkeyname, '/');
+ /* strip trailing '\' chars */
+ p = strrchr(nkeyname, '\\');
while ((p != NULL) && (p[1] == '\0')) {
*p = '\0';
- p = strrchr(nkeyname, '/');
+ p = strrchr(nkeyname, '\\');
}
strupper_m(nkeyname);
}
/* normalize_reg_path( new_path ); */
if (!(p = strchr(new_path, '\\')) ) {
- if (!(p = strchr( new_path, '/'))) {
- p = new_path;
- } else {
- p++;
- }
+ p = new_path;
} else {
p++;
}