Connecting Tech Pros Worldwide Help | Site Map

CHMOD help

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 10th, 2005, 07:05 AM
Freebird
Guest
 
Posts: n/a
Default CHMOD help

Hello everyone, =]


I need your help,

I'm creating a script that will work in many servers, and there's this part,
where you can update a list, so the script goes from the client's machine to
the central server, opens the file, and in adda line by line in the client
server, it's all working fine, but there's a problem, this list, can't be
available to others, because if I do this:


www.test.com/list/test.txt

I can see the hole list, if I remove the permissions, my script wont work
anymore, what can I do ?

I've thought that I could chmod the file to 0777, make it a copy, and remove
the permission, so the file would't be available for others that just enter
the URL.
But it doesn't work at all, here's the error I get:


Warning: chmod(): Unable to access www.test.com/proxy/ in
/home/test/public_html/clicksentinel/form_classes.php on line 859

Warning: chmod(): No such file or directory in
/home/test/public_html/clicksentinel/form_classes.php on line 859
Sorry, try again later, error at data number5You have an error in your SQL
syntax. Check the manual that corresponds to your MySQL server version for
the right syntax to use near 't have permission to access
/proxy/proxylist.txt')' at line 1


Please, I really need some help,

tks a lot

Freebird



  #2  
Old November 10th, 2005, 04:25 PM
Gordon Burditt
Guest
 
Posts: n/a
Default Re: CHMOD help

>I'm creating a script that will work in many servers, and there's this part,[color=blue]
>where you can update a list, so the script goes from the client's machine to
>the central server, opens the file, and in adda line by line in the client
>server, it's all working fine, but there's a problem, this list, can't be
>available to others, because if I do this:
>
>
>www.test.com/list/test.txt[/color]

You pass an *ABSOLUTE FILE PATHNAME* to chmod. Not a URL.
[color=blue]
>I can see the hole list, if I remove the permissions, my script wont work
>anymore, what can I do ?
>
>I've thought that I could chmod the file to 0777, make it a copy, and remove
>the permission, so the file would't be available for others that just enter
>the URL.[/color]

If you're expecting security, this won't work, because as long as the
file has the permissions on, someone *could* fetch it.
[color=blue]
>But it doesn't work at all, here's the error I get:
>
>
>Warning: chmod(): Unable to access www.test.com/proxy/ in
>/home/test/public_html/clicksentinel/form_classes.php on line 859
>
>Warning: chmod(): No such file or directory in
>/home/test/public_html/clicksentinel/form_classes.php on line 859
>Sorry, try again later, error at data number5You have an error in your SQL
>syntax. Check the manual that corresponds to your MySQL server version for
>the right syntax to use near 't have permission to access
>/proxy/proxylist.txt')' at line 1[/color]

You have a file with that long, complicated filename that includes
a bunch of newlines and the text of MySQL error messages in the name?
[color=blue]
>Please, I really need some help,[/color]

Output the file name before passing it to chmod(). Verify that it
is correct.

Gordon L. Burditt
  #3  
Old November 11th, 2005, 05:45 AM
Tim Roberts
Guest
 
Posts: n/a
Default Re: CHMOD help

"Freebird" <peoplel@hotmail.com> wrote:[color=blue]
>
>Hello everyone, =]
>I need your help,
>
>I'm creating a script that will work in many servers, and there's this part,
>where you can update a list, so the script goes from the client's machine to
>the central server, opens the file, and in adda line by line in the client
>server, it's all working fine, but there's a problem, this list, can't be
>available to others, because if I do this:
>
>www.test.com/list/test.txt
>
>I can see the hole list, if I remove the permissions, my script wont work
>anymore, what can I do ?[/color]

Why don't you put the file in some other location, outside of the web site?

Barring that, you should be able to use a .htaccess file to make the file
invisible to browsers.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.