projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
trigger: implement is_equal
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
client.c
diff --git
a/src/bin/lttng-sessiond/client.c
b/src/bin/lttng-sessiond/client.c
index 8a2ef85b7345c33d89cd2914134bd075a71b4e9e..d7db03fa76981f38ac60b3eb9e78579c9512fa4b 100644
(file)
--- a/
src/bin/lttng-sessiond/client.c
+++ b/
src/bin/lttng-sessiond/client.c
@@
-31,6
+31,7
@@
#include <signal.h>
#include <stddef.h>
#include <sys/stat.h>
#include <signal.h>
#include <stddef.h>
#include <sys/stat.h>
+#include <unistd.h>
#include "client.h"
#include "lttng-sessiond.h"
#include "client.h"
#include "lttng-sessiond.h"
@@
-1281,9
+1282,17
@@
error_add_context:
.value_type;
struct process_attr_value *value;
enum lttng_error_code ret_code;
.value_type;
struct process_attr_value *value;
enum lttng_error_code ret_code;
+ long login_name_max;
+
+ login_name_max = sysconf(_SC_LOGIN_NAME_MAX);
+ if (login_name_max < 0) {
+ PERROR("Failed to get _SC_LOGIN_NAME_MAX system configuration");
+ ret = LTTNG_ERR_INVALID;
+ goto error;
+ }
/* Receive remaining variable length payload if applicable. */
/* Receive remaining variable length payload if applicable. */
- if (name_len >
LOGIN_NAME_MAX
) {
+ if (name_len >
login_name_max
) {
/*
* POSIX mandates user and group names that are at least
* 8 characters long. Note that although shadow-utils
/*
* POSIX mandates user and group names that are at least
* 8 characters long. Note that although shadow-utils
@@
-1291,9
+1300,9
@@
error_add_context:
* limit (from bits/utmp.h, UT_NAMESIZE),
* LOGIN_NAME_MAX is defined to 256.
*/
* limit (from bits/utmp.h, UT_NAMESIZE),
* LOGIN_NAME_MAX is defined to 256.
*/
- ERR("Rejecting process attribute tracker value %s as the provided exceeds the maximal allowed length: argument length = %zu, maximal length = %d",
+ ERR("Rejecting process attribute tracker value %s as the provided exceeds the maximal allowed length: argument length = %zu, maximal length = %
l
d",
add_value ? "addition" : "removal",
add_value ? "addition" : "removal",
- name_len,
LOGIN_NAME_MAX
);
+ name_len,
login_name_max
);
ret = LTTNG_ERR_INVALID;
goto error;
}
ret = LTTNG_ERR_INVALID;
goto error;
}
This page took
0.040582 seconds
and
4
git commands to generate.