S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
s\bsu\bud\bdo\bo -\b-h\bh | -\b-K\bK | -\b-k\bk | -\b-V\bV
- s\bsu\bud\bdo\bo -\b-v\bv [-\b-A\bAk\bkn\bnS\bS] [-\b-a\ba _\bt_\by_\bp_\be] [-\b-g\bg _\bg_\br_\bo_\bu_\bp] [-\b-h\bh _\bh_\bo_\bs_\bt] [-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt] [-\b-u\bu _\bu_\bs_\be_\br]
- s\bsu\bud\bdo\bo -\b-l\bl [-\b-A\bAk\bkn\bnS\bS] [-\b-a\ba _\bt_\by_\bp_\be] [-\b-g\bg _\bg_\br_\bo_\bu_\bp] [-\b-h\bh _\bh_\bo_\bs_\bt] [-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt] [-\b-U\bU _\bu_\bs_\be_\br]
+ s\bsu\bud\bdo\bo -\b-v\bv [-\b-A\bAB\bBk\bkn\bnS\bS] [-\b-a\ba _\bt_\by_\bp_\be] [-\b-g\bg _\bg_\br_\bo_\bu_\bp] [-\b-h\bh _\bh_\bo_\bs_\bt] [-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt] [-\b-u\bu _\bu_\bs_\be_\br]
+ s\bsu\bud\bdo\bo -\b-l\bl [-\b-A\bAB\bBk\bkn\bnS\bS] [-\b-a\ba _\bt_\by_\bp_\be] [-\b-g\bg _\bg_\br_\bo_\bu_\bp] [-\b-h\bh _\bh_\bo_\bs_\bt] [-\b-p\bp _\bp_\br_\bo_\bm_\bp_\bt] [-\b-U\bU _\bu_\bs_\be_\br]
[-\b-u\bu _\bu_\bs_\be_\br] [_\bc_\bo_\bm_\bm_\ba_\bn_\bd]
- s\bsu\bud\bdo\bo [-\b-A\bAb\bbE\bEH\bHn\bnP\bPS\bS] [-\b-a\ba _\bt_\by_\bp_\be] [-\b-C\bC _\bn_\bu_\bm] [-\b-c\bc _\bc_\bl_\ba_\bs_\bs] [-\b-g\bg _\bg_\br_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n_\b._\bc_\bo_\bn_\bf. This option is only available on systems
that support BSD authentication.
+ -\b-B\bB, -\b--\b-b\bbe\bel\bll\bl Ring the bell as part of the password promp when a terminal
+ is present. This option has no effect if an askpass program
+ is used.
+
-\b-b\bb, -\b--\b-b\bba\bac\bck\bkg\bgr\bro\bou\bun\bnd\bd
Run the given command in the background. Note that it is not
possible to use shell job control to manipulate background
file distributed with s\bsu\bud\bdo\bo or https://www.sudo.ws/license.html for
complete details.
-Sudo 1.8.28 November 25, 2018 Sudo 1.8.28
+Sudo 1.8.28 May 27, 2019 Sudo 1.8.28
.\"
.\" SPDX-License-Identifier: ISC
.\"
-.\" Copyright (c) 1994-1996, 1998-2005, 2007-2018
+.\" Copyright (c) 1994-1996, 1998-2005, 2007-2019
.\" Todd C. Miller <Todd.Miller@sudo.ws>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.nr BA @BAMAN@
.nr LC @LCMAN@
.nr PS @PSMAN@
-.TH "SUDO" "@mansectsu@" "November 25, 2018" "Sudo @PACKAGE_VERSION@" "System Manager's Manual"
+.TH "SUDO" "@mansectsu@" "May 27, 2019" "Sudo @PACKAGE_VERSION@" "System Manager's Manual"
.nh
.if n .ad l
.SH "NAME"
.HP 5n
\fBsudo\fR
\fB\-v\fR
-[\fB\-AknS\fR]
+[\fB\-ABknS\fR]
.if \n(BA [\fB\-a\fR\ \fItype\fR]
[\fB\-g\fR\ \fIgroup\fR]
[\fB\-h\fR\ \fIhost\fR]
.HP 5n
\fBsudo\fR
\fB\-l\fR
-[\fB\-AknS\fR]
+[\fB\-ABknS\fR]
.if \n(BA [\fB\-a\fR\ \fItype\fR]
[\fB\-g\fR\ \fIgroup\fR]
[\fB\-h\fR\ \fIhost\fR]
.br
.HP 5n
\fBsudo\fR
-[\fB\-AbEHnPS\fR]
+[\fB\-ABbEHnPS\fR]
.if \n(BA [\fB\-a\fR\ \fItype\fR]
[\fB\-C\fR\ \fInum\fR]
.if \n(LC [\fB\-c\fR\ \fIclass\fR]
.br
.HP 9n
\fBsudoedit\fR
-[\fB\-AknS\fR]
+[\fB\-ABknS\fR]
.if \n(BA [\fB\-a\fR\ \fItype\fR]
[\fB\-C\fR\ \fInum\fR]
.if \n(LC [\fB\-c\fR\ \fIclass\fR]
authentication.
.\}
.TP 12n
+\fB\-B\fR, \fB\--bell\fR
+Ring the bell as part of the password promp when a terminal is present.
+This option has no effect if an askpass program is used.
+.TP 12n
\fB\-b\fR, \fB\--background\fR
Run the given command in the background.
Note that it is not possible to use shell job control to manipulate
.\"
.\" SPDX-License-Identifier: ISC
.\"
-.\" Copyright (c) 1994-1996, 1998-2005, 2007-2018
+.\" Copyright (c) 1994-1996, 1998-2005, 2007-2019
.\" Todd C. Miller <Todd.Miller@sudo.ws>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.nr BA @BAMAN@
.nr LC @LCMAN@
.nr PS @PSMAN@
-.Dd November 25, 2018
+.Dd May 27, 2019
.Dt SUDO @mansectsu@
.Os Sudo @PACKAGE_VERSION@
.Sh NAME
.Fl h | K | k | V
.Nm sudo
.Fl v
-.Op Fl AknS
+.Op Fl ABknS
.if \n(BA \{\
.Op Fl a Ar type
.\}
.Op Fl u Ar user
.Nm sudo
.Fl l
-.Op Fl AknS
+.Op Fl ABknS
.if \n(BA \{\
.Op Fl a Ar type
.\}
.Op Fl u Ar user
.Op Ar command
.Nm sudo
-.Op Fl AbEHnPS
+.Op Fl ABbEHnPS
.if \n(BA \{\
.Op Fl a Ar type
.\}
.Op Fl i | s
.Op Ar command
.Nm sudoedit
-.Op Fl AknS
+.Op Fl ABknS
.if \n(BA \{\
.Op Fl a Ar type
.\}
.Bx
authentication.
.\}
+.It Fl B , -bell
+Ring the bell as part of the password promp when a terminal is present.
+This option has no effect if an askpass program is used.
.It Fl b , -background
Run the given command in the background.
Note that it is not possible to use shell job control to manipulate
* Note that we must disable arg permutation to support setting environment
* variables and to better support the optional arg of the -h flag.
*/
-static const char short_opts[] = "+Aa:bC:c:D:Eeg:Hh::iKklnPp:r:SsT:t:U:u:Vv";
+static const char short_opts[] = "+Aa:BbC:c:D:Eeg:Hh::iKklnPp:r:SsT:t:U:u:Vv";
static struct option long_opts[] = {
{ "askpass", no_argument, NULL, 'A' },
{ "auth-type", required_argument, NULL, 'a' },
{ "background", no_argument, NULL, 'b' },
+ { "bell", no_argument, NULL, 'B' },
{ "close-from", required_argument, NULL, 'C' },
{ "login-class", required_argument, NULL, 'c' },
{ "preserve-env", optional_argument, NULL, 'E' },
case 'b':
SET(flags, MODE_BACKGROUND);
break;
+ case 'B':
+ SET(tgetpass_flags, TGP_BELL);
+ break;
case 'C':
if (strtonum(optarg, 3, INT_MAX, NULL) == 0) {
sudo_warnx(U_("the argument to -C must be a number greater than or equal to 3"));
#endif
sudo_lbuf_append(&lbuf, " -b, --background %s\n",
_("run command in the background"));
+ sudo_lbuf_append(&lbuf, " -B, --bell %s\n",
+ _("ring bell when prompting"));
sudo_lbuf_append(&lbuf, " -C, --close-from=num %s\n",
_("close all file descriptors >= num"));
#ifdef HAVE_LOGIN_CAP_H
#define TGP_ASKPASS 0x04 /* read from askpass helper program */
#define TGP_MASK 0x08 /* mask user input when reading */
#define TGP_NOECHO_TRY 0x10 /* turn off echo if possible */
+#define TGP_BELL 0x20 /* bell on password prompt */
/* name/value pairs for command line settings. */
struct sudo_settings {
(void) sigaction(SIGTTIN, &sa, &savettin);
(void) sigaction(SIGTTOU, &sa, &savettou);
+ if (ISSET(flags, TGP_BELL) && output != STDERR_FILENO) {
+ /* Ring the bell if requested and there is a tty. */
+ if (write(output, "\a", 1) == -1)
+ goto restore;
+ }
if (prompt) {
if (write(output, prompt, strlen(prompt)) == -1)
goto restore;