visiblepw sudoers flag is set.
"sudoers_locale", T_STR,
"Locale to use while parsing sudoers: %s",
NULL,
+ }, {
+ "visiblepw", T_FLAG,
+ "Allow sudo to prompt for a password even if it would be visisble",
+ NULL,
}, {
NULL, 0, NULL
}
#define I_ENV_FILE 67
#define def_sudoers_locale (sudo_defs_table[68].sd_un.str)
#define I_SUDOERS_LOCALE 68
+#define def_visiblepw (sudo_defs_table[69].sd_un.flag)
+#define I_VISIBLEPW 69
enum def_tupple {
never,
sudoers_locale
T_STR
"Locale to use while parsing sudoers: %s"
+visiblepw
+ T_FLAG
+ "Allow sudo to prompt for a password even if it would be visisble"
"no askpass program specified, try setting SUDO_ASKPASS");
} else {
/* If no tty but DISPLAY is set, use askpass if we have it. */
- if (user_askpass && !ISSET(tgetpass_flags, TGP_STDIN) &&
- !user_ttypath && user_display && *user_display != '\0')
- SET(tgetpass_flags, TGP_ASKPASS);
+ if (!user_ttypath && !ISSET(tgetpass_flags, TGP_STDIN)) {
+ if (user_askpass && user_display && *user_display != '\0') {
+ SET(tgetpass_flags, TGP_ASKPASS);
+ } else if (!def_visiblepw) {
+ log_error(NO_MAIL,
+ "no tty present and no askpass program specified");
+ }
+ }
}
/* User may have overriden environment resetting via the -E flag. */
=item requiretty
If set, B<sudo> will only run when the user is logged in to a real
-tty. This will disallow things like C<"rsh somehost sudo ls"> since
-L<rsh(1)> does not allocate a tty. Because it is not possible to turn
-off echo when there is no tty present, some sites may wish to set
-this flag to prevent a user from entering a visible password. This
-flag is I<off> by default.
+tty. When this flag is set, B<sudo> can only be run from a login
+session and not via other means such as L<cron(8)> or cgi-bin scripts.
+This flag is I<off> by default.
=item root_sudo
login class if one exists. Only available if B<sudo> is configured with
the --with-logincap option. This flag is I<off> by default.
+=item visiblepw
+
+By default, B<sudo> will refuse to run if the user must enter a
+password but it is not possible to disable echo on the terminal.
+If the I<visiblepw> flag is set, B<sudo> will prompt for a password
+even when it would be visible on the screen. This makes it possible
+to run things like C<"rsh somehost sudo ls"> since L<rsh(1)> does
+not allocate a tty. This flag is I<off> by default.
+
=back
B<Integers>: