Whether you use scp -p or not, scp'ing a file with read-only permissions 
seems to preserve them, hence a second scp will fail when trying to overwrite.

In order to fix this, we really need to change the general send/get file
routines to fix permissions whilst copying, but for now the main culprit is
sysinfo. We can fix this very easily by not making those file copies readonly
in the first place, until we fix the main send/get routines.

We're using shutil.copy in here, which is defined as:

def copy(src, dst):
    """Copy data and mode bits ("cp src dst").

    The destination may be a directory.

    """
    if os.path.isdir(dst):
        dst = os.path.join(dst, os.path.basename(src))
    copyfile(src, dst)
    copymode(src, dst)

We already know the destination is a directory, so we don't need that bit.
A straight substitution of copyfile for copy will work fine here.

Tested, and verified to fix the issue.

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@4059 592f7852-d20e-0410-864c-8624ca9c26a4
1 file changed