On Fri, Dec 18, 2009 at 1:54 PM, John Admanski <[email protected]> wrote:
> Remove the chmod+chown done by Host.send_file at the end of a copy.
> It's generally unnecessary, and often wrong because it often tries to
> chmod a lot more than the copied files.
>
> Risk: Medium
> Visibility: The dest given to Host.send_file will no longer be
>    automatically made world-readable-executable.
>
> Signed-off-by: John Admanski <[email protected]>
>
> --- autotest/server/hosts/abstract_ssh.py       2009-12-18 13:54:05.000000000 
> -0800
> +++ autotest/server/hosts/abstract_ssh.py       2009-12-18 13:54:05.000000000 
> -0800
> @@ -284,11 +284,6 @@
>                 except error.CmdError, e:
>                     raise error.AutoservRunError(e.args[0], e.args[1])
>
> -        self.run('find "%s" -type d -print0 | xargs -0r chmod o+rx' % dest)
> -        self.run('find "%s" -type f -print0 | xargs -0r chmod o+r' % dest)
> -        if self.target_file_owner:
> -            self.run('chown -R %s %s' % (self.target_file_owner, dest))
> -
>
>     def ssh_ping(self, timeout=60):
>         try:

I'm hitting a very similar problem here with writeable files, and am
also recalling why
we did this originally.

Problem with writeable files: if you use scp, and we end up doing this
more than once,
it barfs when trying to write a read-only file the second time
(whether you use scp -p
or not, the file is created read-only on our end). Only real solution
I can think of right
now is to chmod all files and dirs o+w after copying them back, but I'm worried
about your other comments in here?

Recalling why we did this originally: Some files at the other end are
created without
read permissions, and if we copy them back and leave them without, we can't see
them afterwards.

I think we need to figure out some way of doing this more reliably.

Can you elaborate on why it tries to chmod a lot more than the copied
files ... you
mean if we overlay an existing directory tree with a new one?

We really want all files to end up with the default umask at our end,
AFAICS, ie the
explicit opposite of -p on scp? Anyone object to that as a goal?

My first thought on implementation is to copy into a temporary directory, chmod
and chown the results there, then use tar or cp -r to move things
around locally.
Thoughts?
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to