/dev/vcs include screen scrape for CMS application.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cspatter
Forum Newbie
Posts: 7
Joined: Fri Jul 08, 2005 1:28 pm

/dev/vcs include screen scrape for CMS application.

Post by cspatter »

In my error logs I get :
:evil: [client IP] PHP Warning: main(/dev/vcs6): failed to open stream: Success in /var/www/html/symon/format.php on line 8
:evil: [client IP] PHP Warning: main(): Failed opening '/dev/vcs6' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/symon/format.php on line 8

Any direction would be appreciated. Here is the code in the file:

Code: Select all

ob_start();        //start output buffering
include ("/dev/vcs6");    //all output goes to buffer
$buf = ob_get_contents();    //assign buffer to a variable
ob_end_clean();        //clear buffer and turn off output buffering
echo $buf;
I have set permissions to the vcs6 file of 644
Running centos4.2 / php-4.3.9-3.8 / httpd-2.0.52-19.ent.centos4
I have disabled SELinux.

Tried : Setting permissions to 777 and changing ownership of files.

This code works fine on another machine I have : RedHat8.0 / php-4.2.2-8.0.5 / httpd-2.0.40-8

Does anyone know if php changed security from 4.2 to 4.3 and what settings I might need to fix this stream issue or possibly a work around. Much Thanks!!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Hmmm... if it can't open it even with 777 that's odd.

What does ls -l list the file as?
cspatter
Forum Newbie
Posts: 7
Joined: Fri Jul 08, 2005 1:28 pm

Post by cspatter »

Code: Select all

[root@localhost html]# ls -l /dev/vcs?
crw-------  1 vcsa tty 7,   1 Oct 27 19:19 /dev/vcs1
crw-------  1 vcsa tty 7,   2 Oct 27 19:20 /dev/vcs2
crw-------  1 vcsa tty 7,   3 Oct 27 19:20 /dev/vcs3
crw-------  1 vcsa tty 7,   4 Oct 27 19:20 /dev/vcs4
crw-------  1 vcsa tty 7,   5 Oct 27 19:20 /dev/vcs5
crw-rw-r--  1 vcsa tty 7,   6 Oct 27 19:20 /dev/vcs6
crw-------  1 vcsa tty 7,   7 Oct 28 09:28 /dev/vcs7
crw-------  1 vcsa tty 7, 128 Oct 27 15:19 /dev/vcsa
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

:? So it should at least be readable wich it seems it is not. Odd. Not sure I can help you any further unless there's anything you can add that may be of interest. Sorry.
cspatter
Forum Newbie
Posts: 7
Joined: Fri Jul 08, 2005 1:28 pm

Post by cspatter »

I can read it just fine from all users on the box just not in php?????? EVEN apache CAN read it?!

[cspatter@localhost ~]$ cat /dev/vcs6
10/28/05 13:30 Avaya(TM) CMS Windows: 1 of 5 ^^^v Custom Reports: Real-Time: SYMON-CMS ALDERMAN_ACD1 SPLIT CIQ LCW ACD ACW STF ABN ASA SVL STAFFTIME 2 0 :00 0 0 3 0 5373 14 0 :00 2 4 13 1 42 0 23283 19 0 :00 1 1 7 5 89 0 12537 22 0 :00 0 0 3 0 5373 34 0 :00 0 0 0 0 57 0 :00 0 0 3 0 5373 201 1 :02 3 5 13 10 29 0 23283 207 0 :00 1 0 2 0 0 3582 Successful Help Window Commands Keep Exit Scroll Current MainMenu
[cspatter@localhost ~]$
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

cspatter wrote:I can read it just fine from all users on the box just not in php?????? EVEN apache CAN read it?!

[cspatter@localhost ~]$ cat /dev/vcs6
10/28/05 13:30 Avaya(TM) CMS Windows: 1 of 5 ^^^v Custom Reports: Real-Time: SYMON-CMS ALDERMAN_ACD1 SPLIT CIQ LCW ACD ACW STF ABN ASA SVL STAFFTIME 2 0 :00 0 0 3 0 5373 14 0 :00 2 4 13 1 42 0 23283 19 0 :00 1 1 7 5 89 0 12537 22 0 :00 0 0 3 0 5373 34 0 :00 0 0 0 0 57 0 :00 0 0 3 0 5373 201 1 :02 3 5 13 10 29 0 23283 207 0 :00 1 0 2 0 0 3582 Successful Help Window Commands Keep Exit Scroll Current MainMenu
[cspatter@localhost ~]$
The apache user should be what php runs under actually. PHP doesn't use it's own uid to my knowledge. If you run CLI apps in PHP they run under the ID of the user executing them. I wouldn't know what I'm looking at with those file contents but perhaps someone else can spot something? :)
Post Reply