On Mon, Jun 10, 2013 at 04:59:37PM -0400, Richard Guy Briggs wrote:
On Wed, Jun 05, 2013 at 02:54:09AM +0400, Dmitry V. Levin wrote:
> On Thu, May 23, 2013 at 10:29:59AM -0400, Richard Guy Briggs wrote:
[...]
> > This can be used with older kernels since it checks for the
needed structure
> > members at compile time.
>
> What would happen if pam_tty_audit compiled with fresh system headers is
> attempted to be used on older kernels?
In older kernels:
audit_receive_skb() checks for message lengths and it is happy as long
as the received message length is equal to or longer than that which it
is expecting.
In audit_receive_msg(), in the case AUDIT_TTY_SET, the message length is
checked against the sizeof(struct audit_tty_status) only to make sure it
is at least long enough and not exactly so. The newer second element in
that struct will simply get ignored.
In newer kernels this latter check is generalized to avoid the reverse
problem.
In short, there should be no backward compatibility issues. That's good.
[...]
Ok, so $ac_cv_member_audit_tty_status_log_passwd is set by
AC_CHECK_MEMBER()?
Yes, AC_CHECK_MEMBER(AGGREGATE.MEMBER, ...) defines
av_cv_member_AGGREGATE_MEMBER variable
(see info -f autoconf 'Generic Structures' for details).
> > --- a/modules/pam_tty_audit/Makefile.am
> > +++ b/modules/pam_tty_audit/Makefile.am
> > @@ -16,6 +16,9 @@ XMLS = README.xml pam_tty_audit.8.xml
> > securelibdir = $(SECUREDIR)
> >
> > AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include
> > +if HAVE_AUDIT_TTY_STATUS_LOG_PASSWD
> > + AM_CFLAGS += -DHAVE_AUDIT_TTY_STATUS_LOG_PASSWD
> > +endif
>
> This shouldn't be needed because of the side effect of AC_CHECK_MEMBER.
I don't follow. I found I needed this latter one because
HAVE_AUDIT_TTY_STATUS_LOG_PASSWD wasn't being propagated to gcc when
compiling the C module.
I see. This happens because you use AC_CHECK_MEMBER instead of
AC_CHECK_MEMBERS. AC_CHECK_MEMBERS is a wrapper around AC_CHECK_MEMBER
that defines HAVE_AGGREGATE_MEMBER macro in config.h, so please use
AC_CHECK_MEMBERS.
--
ldv