projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: unchecked buffer size for communication header
[lttng-tools.git]
/
src
/
common
/
utils.c
diff --git
a/src/common/utils.c
b/src/common/utils.c
index a068e410b4bf26800d38e5807a0fb06c884f70d6..bd61fff3d52ad8c6c16d68b0ca9e195009225018 100644
(file)
--- a/
src/common/utils.c
+++ b/
src/common/utils.c
@@
-294,7
+294,7
@@
int expand_double_slashes_dot_and_dotdot(char *path)
* Copy the current token which is neither a '.' nor a '..'.
*/
path[expanded_path_len++] = '/';
* Copy the current token which is neither a '.' nor a '..'.
*/
path[expanded_path_len++] = '/';
- mem
cpy
(&path[expanded_path_len], curr_char, curr_token_len);
+ mem
move
(&path[expanded_path_len], curr_char, curr_token_len);
expanded_path_len += curr_token_len;
}
expanded_path_len += curr_token_len;
}
@@
-679,8
+679,8
@@
int utils_mkdir(const char *path, mode_t mode, int uid, int gid)
int ret;
struct lttng_directory_handle *handle;
const struct lttng_credentials creds = {
int ret;
struct lttng_directory_handle *handle;
const struct lttng_credentials creds = {
- .uid =
(uid_t) uid
,
- .gid =
(gid_t) gid
,
+ .uid =
LTTNG_OPTIONAL_INIT_VALUE(uid)
,
+ .gid =
LTTNG_OPTIONAL_INIT_VALUE(gid)
,
};
handle = lttng_directory_handle_create(NULL);
};
handle = lttng_directory_handle_create(NULL);
@@
-708,8
+708,8
@@
int utils_mkdir_recursive(const char *path, mode_t mode, int uid, int gid)
int ret;
struct lttng_directory_handle *handle;
const struct lttng_credentials creds = {
int ret;
struct lttng_directory_handle *handle;
const struct lttng_credentials creds = {
- .uid =
(uid_t) uid
,
- .gid =
(gid_t) gid
,
+ .uid =
LTTNG_OPTIONAL_INIT_VALUE(uid)
,
+ .gid =
LTTNG_OPTIONAL_INIT_VALUE(gid)
,
};
handle = lttng_directory_handle_create(NULL);
};
handle = lttng_directory_handle_create(NULL);
@@
-1274,8
+1274,14
@@
int utils_get_group_id(const char *name, bool warn, gid_t *gid)
}
}
if (ret) {
}
}
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;
}
ret = -1;
goto error;
}
This page took
0.024404 seconds
and
4
git commands to generate.