Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Net::FTP::Recursive Permission and Ownership...

by insensate (Hermit)
on Apr 06, 2004 at 15:57 UTC ( [id://342987]=note: print w/replies, xml ) Need Help??


in reply to Net::FTP::Recursive Permission and Ownership...

From the libnet FAQ:
The FTP protocol does not have a command for changing the permissions of a file on the remote server. But some ftp servers may allow a chmod command to be issued via a SITE command, eg $ftp->quot('site chmod 0777',$filename); But this is not guaranteed to work.
Programmatically, I think you're going to hit a world of trouble trying to accomplish what you're trying to do... A hacky workaround would be to use Net::Telnet to go in after the files are at the remote site and issue the changes you desire... but that doesn't surmount the fact that most secure servers don't let users without superuser privledges chown files.

What is preventing you from logging into the remote host as the user you ultimatly want to own the files?

Replies are listed 'Best First'.
Re: Re: Net::FTP::Recursive Permission and Ownership...
by svnipp (Initiate) on Apr 07, 2004 at 16:59 UTC
    The general idea here is that the group I am currently in is being dumped on to push application code. I am working on some scripts to allow another group to actually perform this code push.

    Currently the process is to tar | remsh to files to each remote system. This requires root access, and some knowledge. I am trying to script an idiot proof method of performing this same thing. I am trying to use the Net::FTP::Recursive module to get the files over. I am beginning to wonder though if I my be better served in simply making a 'system' call to do the same tar|remsh method that we currently do. I have been trying to avoid this because I thought the ftp method would be more secure and possibly faster too.

    Once again, any suggestions/ideas are most appreciated. Thanks.

      I don't see why the process you describe requires root access... I think Net:FTP::Recursive is the perfect tool. If you have the access to do the remsh (I assume now you're on HP-UX) you should have the same access to the account you want owning the files on the remote system(s). As for changing the file permissions, that can be a simple script after you put the files out... using Net:SSH would be ideal. Avoid chmod -R though for obvious security reasons... I would instead build a list of files... maybe with the File::Find modules so you can chmod specific filenames/directories.
      use File::Find; sub process_file { push @files, $File::Find::name unless (-d); push @dirs, $File::Find::name if (-d) } find( \&process_file, "your src dir" );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://342987]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-23 06:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found