Compare commits
No commits in common. "d423294394a411a3fe98884993f9c1686edffb1b" and "e7d5fe17db9d046b364f933c4dcdd145f47b024a" have entirely different histories.
d423294394
...
e7d5fe17db
|
@ -411,9 +411,6 @@ add_project_arguments(cc.get_supported_arguments(basic_disabled_warnings), langu
|
||||||
add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
|
add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
|
||||||
add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c')
|
add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c')
|
||||||
|
|
||||||
have = cc.has_argument('-Wzero-length-bounds')
|
|
||||||
conf.set10('HAVE_ZERO_LENGTH_BOUNDS', have)
|
|
||||||
|
|
||||||
if cc.compiles('''
|
if cc.compiles('''
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
|
@ -223,10 +223,11 @@ static void path_spec_mkdir(PathSpec *s, mode_t mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void path_spec_dump(PathSpec *s, FILE *f, const char *prefix) {
|
static void path_spec_dump(PathSpec *s, FILE *f, const char *prefix) {
|
||||||
const char *type;
|
fprintf(f,
|
||||||
|
"%s%s: %s\n",
|
||||||
assert_se(type = path_type_to_string(s->type));
|
prefix,
|
||||||
fprintf(f, "%s%s: %s\n", prefix, type, s->path);
|
path_type_to_string(s->type),
|
||||||
|
s->path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void path_spec_done(PathSpec *s) {
|
void path_spec_done(PathSpec *s) {
|
||||||
|
@ -606,16 +607,14 @@ static int path_serialize(Unit *u, FILE *f, FDSet *fds) {
|
||||||
(void) serialize_item(f, "result", path_result_to_string(p->result));
|
(void) serialize_item(f, "result", path_result_to_string(p->result));
|
||||||
|
|
||||||
LIST_FOREACH(spec, s, p->specs) {
|
LIST_FOREACH(spec, s, p->specs) {
|
||||||
const char *type;
|
|
||||||
_cleanup_free_ char *escaped = NULL;
|
_cleanup_free_ char *escaped = NULL;
|
||||||
|
|
||||||
escaped = cescape(s->path);
|
escaped = cescape(s->path);
|
||||||
if (!escaped)
|
if (!escaped)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
assert_se(type = path_type_to_string(s->type));
|
|
||||||
(void) serialize_item_format(f, "path-spec", "%s %i %s",
|
(void) serialize_item_format(f, "path-spec", "%s %i %s",
|
||||||
type,
|
path_type_to_string(s->type),
|
||||||
s->previous_exists,
|
s->previous_exists,
|
||||||
s->path);
|
s->path);
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,10 +250,8 @@ static int handle_generic_user_record_error(
|
||||||
|
|
||||||
if (strv_isempty(secret->password))
|
if (strv_isempty(secret->password))
|
||||||
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Password: ");
|
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Password: ");
|
||||||
else {
|
else
|
||||||
(void) pam_prompt(handle, PAM_ERROR_MSG, NULL, "Password incorrect or not sufficient for authentication of user %s.", user_name);
|
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Password incorrect or not sufficient for authentication of user %s, please try again: ", user_name);
|
||||||
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Sorry, try again: ");
|
|
||||||
}
|
|
||||||
if (r != PAM_SUCCESS)
|
if (r != PAM_SUCCESS)
|
||||||
return PAM_CONV_ERR; /* no logging here */
|
return PAM_CONV_ERR; /* no logging here */
|
||||||
|
|
||||||
|
@ -271,13 +269,10 @@ static int handle_generic_user_record_error(
|
||||||
} else if (sd_bus_error_has_name(error, BUS_ERROR_BAD_PASSWORD_AND_NO_TOKEN)) {
|
} else if (sd_bus_error_has_name(error, BUS_ERROR_BAD_PASSWORD_AND_NO_TOKEN)) {
|
||||||
_cleanup_(erase_and_freep) char *newp = NULL;
|
_cleanup_(erase_and_freep) char *newp = NULL;
|
||||||
|
|
||||||
if (strv_isempty(secret->password)) {
|
if (strv_isempty(secret->password))
|
||||||
(void) pam_prompt(handle, PAM_ERROR_MSG, NULL, "Security token of user %s not inserted.", user_name);
|
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Security token of user %s not inserted, please enter password: ", user_name);
|
||||||
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Try again with password: ");
|
else
|
||||||
} else {
|
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Password incorrect or not sufficient, and configured security token of user %s not inserted, please enter password: ", user_name);
|
||||||
(void) pam_prompt(handle, PAM_ERROR_MSG, NULL, "Password incorrect or not sufficient, and configured security token of user %s not inserted.", user_name);
|
|
||||||
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Try again with password: ");
|
|
||||||
}
|
|
||||||
if (r != PAM_SUCCESS)
|
if (r != PAM_SUCCESS)
|
||||||
return PAM_CONV_ERR; /* no logging here */
|
return PAM_CONV_ERR; /* no logging here */
|
||||||
|
|
||||||
|
@ -295,7 +290,7 @@ static int handle_generic_user_record_error(
|
||||||
} else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_PIN_NEEDED)) {
|
} else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_PIN_NEEDED)) {
|
||||||
_cleanup_(erase_and_freep) char *newp = NULL;
|
_cleanup_(erase_and_freep) char *newp = NULL;
|
||||||
|
|
||||||
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Security token PIN: ");
|
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Please enter security token PIN: ");
|
||||||
if (r != PAM_SUCCESS)
|
if (r != PAM_SUCCESS)
|
||||||
return PAM_CONV_ERR; /* no logging here */
|
return PAM_CONV_ERR; /* no logging here */
|
||||||
|
|
||||||
|
@ -323,8 +318,7 @@ static int handle_generic_user_record_error(
|
||||||
} else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_BAD_PIN)) {
|
} else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_BAD_PIN)) {
|
||||||
_cleanup_(erase_and_freep) char *newp = NULL;
|
_cleanup_(erase_and_freep) char *newp = NULL;
|
||||||
|
|
||||||
(void) pam_prompt(handle, PAM_ERROR_MSG, NULL, "Security token PIN incorrect for user %s.", user_name);
|
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Security token PIN incorrect, please enter PIN for security token of user %s again: ", user_name);
|
||||||
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Sorry, retry security token PIN: ");
|
|
||||||
if (r != PAM_SUCCESS)
|
if (r != PAM_SUCCESS)
|
||||||
return PAM_CONV_ERR; /* no logging here */
|
return PAM_CONV_ERR; /* no logging here */
|
||||||
|
|
||||||
|
@ -342,8 +336,7 @@ static int handle_generic_user_record_error(
|
||||||
} else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_BAD_PIN_FEW_TRIES_LEFT)) {
|
} else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_BAD_PIN_FEW_TRIES_LEFT)) {
|
||||||
_cleanup_(erase_and_freep) char *newp = NULL;
|
_cleanup_(erase_and_freep) char *newp = NULL;
|
||||||
|
|
||||||
(void) pam_prompt(handle, PAM_ERROR_MSG, NULL, "Security token PIN of user %s incorrect (only a few tries left!)", user_name);
|
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Security token PIN incorrect (only a few tries left!), please enter PIN for security token of user %s again: ", user_name);
|
||||||
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Sorry, retry security token PIN: ");
|
|
||||||
if (r != PAM_SUCCESS)
|
if (r != PAM_SUCCESS)
|
||||||
return PAM_CONV_ERR; /* no logging here */
|
return PAM_CONV_ERR; /* no logging here */
|
||||||
|
|
||||||
|
@ -361,8 +354,7 @@ static int handle_generic_user_record_error(
|
||||||
} else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_BAD_PIN_ONE_TRY_LEFT)) {
|
} else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_BAD_PIN_ONE_TRY_LEFT)) {
|
||||||
_cleanup_(erase_and_freep) char *newp = NULL;
|
_cleanup_(erase_and_freep) char *newp = NULL;
|
||||||
|
|
||||||
(void) pam_prompt(handle, PAM_ERROR_MSG, NULL, "Security token PIN of user %s incorrect (only one try left!)", user_name);
|
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Security token PIN incorrect (only one try left!), please enter PIN for security token of user %s again: ", user_name);
|
||||||
r = pam_prompt(handle, PAM_PROMPT_ECHO_OFF, &newp, "Sorry, retry security token PIN: ");
|
|
||||||
if (r != PAM_SUCCESS)
|
if (r != PAM_SUCCESS)
|
||||||
return PAM_CONV_ERR; /* no logging here */
|
return PAM_CONV_ERR; /* no logging here */
|
||||||
|
|
||||||
|
|
|
@ -256,13 +256,8 @@ int ethtool_get_permanent_macaddr(int *ethtool_fd, const char *ifname, struct et
|
||||||
if (epaddr.addr.size != 6)
|
if (epaddr.addr.size != 6)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#if HAVE_ZERO_LENGTH_BOUNDS
|
|
||||||
# pragma GCC diagnostic ignored "-Wzero-length-bounds"
|
|
||||||
#endif
|
|
||||||
for (size_t i = 0; i < epaddr.addr.size; i++)
|
for (size_t i = 0; i < epaddr.addr.size; i++)
|
||||||
ret->ether_addr_octet[i] = epaddr.addr.data[i];
|
ret->ether_addr_octet[i] = epaddr.addr.data[i];
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -490,12 +485,7 @@ static int get_stringset(int ethtool_fd, struct ifreq *ifr, int stringset_id, st
|
||||||
if (!buffer.info.sset_mask)
|
if (!buffer.info.sset_mask)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#if HAVE_ZERO_LENGTH_BOUNDS
|
|
||||||
# pragma GCC diagnostic ignored "-Wzero-length-bounds"
|
|
||||||
#endif
|
|
||||||
len = buffer.info.data[0];
|
len = buffer.info.data[0];
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
strings = malloc0(sizeof(struct ethtool_gstrings) + len * ETH_GSTRING_LEN);
|
strings = malloc0(sizeof(struct ethtool_gstrings) + len * ETH_GSTRING_LEN);
|
||||||
if (!strings)
|
if (!strings)
|
||||||
|
|
Loading…
Reference in New Issue