From owner-p4-projects@FreeBSD.ORG Sun Feb 17 22:25:29 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A5AD116A419; Sun, 17 Feb 2008 22:25:29 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52EFF16A417 for ; Sun, 17 Feb 2008 22:25:29 +0000 (UTC) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3B6AB13C46B for ; Sun, 17 Feb 2008 22:25:29 +0000 (UTC) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1HMPTgd095026 for ; Sun, 17 Feb 2008 22:25:29 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1HMPT5G095023 for perforce@freebsd.org; Sun, 17 Feb 2008 22:25:29 GMT (envelope-from csjp@freebsd.org) Date: Sun, 17 Feb 2008 22:25:29 GMT Message-Id: <200802172225.m1HMPT5G095023@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 135596 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: Sun, 17 Feb 2008 22:25:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=135596 Change 135596 by csjp@ibm01 on 2008/02/17 22:24:43 Annotate limitation in read records from audit pipes. Affected files ... .. //depot/projects/trustedbsd/netauditd/netauditd.c#3 edit Differences ... ==== //depot/projects/trustedbsd/netauditd/netauditd.c#3 (text+ko) ==== @@ -366,8 +366,10 @@ case NETAUDIT_DST_TRAIL: au->ac_fd = open(au->ac_path, O_WRONLY | O_APPEND | \ O_CREAT, S_IRUSR | S_IWUSR); - if (au->ac_fd == -1) + if (au->ac_fd == -1) { + warn("%s", au->ac_path); continue; + } au->ac_established = 1; break; case NETAUDIT_DST_NET: @@ -378,6 +380,7 @@ continue; if (connect(au->ac_fd, au->ac_ainfo->ai_addr, au->ac_ainfo->ai_addrlen) == -1) { + warn("connect"); close(au->ac_fd); continue; } @@ -463,6 +466,10 @@ exit(2); if ((new->ar_sbuf = malloc(NETAUDIT_PIPE_BUFSIZE)) == NULL) exit(2); + /* + * XXXCSJP: It is possible that the audit record will be greater then + * NETAUDIT_PIPE_BUFSIZE, in which case the pipe will truncate it. + */ new->ar_sbuflen = read(au->ac_fd, new->ar_sbuf, NETAUDIT_PIPE_BUFSIZE); if (new->ar_sbuflen == -1) { if (errno != EAGAIN)