mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 09:57:41 +00:00
Use the fallthrough attribute instead of /* FALLTHROUGH */ comments.
This commit is contained in:
parent
20fd3b6363
commit
03ad96e445
@ -258,6 +258,9 @@
|
||||
/* Define to 1 if you have the `faccessat' function. */
|
||||
#undef HAVE_FACCESSAT
|
||||
|
||||
/* Define to 1 if the compiler supports the fallthrough attribute. */
|
||||
#undef HAVE_FALLTHROUGH_ATTRIBUTE
|
||||
|
||||
/* Define to 1 if you have the `fchmodat' function. */
|
||||
#undef HAVE_FCHMODAT
|
||||
|
||||
@ -1038,8 +1041,8 @@
|
||||
/* Define to 1 if you want sudo to free up memory before exiting. */
|
||||
#undef NO_LEAKS
|
||||
|
||||
/* Define to 1 if you don't want users to get the lecture the first time they use
|
||||
sudo. */
|
||||
/* Define to 1 if you don't want users to get the lecture the first time they
|
||||
use sudo. */
|
||||
#undef NO_LECTURE
|
||||
|
||||
/* Define to 1 if you don't want to use sudo's PAM session support. */
|
||||
|
28
configure
vendored
28
configure
vendored
@ -27861,10 +27861,11 @@ _ACEOF
|
||||
if test -n "$GCC"; then
|
||||
if test X"$enable_warnings" = X"yes" -o X"$with_devel" = X"yes"; then
|
||||
CFLAGS="${CFLAGS} -Wall -Wsign-compare -Wpointer-arith"
|
||||
_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Wimplicit-fallthrough -Werror"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler acceptd -Wimplicit-fallthrough" >&5
|
||||
$as_echo_n "checking whether C compiler acceptd -Wimplicit-fallthrough... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports the fallthrough attribute" >&5
|
||||
$as_echo_n "checking whether $CC supports the fallthrough attribute... " >&6; }
|
||||
if ${sudo_cv_var_fallthrough_attribute+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
@ -27874,7 +27875,7 @@ $as_echo_n "checking whether C compiler acceptd -Wimplicit-fallthrough... " >&6;
|
||||
switch (num) {
|
||||
case 1:
|
||||
num = 0;
|
||||
/* FALLTHROUGH */
|
||||
__attribute__((__fallthrough__));
|
||||
case 0:
|
||||
num++;
|
||||
}
|
||||
@ -27884,19 +27885,23 @@ $as_echo_n "checking whether C compiler acceptd -Wimplicit-fallthrough... " >&6;
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
CFLAGS="$_CFLAGS -Wimplicit-fallthrough"
|
||||
sudo_cv_var_fallthrough_attribute=yes
|
||||
|
||||
else
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
CFLAGS="$_CFLAGS"
|
||||
sudo_cv_var_fallthrough_attribute=no
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv_var_fallthrough_attribute" >&5
|
||||
$as_echo "$sudo_cv_var_fallthrough_attribute" >&6; }
|
||||
if test X"$sudo_cv_var_fallthrough_attribute" = X"yes"; then
|
||||
$as_echo "#define HAVE_FALLTHROUGH_ATTRIBUTE 1" >>confdefs.h
|
||||
|
||||
CFLAGS="$CFLAGS -Wimplicit-fallthrough"
|
||||
fi
|
||||
fi
|
||||
if test X"$enable_werror" = X"yes"; then
|
||||
CFLAGS="${CFLAGS} -Werror"
|
||||
@ -30315,5 +30320,6 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
38
configure.ac
38
configure.ac
@ -4591,36 +4591,41 @@ dnl We add -Wall and -Werror after all tests so they don't cause failures
|
||||
dnl
|
||||
if test -n "$GCC"; then
|
||||
if test X"$enable_warnings" = X"yes" -o X"$with_devel" = X"yes"; then
|
||||
dnl
|
||||
dnl Default warnings for development use.
|
||||
dnl
|
||||
CFLAGS="${CFLAGS} -Wall -Wsign-compare -Wpointer-arith"
|
||||
dnl
|
||||
dnl Check whether -Wimplicit-fallthrough is available and
|
||||
dnl recognizes /* FALLTHROUGH */ comments. Clang 10 requires
|
||||
dnl the "fallthrough" attribute which we don't use.
|
||||
dnl The fallthrough attribute is supported by gcc 7.0 and clang 10.
|
||||
dnl This test relies on AC_LANG_WERROR.
|
||||
dnl
|
||||
_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Wimplicit-fallthrough -Werror"
|
||||
AC_MSG_CHECKING([whether C compiler acceptd -Wimplicit-fallthrough])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_CACHE_CHECK([whether $CC supports the fallthrough attribute],
|
||||
[sudo_cv_var_fallthrough_attribute],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int num = argc + 1;
|
||||
switch (num) {
|
||||
case 1:
|
||||
num = 0;
|
||||
/* FALLTHROUGH */
|
||||
__attribute__((__fallthrough__));
|
||||
case 0:
|
||||
num++;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
]])], [
|
||||
AC_MSG_RESULT([yes])
|
||||
CFLAGS="$_CFLAGS -Wimplicit-fallthrough"
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
CFLAGS="$_CFLAGS"
|
||||
])
|
||||
|
||||
]])],
|
||||
[
|
||||
sudo_cv_var_fallthrough_attribute=yes
|
||||
],
|
||||
[
|
||||
sudo_cv_var_fallthrough_attribute=no]
|
||||
)]
|
||||
)
|
||||
if test X"$sudo_cv_var_fallthrough_attribute" = X"yes"; then
|
||||
AC_DEFINE(HAVE_FALLTHROUGH_ATTRIBUTE)
|
||||
CFLAGS="$CFLAGS -Wimplicit-fallthrough"
|
||||
fi
|
||||
fi
|
||||
if test X"$enable_werror" = X"yes"; then
|
||||
CFLAGS="${CFLAGS} -Werror"
|
||||
@ -4891,6 +4896,7 @@ AH_TEMPLATE(HAVE_OPENSSL, [Define to 1 if you are using OpenSSL's TLS and sha2 f
|
||||
AH_TEMPLATE(HAVE_GCRYPT, [Define to 1 if you are using gcrypt's sha2 functions.])
|
||||
AH_TEMPLATE(HAVE_SSL_CTX_SET_MIN_PROTO_VERSION, [Define to 1 if you have the `SSL_CTX_set_min_proto_version' function or macro.])
|
||||
AH_TEMPLATE(SUDOERS_IOLOG_CLIENT, [Define to 1 to compile support for sudo_logsrvd in the sudoers I/O log plugin.])
|
||||
AH_TEMPLATE(HAVE_FALLTHROUGH_ATTRIBUTE, [Define to 1 if the compiler supports the fallthrough attribute.])
|
||||
|
||||
dnl
|
||||
dnl Bits to copy verbatim into config.h.in
|
||||
|
@ -80,6 +80,12 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FALLTHROUGH_ATTRIBUTE
|
||||
# define FALLTHROUGH __attribute__((__fallthrough__))
|
||||
#else
|
||||
# define FALLTHROUGH do { } while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Given the pointer x to the member m of the struct s, return
|
||||
* a pointer to the containing structure.
|
||||
|
@ -50,13 +50,13 @@ sudo_arc4random_buf(void *buf, size_t n)
|
||||
switch (m) {
|
||||
case 4:
|
||||
*cp++ = (val >> 24) & 0xff;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case 3:
|
||||
*cp++ = (val >> 16) & 0xff;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case 2:
|
||||
*cp++ = (val >> 8) & 0xff;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case 1:
|
||||
*cp++ = val & 0xff;
|
||||
break;
|
||||
|
@ -304,7 +304,7 @@ globexp2(const Char *ptr, const Char *pattern, glob_t *pglob,
|
||||
i--;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case COMMA:
|
||||
if (i && *pm == COMMA)
|
||||
break;
|
||||
|
@ -535,7 +535,7 @@ reswitch: switch (ch) {
|
||||
if (width == INT_MIN)
|
||||
goto overflow;
|
||||
width = -width;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case '-':
|
||||
flags |= LADJUST;
|
||||
goto rflag;
|
||||
@ -649,7 +649,7 @@ reswitch: switch (ch) {
|
||||
break;
|
||||
case 'D':
|
||||
flags |= LONGINT;
|
||||
/*FALLTHROUGH*/
|
||||
FALLTHROUGH;
|
||||
case 'd':
|
||||
case 'i':
|
||||
_umax = SARG();
|
||||
@ -815,7 +815,7 @@ fp_common:
|
||||
#endif /* NO_PRINTF_PERCENT_N */
|
||||
case 'O':
|
||||
flags |= LONGINT;
|
||||
/*FALLTHROUGH*/
|
||||
FALLTHROUGH;
|
||||
case 'o':
|
||||
_umax = UARG();
|
||||
base = OCT;
|
||||
@ -875,7 +875,7 @@ fp_common:
|
||||
break;
|
||||
case 'U':
|
||||
flags |= LONGINT;
|
||||
/*FALLTHROUGH*/
|
||||
FALLTHROUGH;
|
||||
case 'u':
|
||||
_umax = UARG();
|
||||
base = DEC;
|
||||
@ -1276,7 +1276,7 @@ reswitch: switch (ch) {
|
||||
break;
|
||||
case 'D':
|
||||
flags |= LONGINT;
|
||||
/*FALLTHROUGH*/
|
||||
FALLTHROUGH;
|
||||
case 'd':
|
||||
case 'i':
|
||||
ADDSARG();
|
||||
@ -1316,7 +1316,7 @@ reswitch: switch (ch) {
|
||||
#endif /* NO_PRINTF_PERCENT_N */
|
||||
case 'O':
|
||||
flags |= LONGINT;
|
||||
/*FALLTHROUGH*/
|
||||
FALLTHROUGH;
|
||||
case 'o':
|
||||
ADDUARG();
|
||||
break;
|
||||
@ -1333,7 +1333,7 @@ reswitch: switch (ch) {
|
||||
break;
|
||||
case 'U':
|
||||
flags |= LONGINT;
|
||||
/*FALLTHROUGH*/
|
||||
FALLTHROUGH;
|
||||
case 'u':
|
||||
case 'X':
|
||||
case 'x':
|
||||
|
@ -69,7 +69,7 @@ sudo_strtonumx(const char *str, long long minval, long long maxval, char **endp,
|
||||
break;
|
||||
case '+':
|
||||
ch = *cp++;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
sign = '+';
|
||||
break;
|
||||
|
@ -866,10 +866,10 @@ client_message_completion(struct client_closure *closure)
|
||||
closure->state = SEND_EXIT;
|
||||
debug_return_bool(fmt_exit_message(closure));
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case SEND_RESTART:
|
||||
closure->state = SEND_IO;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case SEND_IO:
|
||||
/* fmt_next_iolog() will advance state on EOF. */
|
||||
if (!fmt_next_iolog(closure))
|
||||
|
@ -43,7 +43,7 @@ _sudo_printf_default(int msg_type, const char *fmt, ...)
|
||||
switch (msg_type & 0xff) {
|
||||
case SUDO_CONV_ERROR_MSG:
|
||||
fp = stderr;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case SUDO_CONV_INFO_MSG:
|
||||
va_start(ap, fmt);
|
||||
len = vfprintf(ttyfp ? ttyfp : fp, fmt, ap);
|
||||
|
@ -681,7 +681,7 @@ converse(int num_msg, PAM_CONST struct pam_message **msg,
|
||||
switch (pm->msg_style) {
|
||||
case PAM_PROMPT_ECHO_ON:
|
||||
type = SUDO_CONV_PROMPT_ECHO_ON;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case PAM_PROMPT_ECHO_OFF:
|
||||
/* Error out if the last password read was interrupted. */
|
||||
if (getpass_error)
|
||||
|
@ -121,7 +121,7 @@ check_user_interactive(int validated, int mode, struct getpass_closure *closure)
|
||||
}
|
||||
sudo_debug_printf(SUDO_DEBUG_INFO,
|
||||
"%s: check user flag overrides time stamp", __func__);
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
|
||||
default:
|
||||
/* Bail out if we are non-interactive and a password is required */
|
||||
|
@ -277,7 +277,7 @@ print_member_ldif(FILE *fp, struct sudoers_parse_tree *parse_tree, char *name,
|
||||
print_attribute_ldif(fp, attr_name, negated ? "!ALL" : "ALL");
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case COMMAND:
|
||||
attr_val = format_cmnd((struct sudo_command *)name, negated);
|
||||
print_attribute_ldif(fp, attr_name, attr_val);
|
||||
@ -292,7 +292,7 @@ print_member_ldif(FILE *fp, struct sudoers_parse_tree *parse_tree, char *name,
|
||||
alias_put(a);
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
len = asprintf(&attr_val, "%s%s", negated ? "!" : "", name);
|
||||
if (len == -1) {
|
||||
|
@ -218,7 +218,7 @@ parse_default_entry(struct sudo_defs_types *def, const char *val, int op,
|
||||
case T_TUPLE:
|
||||
if (ISSET(def->type, T_BOOL))
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case T_LOGFAC:
|
||||
if (op == true) {
|
||||
/* Use default syslog facility if none specified. */
|
||||
|
@ -58,7 +58,7 @@ sudoers_format_member_int(struct sudo_lbuf *lbuf,
|
||||
sudo_lbuf_append(lbuf, "%sALL", negated ? "!" : "");
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case COMMAND:
|
||||
c = (struct sudo_command *) name;
|
||||
TAILQ_FOREACH(digest, &c->digests, entries) {
|
||||
@ -100,7 +100,7 @@ sudoers_format_member_int(struct sudo_lbuf *lbuf,
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
print_word:
|
||||
/* Do not quote UID/GID, all others get quoted. */
|
||||
|
@ -152,7 +152,7 @@ array_to_member_list(void *a, sudo_ldap_iter_t iter)
|
||||
m->type = ALL;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
m->type = WORD;
|
||||
break;
|
||||
@ -222,7 +222,7 @@ host_to_member(char *host)
|
||||
m->type = ALL;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
if (is_address(host)) {
|
||||
m->type = NTWKADDR;
|
||||
|
@ -98,7 +98,7 @@ user_matches(struct sudoers_parse_tree *parse_tree, const struct passwd *pw,
|
||||
alias_put(a);
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case WORD:
|
||||
if (userpw_matches(m->name, pw->pw_name, pw))
|
||||
matched = !m->negated;
|
||||
@ -195,7 +195,7 @@ runaslist_matches(struct sudoers_parse_tree *parse_tree,
|
||||
alias_put(a);
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case WORD:
|
||||
if (userpw_matches(m->name, runas_pw->pw_name, runas_pw))
|
||||
user_matched = !m->negated;
|
||||
@ -239,7 +239,7 @@ runaslist_matches(struct sudoers_parse_tree *parse_tree,
|
||||
alias_put(a);
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case WORD:
|
||||
if (group_matches(m->name, runas_gr))
|
||||
group_matched = !m->negated;
|
||||
@ -352,7 +352,7 @@ host_matches(struct sudoers_parse_tree *parse_tree, const struct passwd *pw,
|
||||
alias_put(a);
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case WORD:
|
||||
if (hostname_matches(shost, lhost, m->name))
|
||||
matched = !m->negated;
|
||||
@ -399,7 +399,7 @@ cmnd_matches(struct sudoers_parse_tree *parse_tree, const struct member *m)
|
||||
matched = !m->negated;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case COMMAND:
|
||||
c = (struct sudo_command *)m->name;
|
||||
if (command_matches(c->cmnd, c->args, &c->digests))
|
||||
|
@ -368,7 +368,7 @@ role_to_sudoers(struct sudoers_parse_tree *parse_tree, struct sudo_role *role,
|
||||
m->type = ALL;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
m->type = WORD;
|
||||
break;
|
||||
|
@ -514,7 +514,7 @@ sudo_sss_result_get(struct sudo_nss *nss, struct passwd *pw)
|
||||
break;
|
||||
case ENOMEM:
|
||||
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
sudo_debug_printf(SUDO_DEBUG_ERROR, "handle->fn_send_recv: rc=%d", rc);
|
||||
debug_return_ptr(NULL);
|
||||
@ -753,7 +753,7 @@ sudo_sss_getdefs(struct sudo_nss *nss)
|
||||
break;
|
||||
case ENOMEM:
|
||||
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
sudo_debug_printf(SUDO_DEBUG_ERROR,
|
||||
"handle->fn_send_recv_defaults: rc=%d, sss_error=%u", rc, sss_error);
|
||||
|
@ -48,7 +48,7 @@ sudo_printf_int(int msg_type, const char *fmt, ...)
|
||||
switch (msg_type & 0xff) {
|
||||
case SUDO_CONV_ERROR_MSG:
|
||||
fp = stderr;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case SUDO_CONV_INFO_MSG:
|
||||
va_start(ap, fmt);
|
||||
len = vfprintf(ttyfp ? ttyfp : fp, fmt, ap);
|
||||
|
@ -448,7 +448,7 @@ getsize_cb(int fd, int what, void *v)
|
||||
case -1:
|
||||
if (errno == EAGAIN)
|
||||
goto another;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case 0:
|
||||
goto done;
|
||||
default:
|
||||
@ -487,7 +487,7 @@ getsize_cb(int fd, int what, void *v)
|
||||
goto done;
|
||||
gc->nums[gc->nums_depth] = 0;
|
||||
gc->state = NUMBER;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case NUMBER:
|
||||
if (!isdigit(ch)) {
|
||||
/* done with number, reparse ch */
|
||||
|
@ -367,7 +367,7 @@ ts_init_key(struct timestamp_entry *entry, struct passwd *pw, int flags,
|
||||
default:
|
||||
/* Unknown time stamp ticket type, treat as tty (should not happen). */
|
||||
sudo_warnx("unknown time stamp ticket type %d", ticket_type);
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case tty:
|
||||
if (user_ttypath != NULL && stat(user_ttypath, &sb) == 0) {
|
||||
/* tty-based time stamp */
|
||||
@ -377,7 +377,7 @@ ts_init_key(struct timestamp_entry *entry, struct passwd *pw, int flags,
|
||||
get_starttime(entry->sid, &entry->start_time);
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case kernel:
|
||||
case ppid:
|
||||
/* ppid-based time stamp */
|
||||
|
@ -811,7 +811,7 @@ whatnow(void)
|
||||
switch (choice) {
|
||||
case EOF:
|
||||
choice = 'x';
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case 'e':
|
||||
case 'x':
|
||||
case 'Q':
|
||||
|
@ -64,7 +64,7 @@ sudo_conversation(int num_msgs, const struct sudo_conv_message msgs[],
|
||||
goto read_pass;
|
||||
case SUDO_CONV_PROMPT_MASK:
|
||||
SET(flags, TGP_MASK);
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case SUDO_CONV_PROMPT_ECHO_OFF:
|
||||
if (ISSET(msg->msg_type, SUDO_CONV_PROMPT_ECHO_OK))
|
||||
SET(flags, TGP_NOECHO_TRY);
|
||||
@ -84,7 +84,7 @@ sudo_conversation(int num_msgs, const struct sudo_conv_message msgs[],
|
||||
break;
|
||||
case SUDO_CONV_ERROR_MSG:
|
||||
fp = stderr;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case SUDO_CONV_INFO_MSG:
|
||||
if (msg->msg != NULL) {
|
||||
size_t len = strlen(msg->msg);
|
||||
@ -172,7 +172,7 @@ sudo_conversation_printf(int msg_type, const char *fmt, ...)
|
||||
switch (msg_type & 0xff) {
|
||||
case SUDO_CONV_ERROR_MSG:
|
||||
fp = stderr;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case SUDO_CONV_INFO_MSG:
|
||||
va_start(ap, fmt);
|
||||
len = vfprintf(ttyfp ? ttyfp : fp, fmt, ap);
|
||||
|
@ -201,7 +201,7 @@ mon_handle_sigchld(struct monitor_closure *mc)
|
||||
switch (pid) {
|
||||
case 0:
|
||||
errno = ECHILD;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case -1:
|
||||
sudo_warn(U_("%s: %s"), __func__, "waitpid");
|
||||
debug_return;
|
||||
|
@ -542,7 +542,7 @@ suspend_sudo(struct exec_closure_pty *ec, int signo)
|
||||
ret = SIGCONT_FG; /* resume command in foreground */
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case SIGSTOP:
|
||||
case SIGTSTP:
|
||||
/* Flush any remaining output and deschedule I/O events. */
|
||||
@ -663,7 +663,7 @@ read_callback(int fd, int what, void *v)
|
||||
/* treat read error as fatal and close the fd */
|
||||
sudo_debug_printf(SUDO_DEBUG_ERROR,
|
||||
"error reading fd %d: %s", fd, strerror(errno));
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case 0:
|
||||
/* got EOF or pty has gone away */
|
||||
if (n == 0) {
|
||||
@ -763,7 +763,7 @@ write_callback(int fd, int what, void *v)
|
||||
/* Schedule SIGTTOU to be forwarded to the command. */
|
||||
schedule_signal(iob->ec, SIGTTOU);
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case EAGAIN:
|
||||
/* not an error */
|
||||
break;
|
||||
@ -1041,7 +1041,7 @@ handle_sigchld_pty(struct exec_closure_pty *ec)
|
||||
switch (pid) {
|
||||
case 0:
|
||||
errno = ECHILD;
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case -1:
|
||||
sudo_warn(U_("%s: %s"), __func__, "waitpid");
|
||||
debug_return;
|
||||
|
@ -389,7 +389,7 @@ parse_args(int argc, char **argv, int *old_optind, int *nargc, char ***nargv,
|
||||
valid_flags = 0;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
case OPT_HOSTNAME:
|
||||
assert(optarg != NULL);
|
||||
if (*optarg == '\0')
|
||||
|
@ -161,7 +161,7 @@ try_wordexp(void)
|
||||
break;
|
||||
}
|
||||
wordfree(&we);
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
printf("%s: FAIL (wordexp) [%d]\n", getprogname(), rc);
|
||||
break;
|
||||
|
@ -435,7 +435,7 @@ getln(int fd, char *buf, size_t bufsiz, bool feedback,
|
||||
*errval = TGP_ERRVAL_NOPASSWORD;
|
||||
debug_return_str(NULL);
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
debug_return_str_masked(buf);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user