You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Eric Jain <Er...@isb-sib.ch> on 2007/08/30 17:44:55 UTC
SCP Task & umask
According to http://ant.apache.org/manual/OptionalTasks/scp.html, "File
permissions are not retained when files are copied; they end up with the
default UMASK permissions instead". That would suite me just fine: I'm
copying files from a Windows machine to a Linux machine, where I have
`umask 0007` in my .bashrc. However, the files always end up with
-rw-r----- instead of -rw-rw----, as I would expect, and if I set umask
0000 I get -rw-r--r-- (so it does appear to be picked up). Any ideas?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: SCP Task & umask
Posted by Eric Jain <Er...@isb-sib.ch>.
Atsuhiko Yamanaka wrote:
> I have not tried it by myself yet, but it seems scp1 protocol allows
> us to choose
> the umask in sending files and creating directories.
>
> In the class,
> org.apache.tools.ant.taskdefs.optional.ssh.ScpToMessage
> the method 'sendFileToRemote' has explicitly chosen '0644'.
>
> As for the scp by sftp protocol, we will be able to use sftp's 'chmod'
> after uploading
> files.
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43271>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: SCP Task & umask
Posted by Steve Loughran <st...@apache.org>.
Atsuhiko Yamanaka wrote:
> Hi,
>
> 2007/8/31, Anderson, Rob (Global Trade) <Ro...@nike.com>:
>> The default umask is determined by the ssh server. I think it is set at
>> compile time. Same with $PATH. Your .bashrc is not read when you use
>> scp. You should see the same results when using scp on the command line.
>
> I have not tried it by myself yet, but it seems scp1 protocol allows
> us to choose
> the umask in sending files and creating directories.
>
> In the class,
> org.apache.tools.ant.taskdefs.optional.ssh.ScpToMessage
> the method 'sendFileToRemote' has explicitly chosen '0644'.
so we could extend ant to allow for umasks to be set? This could be very
useful. I normally go in afterwards and chmod stuff -didnt know it could
be done by scp itself.
>
> As for the scp by sftp protocol, we will be able to use sftp's 'chmod'
> after uploading
> files.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
--
Steve Loughran http://www.1060.org/blogxter/publish/5
Author: Ant in Action http://antbook.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: SCP Task & umask
Posted by Atsuhiko Yamanaka <at...@gmail.com>.
Hi,
2007/8/31, Anderson, Rob (Global Trade) <Ro...@nike.com>:
> The default umask is determined by the ssh server. I think it is set at
> compile time. Same with $PATH. Your .bashrc is not read when you use
> scp. You should see the same results when using scp on the command line.
I have not tried it by myself yet, but it seems scp1 protocol allows
us to choose
the umask in sending files and creating directories.
In the class,
org.apache.tools.ant.taskdefs.optional.ssh.ScpToMessage
the method 'sendFileToRemote' has explicitly chosen '0644'.
As for the scp by sftp protocol, we will be able to use sftp's 'chmod'
after uploading
files.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: SCP Task & umask
Posted by "Anderson, Rob (Global Trade)" <Ro...@nike.com>.
The default umask is determined by the ssh server. I think it is set at
compile time. Same with $PATH. Your .bashrc is not read when you use
scp. You should see the same results when using scp on the command line.
-Rob Anderson
> -----Original Message-----
> From: Eric Jain [mailto:Eric.Jain@isb-sib.ch]
> Sent: Thursday, August 30, 2007 8:45 AM
> To: user@ant.apache.org
> Subject: SCP Task & umask
>
> According to
> http://ant.apache.org/manual/OptionalTasks/scp.html, "File
> permissions are not retained when files are copied; they end
> up with the default UMASK permissions instead". That would
> suite me just fine: I'm copying files from a Windows machine
> to a Linux machine, where I have `umask 0007` in my .bashrc.
> However, the files always end up with
> -rw-r----- instead of -rw-rw----, as I would expect, and if I
> set umask 0000 I get -rw-r--r-- (so it does appear to be
> picked up). Any ideas?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> additional commands, e-mail: user-help@ant.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org