From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Antill Subject: Re: difficulty with TYPE Date: Tue, 15 Jan 2008 09:20:31 -0500 Message-ID: <1200406831.30787.8.camel@code.and.org> References: <18436f8f0801142314g46f77485x311cfb2826f2dff4@mail.gmail.com> <1200404039.30787.4.camel@code.and.org> <478CBBFC.8090303@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1260744807==" Return-path: In-Reply-To: <478CBBFC.8090303@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: John Dennis Cc: linux-audit@redhat.com, Abhishek Gupta List-Id: linux-audit@redhat.com --===============1260744807== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-VWMenCDnUbS+jDPYxAos" --=-VWMenCDnUbS+jDPYxAos Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2008-01-15 at 08:58 -0500, John Dennis wrote: > James Antill wrote: > > The second iovec above can't just be MAX_AUDIT_MESSAGE_LENGTH, or if > > there are two messages you'll read some/all of the next one(s). You > > either need to read the header first and then use hdr.size, or separate > > the IO from the parsing. > > Also you can't just check for readv() as above, you need to check that > > you've read the amount of data you want, and if you didn't get it all > > yet then loop.=20 >=20 > This is why we provide libraries to do things like this, it can be=20 > tricky to get right. The feed() interface to auparse consumes arbitrary=20 auparse_feed() works off log files and the audispd "string" format. The above code was using the auditd -> audispd format, so that API doesn't work. --=20 James Antill Red Hat --=-VWMenCDnUbS+jDPYxAos Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHjMEv11eXTEMrxtQRAj9lAKCdyuVXljuyvSmSFKE0yrYRArw8owCfanYV bbjuxj/RShZ8AnbSwG+F7MM= =v2zu -----END PGP SIGNATURE----- --=-VWMenCDnUbS+jDPYxAos-- --===============1260744807== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============1260744807==--