From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tyler Hicks Subject: Re: [PATCH 2/3] Fix Wunused-return warnings Date: Sat, 9 Feb 2013 10:35:41 -0800 Message-ID: <20130209183541.GA20382@boyd> References: <1360379555-1910-1-git-send-email-tyhicks@canonical.com> <1360379555-1910-3-git-send-email-tyhicks@canonical.com> <1382817.WO9lKMT3XS@x2> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5327158939603976728==" Return-path: In-Reply-To: <1382817.WO9lKMT3XS@x2> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Steve Grubb Cc: linux-audit@redhat.com List-Id: linux-audit@redhat.com --===============5327158939603976728== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2013-02-09 11:57:32, Steve Grubb wrote: > On Friday, February 08, 2013 07:12:34 PM Tyler Hicks wrote: > > When building with -D_FORTIFY_SOURCE=3D2 and -W-unused-return, there ar= e a > > number of warnings caused by return values of functions marked with the > > warn_unused_result attribute being ignored. The audit codebase makes an > > attempt to suppress these warnings by casting the return value to void,= but > > that does not work when D_FORITY_SOURCE is in use. > >=20 > > Here's an explanation of how this patch fixes the warnings and how the > > potential error conditions are handled: > >=20 > > Errors writing to the auditd pid file should be logged since errors ope= ning > > the pid file are logged. These write() errors aren't treated as fatal. > >=20 > > Problems adjusting auditd's out of memory score should be logged, if si= mply > > to catch a change to the kernel interface. These errors aren't treated = as > > fatal. > >=20 > > Auditd refuses to start when nice() fails during initialization, so it > > should take disk_error_action whenever nice() fails during a reconfigur= e. >=20 > During a reconfigure, I would not consider this fatal. Its better to stay= =20 > running than exit. I'll adjust the patch. That's probably the best way to go. Thanks for getting these applied. Tyler >=20 > -Steve >=20 > > Failure to chdir("/") while daemonizing should be logged and treated as > > fatal since errors while redirecting stdin, stdout, and stderr are logg= ed > > and considered fatal. > > > > All nice() return values are handled sufficiently by relying on errno. > > However, they still throw warnings when D_FORTIFY_SOURCE is used. This = patch > > quiets those warnings by capturing the return value and using it and er= rno > > to determine if nice() failed. > >=20 > > Failure to adjust audit log file owner (fchown) and permissions (fchmod= ) are > > logged and considered fatal when opening the log file for the first tim= e. > > They are not treated as fatal when the operations fail on during log > > rotation since we made sure that they file owner and permissions were > > correct when originally opening the log file. --VbJkn9YxBvnuCH5J Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCgAGBQJRFpb8AAoJENaSAD2qAscKH0UQAMckGQjGqeZhgywZzf9Hdfjm v1oA/GH6LTm7k4G35rJbuqbfnVhK89xVrHhVs8P/TFhx2ogq39aGwYF+yVzLP/Ax hr6CY9KagLJg8lC7e3Klt5AXqatW2VpkzaeTMFzdNwjqhno+Vqb09fDt80RMl/UE H87N0iaRtYiATXFTL9eqO2YHeIxzCd6iEnrLslvUstjwtF40DpURPeYfgMrGSYrX 11uCljrICxy/5KtKw9j43oI4DTVs39KPasmTdnVgdiLSRFCoh2stxb4nLiyTfnqK YdUM0B8WlTpC23Z5IKos99W4ZNO+BgOCD79GLxsM0LqZKEKpfIytNIZ7EIT3sOKx Q5OaXCYhuKZLe3pUsMbAbpjoEEUUfxgCRjd/SuNMOFyHtfnjrxXsGl6N6GQk9Xcc IwYzl04yIxZlaCD7/8vnUOluERJg/4NrMYb03gI6D0fny8imgg+b7iT9OCAa7dE6 znPffTWxVgLsvxxAS9RD78kBmi8bdk7nPE4jWTNr6si/kACJa6Uc5AmLF+8lwIU+ OxLn1kbsPfk8oyR7XnfLiOSbTaDWowIux1JVuZ7vFPcAUdm6bJ5Bu0ge5/57dmIH 8FmIjdy/zGfH84QoIND1EYqtumeEwIUb/yxjvnGnVmZVMDwnad2JK1j3IDz7u/uL yCxF4Q2aDv1NYKaRPApE =z2iW -----END PGP SIGNATURE----- --VbJkn9YxBvnuCH5J-- --===============5327158939603976728== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============5327158939603976728==--