X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Futils.c;h=803fb3363c8148ecbe17d769d59b534cb1afa6d4;hb=77b1882c1ae0302be8102ca115812694e4411fc5;hp=7041a713bd7caa77e15a5dff69d688691824923f;hpb=ba58cc31d8b9b4bfa07d965925c70e0ceb632e47;p=lttng-tools.git diff --git a/src/common/utils.c b/src/common/utils.c index 7041a713b..803fb3363 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -71,7 +71,7 @@ * 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; @@ -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; } @@ -1278,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; }