diff options
author | Harald Hoyer <harald@redhat.com> | 2012-07-26 19:21:06 +0200 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2012-07-26 19:35:00 +0200 |
commit | 78021eace175745792f04345efe2d42218f0bb59 (patch) | |
tree | e2386d2d37b769e0f3767012cc8a67440bcd1289 /install | |
parent | 65d1a8a4aee600f7d5016382dd351bf9b835327f (diff) | |
download | dracut-78021eace175745792f04345efe2d42218f0bb59.tar.gz dracut-78021eace175745792f04345efe2d42218f0bb59.tar.bz2 dracut-78021eace175745792f04345efe2d42218f0bb59.zip |
install/dracut-install.c: convert destrootdir to realpath
otherwise we get strange errors if it ends with a slash and does not
exist.
Diffstat (limited to 'install')
-rw-r--r-- | install/dracut-install.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/install/dracut-install.c b/install/dracut-install.c index 93514725..e79065dd 100644 --- a/install/dracut-install.c +++ b/install/dracut-install.c @@ -517,6 +517,7 @@ Install SOURCE to DEST in DESTROOTDIR with all needed dependencies.\n\ -h --help Show this help\n\ \n\ Example:\n\ +# mkdir -p /var/tmp/test-root\n\ # %s -D /var/tmp/test-root --ldd -a sh tr\n\ # tree /var/tmp/test-root\n\ /var/tmp/test-root\n\ @@ -742,8 +743,16 @@ int main(int argc, char **argv) if (strcmp(destrootdir, "/") == 0) { log_error("Environment DESTROOTDIR or argument -D is set to '/'!"); usage(EXIT_FAILURE); + } + i = destrootdir; + destrootdir = realpath(destrootdir, NULL); + if (!destrootdir) { + log_error("Environment DESTROOTDIR or argument -D is set to '%s': %m", i); + r = EXIT_FAILURE; + goto finish; } + free(i); items = hashmap_new(string_hash_func, string_compare_func); items_failed = hashmap_new(string_hash_func, string_compare_func); |