On Tuesday 29 September 2015 12:55:31 Richard W.M. Jones wrote:
On Tue, Sep 29, 2015 at 11:38:52AM +0200, Pino Toscano wrote:
--- src/copy-in-out.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/src/copy-in-out.c b/src/copy-in-out.c index 0dd8cd3..2b1e4d4 100644 --- a/src/copy-in-out.c +++ b/src/copy-in-out.c @@ -47,6 +47,12 @@ guestfs_impl_copy_in (guestfs_h *g, const char *localpath, const char *remotedir char buf[buf_len]; const char *dirname, *basename; CLEANUP_FREE char *tar_buf = NULL; + struct stat statbuf; + + if (stat (localpath, &statbuf) == -1) { + error (g, _("source '%s' does not exist (or cannot be read)"), localpath); + return -1; + }
int remote_is_dir = guestfs_is_dir (g, remotedir); if (remote_is_dir == -1)
NACK. See the patch series I just posted.
Would patch #2 be acceptable anyway, as simple starting check? -- Pino Toscano