X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Futils.c;h=02eddfae4a0c93d044aaad23c75a436ce76bf4a3;hb=aa1f1a266341650a084a96f05ebe8e2a5da2f801;hp=22fd33ea3f1a09e6fda886d242b686731adda8ae;hpb=f4fa353739da9c6fa8c851bcbc92afa51dfc295d;p=lttng-tools.git diff --git a/src/common/utils.c b/src/common/utils.c index 22fd33ea3..02eddfae4 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -300,7 +300,7 @@ int expand_double_slashes_dot_and_dotdot(char *path) * 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; } @@ -547,6 +547,7 @@ void utils_close_pipe(int *src) if (ret) { PERROR("close pipe"); } + src[i] = -1; } } @@ -1277,8 +1278,14 @@ int utils_get_group_id(const char *name, bool warn, gid_t *gid) } } 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; }