From: =?GB2312?B?s8K94LWk?= Subject: The plugin didnot work Date: Fri, 25 Dec 2009 16:49:39 +0800 Message-ID: <246d04460912250049h372d987gd07d258d5a9dba55@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5705340522077815316==" Return-path: Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.10]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBP8nuDF017620 for ; Fri, 25 Dec 2009 03:49:56 -0500 Received: from mail-yx0-f183.google.com (mail-yx0-f183.google.com [209.85.210.183]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBP8nefL028367 for ; Fri, 25 Dec 2009 03:49:40 -0500 Received: by yxe13 with SMTP id 13so7842222yxe.23 for ; Fri, 25 Dec 2009 00:49:40 -0800 (PST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com List-Id: linux-audit@redhat.com --===============5705340522077815316== Content-Type: multipart/alternative; boundary=00163691fd40dd6d87047b89a2b0 --00163691fd40dd6d87047b89a2b0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable Hello every one. My plugin now works well in the debug mode,I.E. using *cat log | ./audisp-example* it works well But it failed when I did not use the debug mode. Here it's the code that I have changed. /* This function shows how to dump a whole record's text */ static void dump_whole_record(auparse_state_t *au) { FILE *out; if((out=3Dfopen("./test.txt","a+"))!=3DNULL)/*=B4=F2=BF=AA=D4=B4=CE=C4= =BC=FE=A3=AC=B6=C1=C8=A1=CA=FD=BE=DD*/ { fprintf(out,"%s: %s\n", audit_msg_type_to_name(auparse_get_type(au)),auparse_get_record_text(au)); fclose(in); /*=B9=D8=CE=C4=BC=FE*/ } // printf("%s: %s\n", audit_msg_type_to_name(auparse_get_type(au)),auparse_get_record_text(au)); //printf("\n"); } In the debug mode I'm able to create a test.txt in the current direcory .An= d write the information into the test.txt But when I copy the audisp-example to /sbin/, and copy the configure file audisp-example.conf to /etc//etc/audisp/plugins.d restart the auditd, it didnot work. Why? Can anyone help Regards Jeedan --=20 ----------------------------- =B3=C2=BD=E0=B5=A4 =B1=B1=BE=A9=D3=CA=B5=E7=B4=F3=D1=A7=C8=ED=BC=FE=D1=A7= =D4=BA =B5=D8 =D6=B7=A3=BA =B1=B1=BE=A9=D3=CA=B5=E7=B4=F3=D1=A7=D1=A7=B6=FED12=C7= =DE=CA=D2 =D3=CA =B1=E0=A3=BA 100876 Email: jeedan.chen@gmail.com --------------------------------- --=20 ----------------------------- =B3=C2=BD=E0=B5=A4 =B1=B1=BE=A9=D3=CA=B5=E7=B4=F3=D1=A7=C8=ED=BC=FE=D1=A7= =D4=BA =B5=D8 =D6=B7=A3=BA =B1=B1=BE=A9=D3=CA=B5=E7=B4=F3=D1=A7=D1=A7=B6=FED12=C7= =DE=CA=D2 =D3=CA =B1=E0=A3=BA 100876 Email: jeedan.chen@gmail.com --------------------------------- --00163691fd40dd6d87047b89a2b0 Content-Type: text/html; charset=GB2312 Content-Transfer-Encoding: quoted-printable
Hello every one.
My plugin now works well in the debug mode,I.E. using  cat log= | ./audisp-example it works well
But it failed when I did not use the debug mode.
 
 
Here it's the code that I have changed.
 
/* This function shows how to dump a whole record's text */
sta= tic void dump_whole_record(auparse_state_t *au)
{
    = FILE *out;
    if((out=3Dfopen("./test.txt",&q= uot;a+"))!=3DNULL)/*=B4=F2=BF=AA=D4=B4=CE=C4=BC=FE=A3=AC=B6=C1=C8=A1= =CA=FD=BE=DD*/
    {    
    &n= bsp; fprintf(out,"%s: %s\n", audit_msg_type_to_name(auparse_get_t= ype(au)),auparse_get_record_text(au));
      fc= lose(in); /*=B9=D8=CE=C4=BC=FE*/
    }

  // printf("%s: %s\n", audit_msg_type_to= _name(auparse_get_type(au)),auparse_get_record_text(au));
  //print= f("\n");
}
 
 
In the debug mode I'm able to create a test.txt in the current dir= ecory .And write the information into the test.txt
But when I copy the audisp-example to /sbin/,  and copy the confi= gure file audisp-example.conf  to /etc//etc/audisp/plugins.d
restart the auditd, it didnot work.
 
Why?
Can anyone help
 
  Regards
     &nb= sp;            =             &nb= sp;            =             &nb= sp;            =      Jeedan
--
-----------------------------
= =B3=C2=BD=E0=B5=A4   =B1=B1=BE=A9=D3=CA=B5=E7=B4=F3=D1=A7=C8=ED=BC=FE= =D1=A7=D4=BA
=B5=D8 =D6=B7=A3=BA  =B1=B1=BE=A9=D3=CA=B5=E7=B4=F3=D1= =A7=D1=A7=B6=FED12=C7=DE=CA=D2
=D3=CA =B1=E0=A3=BA  100876
Email= :   jeedan.chen@gmail.com=
---------------------------------
--
-----------------------------=B3=C2=BD=E0=B5=A4   =B1=B1=BE=A9=D3=CA=B5=E7=B4=F3=D1=A7=C8=ED=BC= =FE=D1=A7=D4=BA
=B5=D8 =D6=B7=A3=BA  =B1=B1=BE=A9=D3=CA=B5=E7=B4=F3= =D1=A7=D1=A7=B6=FED12=C7=DE=CA=D2
=D3=CA =B1=E0=A3=BA  100876
Em= ail:   jeedan.chen@gmail.com<= /a>
---------------------------------
--00163691fd40dd6d87047b89a2b0-- --===============5705340522077815316== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============5705340522077815316==--