From owner-p4-projects@FreeBSD.ORG Sat May 6 18:39:46 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AEFB316A404; Sat, 6 May 2006 18:39:46 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 716F216A401 for ; Sat, 6 May 2006 18:39:46 +0000 (UTC) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D5B443D46 for ; Sat, 6 May 2006 18:39:46 +0000 (GMT) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k46IdkH6074791 for ; Sat, 6 May 2006 18:39:46 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k46Idjhq074785 for perforce@freebsd.org; Sat, 6 May 2006 18:39:45 GMT (envelope-from csjp@freebsd.org) Date: Sat, 6 May 2006 18:39:45 GMT Message-Id: <200605061839.k46Idjhq074785@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Cc: Subject: PERFORCE change 96744 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 May 2006 18:39:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=96744 Change 96744 by csjp@csjp_xor on 2006/05/06 18:39:24 Since pam_strerror(3) is capable of returning NULL, check the return value and if it's NULL set a generic error message, instead of passing it along in the audit record. Affected files ... .. //depot/projects/trustedbsd/audit3/usr.bin/su/su.c#16 edit Differences ... ==== //depot/projects/trustedbsd/audit3/usr.bin/su/su.c#16 (text+ko) ==== @@ -170,6 +170,9 @@ const char *p, *user, *shell, *mytty, **nargv; struct sigaction sa, sa_int, sa_quit, sa_pipe; int temp, fds[2]; +#ifdef USE_BSM_AUDIT + const char *aerr; +#endif shell = class = cleanenv = NULL; asme = asthem = fastlogin = statusp = 0; @@ -331,9 +334,11 @@ PAM_CHANGE_EXPIRED_AUTHTOK); if (retcode != PAM_SUCCESS) { #ifdef USE_BSM_AUDIT + aerr = pam_strerror(pamh, retcode); + if (aerr == NULL) + aerr = "Unknown PAM error"; if (audit_submit(AUE_su, getuid(), 1, EPERM, - "pam_chauthtok: %s", - pam_strerror(pamh, retcode))) + "pam_chauthtok: %s", aerr)) errx(1, "Permission denied"); #endif syslog(LOG_ERR, "pam_chauthtok: %s",