* to specify the size of the resolved_path argument if given, or the size to
* allocate.
*/
-LTTNG_HIDDEN
+static
char *utils_partial_realpath(const char *path, char *resolved_path, size_t size)
{
char *cut_path = NULL, *try_path = NULL, *try_path_prev = NULL;
* Copy the current token which is neither a '.' nor a '..'.
*/
path[expanded_path_len++] = '/';
- memcpy(&path[expanded_path_len], curr_char, curr_token_len);
+ memmove(&path[expanded_path_len], curr_char, curr_token_len);
expanded_path_len += curr_token_len;
}
if (ret) {
PERROR("close pipe");
}
+ src[i] = -1;
}
}
}
}
if (ret) {
- PERROR("Failed to get group file entry for group name \"%s\"",
- name);
+ if (ret == ESRCH) {
+ DBG("Could not find group file entry for group name '%s'",
+ name);
+ } else {
+ PERROR("Failed to get group file entry for group name '%s'",
+ name);
+ }
+
ret = -1;
goto error;
}