#include <inttypes.h>
#include <ctype.h>
-#include <src/common/sessiond-comm/sessiond-comm.h>
+#include <common/sessiond-comm/sessiond-comm.h>
#include <common/compat/string.h>
#include <common/string-utils/string-utils.h>
}
/* Check for symbol */
- if (isalpha(name[0])) {
+ if (isalpha(name[0]) || name[0] == '_') {
match = sscanf(opt, "%" LTTNG_SYMBOL_NAME_LEN_SCANF_IS_A_BROKEN_API "s",
name);
if (match == 1) {
/* Check for address */
match = sscanf(opt, "%" S_HEX_LEN_SCANF_IS_A_BROKEN_API "s", s_hex);
if (match > 0) {
- if (*s_hex == '\0') {
- ERR("Invalid probe address %s", s_hex);
+ /*
+ * Return an error if the first character of the tentative
+ * address is NULL or not a digit. It can be "0" if the address
+ * is in hexadecimal and can be 1 to 9 if it's in decimal.
+ */
+ if (*s_hex == '\0' || !isdigit(*s_hex)) {
+ ERR("Invalid probe description %s", s_hex);
ret = CMD_ERROR;
goto end;
}
return ret;
}
-static
-int check_exclusions_subsets(const char *event_name,
- char * const *exclusions)
-{
- int ret = 0;
- char * const *item;
-
- for (item = exclusions; *item; item++) {
- ret = check_exclusion_subsets(event_name, *item);
- if (ret) {
- goto end;
- }
- }
-
-end:
- return ret;
-}
-
static
int create_exclusion_list_and_validate(const char *event_name,
const char *exclusions_arg,
for (exclusion = exclusions; *exclusion; exclusion++) {
if (!strutils_is_star_glob_pattern(*exclusion) ||
strutils_is_star_at_the_end_only_glob_pattern(*exclusion)) {
- ret = check_exclusions_subsets(
- event_name, exclusion);
+ ret = check_exclusion_subsets(event_name, *exclusion);
if (ret) {
goto error;
}
int opt, ret = CMD_SUCCESS, command_ret = CMD_SUCCESS, success = 1;
static poptContext pc;
char *session_name = NULL;
+ const char *leftover = NULL;
int event_type = -1;
pc = poptGetContext(NULL, argc, argv, long_options, 0);
}
ret = print_missing_or_multiple_domains(
- opt_kernel + opt_userspace + opt_jul + opt_log4j + opt_python);
+ opt_kernel + opt_userspace + opt_jul + opt_log4j +
+ opt_python,
+ true);
if (ret) {
ret = CMD_ERROR;
goto end;
goto end;
}
+ leftover = poptGetArg(pc);
+ if (leftover) {
+ ERR("Unknown argument: %s", leftover);
+ ret = CMD_ERROR;
+ goto end;
+ }
+
if (!opt_session_name) {
session_name = get_session_name();
if (session_name == NULL) {