allocation errors.
{
debug_decl(should_mail, SUDOERS_DEBUG_LOGGING)
- debug_return_bool(def_mail_always ||
+ debug_return_bool(def_mail_always || ISSET(status, VALIDATE_ERROR) ||
(def_mail_all_cmnds && ISSET(sudo_mode, (MODE_RUN|MODE_EDIT))) ||
(def_mail_no_user && ISSET(status, FLAG_NO_USER)) ||
(def_mail_no_host && ISSET(status, FLAG_NO_HOST)) ||
TAILQ_FOREACH(nss, snl, entries) {
validated = nss->lookup(nss, validated, pwflag);
- if (ISSET(validated, VALIDATE_SUCCESS)) {
+ if (ISSET(validated, VALIDATE_ERROR)) {
+ /* The lookup function should have printed an error. */
+ rval = -1;
+ goto done;
+ } else if (ISSET(validated, VALIDATE_SUCCESS)) {
/* Handle [SUCCESS=return] */
if (nss->ret_if_found)
break;
* Return values for sudoers_lookup(), also used as arguments for log_auth()
* Note: cannot use '0' as a value here.
*/
-#define VALIDATE_SUCCESS 0x001
-#define VALIDATE_FAILURE 0x002
+#define VALIDATE_ERROR 0x001
+#define VALIDATE_SUCCESS 0x002
+#define VALIDATE_FAILURE 0x004
#define FLAG_CHECK_USER 0x010
#define FLAG_NO_USER 0x020
#define FLAG_NO_HOST 0x040