From: Tyler Hicks <tyhicks@canonical.com>
To: Steve Grubb <sgrubb@redhat.com>
Cc: linux-audit@redhat.com
Subject: Re: [PATCH 2/3] Fix Wunused-return warnings
Date: Sat, 9 Feb 2013 10:35:41 -0800 [thread overview]
Message-ID: <20130209183541.GA20382@boyd> (raw)
In-Reply-To: <1382817.WO9lKMT3XS@x2>
[-- Attachment #1.1: Type: text/plain, Size: 2166 bytes --]
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=2 and -W-unused-return, there are 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.
> >
> > Here's an explanation of how this patch fixes the warnings and how the
> > potential error conditions are handled:
> >
> > Errors writing to the auditd pid file should be logged since errors opening
> > the pid file are logged. These write() errors aren't treated as fatal.
> >
> > Problems adjusting auditd's out of memory score should be logged, if simply
> > to catch a change to the kernel interface. These errors aren't treated as
> > fatal.
> >
> > Auditd refuses to start when nice() fails during initialization, so it
> > should take disk_error_action whenever nice() fails during a reconfigure.
>
> During a reconfigure, I would not consider this fatal. Its better to stay
> running than exit. I'll adjust the patch.
That's probably the best way to go.
Thanks for getting these applied.
Tyler
>
> -Steve
>
> > Failure to chdir("/") while daemonizing should be logged and treated as
> > fatal since errors while redirecting stdin, stdout, and stderr are logged
> > 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 errno
> > to determine if nice() failed.
> >
> > Failure to adjust audit log file owner (fchown) and permissions (fchmod) are
> > logged and considered fatal when opening the log file for the first time.
> > 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.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2013-02-09 18:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-09 3:12 [PATCH 0/3] Fix userspace audit compiler warnings Tyler Hicks
2013-02-09 3:12 ` [PATCH 1/3] Don't ignore the return value of asprintf() Tyler Hicks
2013-02-09 16:50 ` Steve Grubb
2013-02-09 3:12 ` [PATCH 2/3] Fix Wunused-return warnings Tyler Hicks
2013-02-09 16:57 ` Steve Grubb
2013-02-09 18:35 ` Tyler Hicks [this message]
2013-02-09 3:12 ` [PATCH 3/3] Fix discards 'const' qualifier from pointer target type warnings Tyler Hicks
2013-02-09 17:22 ` Steve Grubb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130209183541.GA20382@boyd \
--to=tyhicks@canonical.com \
--cc=linux-audit@redhat.com \
--cc=sgrubb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox