LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-16-2004, 01:10 AM   #1
SiLiCoN
Member
 
Registered: Sep 2004
Location: India
Distribution: Solaris 9, FreeBSD 4.10, Slackware, RedHat, Knoppix,
Posts: 84

Rep: Reputation: 15
Nobody user?


hi all,
I am stuck up on another problem here and know this is the exact place where i can get help. The problem is - I have coded a perl script which connects to remote servers and downloads files on the remote server to the local machine. I dont have the root permission on the local machine. The script works fine and downloads the remote file without any problem, but when i run the perl script from the browser (which is the main intention of coding it), it downloads the file to the local server but sets the file owner as "nobody" (coz the program was run from the browser). This is really annoying coz i cant delete the file from the shell (as I am not the owner of the file, the owner of the file is "nobody") and if I have to delete the file or modify the permissions on it then I have to code a program again and run it from the browser to do that. All i can do is i can chmod the file to 777 through the program which downloads the file btu still i dont have the ownership . Is there any solution for avoiding this?

Thanks for your help in advance
 
Old 09-16-2004, 05:10 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
In the script, you can use the chown command to change the file ownership to your user. You can probably do this in native perl, but I'd just do:
Code:
system("chown user.group file");
Where user is the user you're running the browser as, group is the group to which that user belongs, and file is the filename.
 
Old 09-16-2004, 06:19 AM   #3
SiLiCoN
Member
 
Registered: Sep 2004
Location: India
Distribution: Solaris 9, FreeBSD 4.10, Slackware, RedHat, Knoppix,
Posts: 84

Original Poster
Rep: Reputation: 15
Thanks rjlee,

Yeah that will help....but I was looking for a way to set that from Linux (if atall posible). I know "chown" is not poss (as i m not r00t) but maybe there is some other alternative to it? But if there isnt then I ll have to do what u just said...

Thanks
 
Old 09-16-2004, 07:37 AM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
The usual way of doing this would be to have the report output the file to the browser (with an appropriate content-type header), then you can save the file from the browser with the right ownership.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Load kde profile from /mnt/removable/user instead of /home/user preacher.ca Linux - General 3 12-02-2005 04:00 PM
Samba -- XP user can log in to shares but smbclient user always gets password errors ejoe Linux - Software 3 04-18-2005 11:55 AM
grant user access to /fat-c & copying users' preferences to another user n0x Linux - Newbie 1 07-04-2004 01:04 AM
Games runs slow as normal user, but fast as root user mcore Linux - Software 2 06-08-2004 12:11 AM
Pleasehelp with proftpd.conf - trying to config user to write files as other user. philg Linux - Software 1 06-21-2003 01:13 PM


All times are GMT -5. The time now is 07:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration