const struct statx *sx,
void *userdata) {
- _cleanup_free_ char *credname = NULL, *sub_id = NULL;
struct load_cred_args *args = ASSERT_PTR(userdata);
+ _cleanup_free_ char *sub_id = NULL;
int r;
if (event != RECURSE_DIR_ENTRY)
if (!IN_SET(de->d_type, DT_REG, DT_SOCK))
return RECURSE_DIR_CONTINUE;
- credname = strreplace(path, "/", "_");
- if (!credname)
- return -ENOMEM;
-
- sub_id = strjoin(args->parent_load_credential->id, "_", credname);
+ sub_id = strreplace(path, "/", "_");
if (!sub_id)
return -ENOMEM;
r = recurse_dir(
sub_fd,
- /* path= */ NULL,
+ /* path= */ lc->id, /* recurse_dir() will suffix the subdir paths from here to the top-level id */
/* statx_mask= */ 0,
/* n_depth_max= */ UINT_MAX,
RECURSE_DIR_IGNORE_DOT|RECURSE_DIR_ENSURE_TYPE,