diff options
author | smitsohu <smitsohu@gmail.com> | 2021-02-25 00:05:19 +0100 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2021-02-25 00:10:04 +0100 |
commit | e7eaf95c0cdbc36aeda5828b10a2e424ed10f3c2 (patch) | |
tree | 7769937cd8584bef2ab299a8cb76148520655e8c /src/fcopy/main.c | |
parent | fcopy: fixes for old compilers, cppcheck fixes (#3998) (diff) | |
download | firejail-e7eaf95c0cdbc36aeda5828b10a2e424ed10f3c2.tar.gz firejail-e7eaf95c0cdbc36aeda5828b10a2e424ed10f3c2.tar.zst firejail-e7eaf95c0cdbc36aeda5828b10a2e424ed10f3c2.zip |
musl fix (#3998)
musl stdlib (Alpine Linux) doesn't know about canonicalize_file_name,
replace with equivalent realpath calls
Diffstat (limited to 'src/fcopy/main.c')
-rw-r--r-- | src/fcopy/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fcopy/main.c b/src/fcopy/main.c index f69448b67..572e9f601 100644 --- a/src/fcopy/main.c +++ b/src/fcopy/main.c | |||
@@ -178,7 +178,7 @@ static char *proc_pid_to_self(const char *target) { | |||
178 | char *use_target = 0; | 178 | char *use_target = 0; |
179 | char *proc_pid = 0; | 179 | char *proc_pid = 0; |
180 | 180 | ||
181 | if (!(use_target = canonicalize_file_name(target))) | 181 | if (!(use_target = realpath(target, NULL))) |
182 | goto done; | 182 | goto done; |
183 | 183 | ||
184 | // target is under /proc/<PID>? | 184 | // target is under /proc/<PID>? |
@@ -192,7 +192,7 @@ static char *proc_pid_to_self(const char *target) { | |||
192 | 192 | ||
193 | // check where /proc/self points to | 193 | // check where /proc/self points to |
194 | static const char proc_self[] = "/proc/self"; | 194 | static const char proc_self[] = "/proc/self"; |
195 | if (!(proc_pid = canonicalize_file_name(proc_self))) | 195 | if (!(proc_pid = realpath(proc_self, NULL))) |
196 | goto done; | 196 | goto done; |
197 | 197 | ||
198 | // redirect /proc/PID/xxx -> /proc/self/XXX | 198 | // redirect /proc/PID/xxx -> /proc/self/XXX |