Hello sirs. I would like to ask a code review for the diff will solve bug 6605991: su(1) should print clearer error messages when it can't execute a user's shell
Attached is the diff. My code contributor is OS0133, and sponsor for this fix is Eng. Viswa Kannapan. Thanks in advance for your attention. -- Sergio GutiƩrrez
--- su.c Wed Dec 17 17:46:14 2008 +++ su.c.saguti Mon Jan 5 09:07:16 2009 @@ -684,7 +684,20 @@ message(ERR, gettext("Couldn't exec fallback shell %s: %s"), safe_shell, strerror(errno)); } else { - message(ERR, gettext("No shell")); + switch(errno) { + + case EACCESS: + message(ERR, gettext("Shell not executable")); + break; + + case EPERM: + message(ERR, gettext("Insufficient privileges")); + break; + + default: + message(ERR, gettext("No shell")); + break; + } } return (3); }
_______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code