From c7aca5f09c81aa2455fed0ed73e15216dfa06857 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 1 Sep 2020 01:33:28 -0400 Subject: Only call realpath when path is relative --- multihome.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/multihome.c b/multihome.c index 8ef736b..d6da415 100644 --- a/multihome.c +++ b/multihome.c @@ -255,9 +255,11 @@ void write_init_script() { FILE *fp; // Determine the absolute path of this program - if (realpath(multihome.entry_point, buf) < 0) { - perror(multihome.entry_point); - exit(errno); + if (multihome.entry_point[0] != '/') { + if (realpath(multihome.entry_point, buf) < 0) { + perror(multihome.entry_point); + exit(errno); + } } // Open init script for writing -- cgit