Dag-Erling,

On Thu, Dec 22, 2011 at 06:10:15PM +0000, Dag-Erling Smorgrav wrote:
D> Author: des
D> Date: Thu Dec 22 18:10:15 2011
D> New Revision: 228809
D> URL: http://svn.freebsd.org/changeset/base/228809
D> 
D> Log:
D>   Merge upstream r509: don't log an error in the common case (ENOENT).
D> 
D> Modified:
D>   vendor/openpam/dist/lib/openpam_check_owner_perms.c
D> 
D> Modified: vendor/openpam/dist/lib/openpam_check_owner_perms.c
D> 
==============================================================================
D> --- vendor/openpam/dist/lib/openpam_check_owner_perms.c      Thu Dec 22 
16:40:35 2011        (r228808)
D> +++ vendor/openpam/dist/lib/openpam_check_owner_perms.c      Thu Dec 22 
18:10:15 2011        (r228809)
D> @@ -104,9 +104,11 @@ openpam_check_path_owner_perms(const cha
D>      len = strlen(pathbuf);
D>      while (len > 0) {
D>              if (stat(pathbuf, &sb) != 0) {
D> -                    serrno = errno;
D> -                    openpam_log(PAM_LOG_ERROR, "%s: %m", pathbuf);
D> -                    errno = serrno;
D> +                    if (errno != ENOENT) {
D> +                            serrno = errno;
D> +                            openpam_log(PAM_LOG_ERROR, "%s: %m", pathbuf);
D> +                            errno = serrno;
D> +                    }
D>                      return (-1);
D>              }
D>              if ((sb.st_uid != root && sb.st_uid != arbitrator) ||

I haven't yet tested this, but code looks like it is not going to print
anything in a case I don't have /usr/local/bin/pam_foo.so, while purpose
of the patch is to avoid logging of failure to open
/usr/local/bin/pam_foo.so.5.

Although openpam_dynamic() will do some logging of errno value, the name
of the failed file won't be logged. If I got a lot of modules configured,
then I can't figure out which one is ENOENT.

IMHO, some no_log flag should be passed down from the try_dlopen() to fix
the issue correctly.

-- 
Totus tuus, Glebius.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to