[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] I/O error when filename has colons
From: |
Sergey Poznyakoff |
Subject: |
Re: [Bug-tar] I/O error when filename has colons |
Date: |
Thu, 19 Mar 2009 13:48:55 +0200 |
Hi Marcel,
> I understand why tar is complaining -- I know that when it sees colons
> in a filename it's expecting it to be in host:/file/name format -- but
> the error message it gives when I forget to properly escape colons in
> local filenames is frightening:
Yes, I agree. Please, try the attached patch.
Regards,
Sergey
diff --git a/lib/rtapelib.c b/lib/rtapelib.c
index 51faf3c..02ad1e7 100644
--- a/lib/rtapelib.c
+++ b/lib/rtapelib.c
@@ -425,7 +425,10 @@ rmt_open__ (const char *file_name, int open_mode, int bias,
}
/* FIXME: Should somewhat validate the decoding, here. */
-
+ if (gethostbyname (remote_host) == NULL)
+ error (EXIT_ON_EXEC_ERROR, 0, _("Cannot connect to %s: resolve failed"),
+ remote_host);
+
if (remote_user && *remote_user == '\0')
remote_user = 0;