summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-06-18 12:26:46 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-06-18 12:26:46 +0300
commit920ad1e57ca64fe4e513eb32080250f3866da14f (patch)
treed4525770725b433af1b5352975d2fa8e6e78cfc1
parentcd76915e1cbdbc0608db830a74c4cc70c372b8df (diff)
downloadpaxutils-920ad1e57ca64fe4e513eb32080250f3866da14f.tar.gz
Minor fix.
* lib/rtapelib.c (rmt_open__): Return appropriate diagnostics if the host name cannot be resolved.
-rw-r--r--lib/rtapelib.c5
1 files changed, 4 insertions, 1 deletions
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;