[ale] Writing to file in PERL

Jim Kinney jim.kinney at gmail.com
Sat Mar 10 16:04:34 EST 2012


Ah! The user/process is blocked from writing there by selinux. Do ls -Z on
/opt and set application to match or chand dir to application or write a
custom rule.
On Mar 10, 2012 3:00 PM, "Terry Bailey" <terry at bitlinx.com> wrote:

>
> I will try that.  In the meantime I did
>
>
> /sbin/ausearch -m avc -ts today
>
> and got
>
> time->Sat Mar 10 13:38:27 2012
> type=SYSCALL msg=audit(1331404707.454:2672): arch=c000003e syscall=2
> success=no                                               exit=-13
> a0=93be570 a1=241 a2=1b6 a3=3c3acf3970 items=0 ppid=2406 pid=20207
> auid                                              =4294967295 uid=48 gid=48
> euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48
> tty=                                              (none) ses=4294967295
> comm="out.cgi" exe="/usr/bin/perl"
> subj=system_u:system_r:
> httpd_sys_script_t:s0 key=(null)
> type=AVC msg=audit(1331404707.454:2672): avc:  denied  { write } for
> pid=20207                                               comm="out.cgi"
> name="input" dev=dm-0 ino=9572505
> scontext=system_u:system_r:http
> d_sys_script_t:s0 tcontext=user_u:object_r:usr_t:s0 tclass=file
> ----
>
>
>
> At 02:39 PM 3/10/2012, you wrote:
>
> change it it to open (INPIPE '>/opt/input') or die "Can't open because $!
> \n"
>
> That will show error details.
>
> On Sat, Mar 10, 2012 at 2:07 PM, Terry Bailey <terry at bitlinx.com> wrote:
>  Hi,
>
> I cannot get PERL to write to a file. Â The file, named input, is set
> at 777 and I think the syntax in the script is correct. Â Does PERL
> require other permissions? I am runing centOS 5.4. Â The code is:
>
> open (INPIPE, '>/opt/input');
>
> print INPIPE "$data";
>
> close (INPIPE);
>
> Thank you in advance for your help.
>
> Terry
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
>  http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
>  http://mail.ale.org/mailman/listinfo
>
>
>
>
> --
> --
> James P. Kinney III
>
> As long as the general population is passive, apathetic, diverted to
> consumerism or hatred of the vulnerable, then the powerful can do as they
> please, and those who survive will be left to contemplate the outcome.
> - 2011 Noam Chomsky
>
>  http://heretothereideas.blogspot.com/
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
>  http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
>  http://mail.ale.org/mailman/listinfo
>
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20120310/6340ad17/attachment-0001.html 


More information about the Ale mailing list