Skip to content

Commit

Permalink
common/common.c: chroot_start(): log entering chroot jail (or inabili…
Browse files Browse the repository at this point in the history
…ty to do so)
  • Loading branch information
jimklimov committed Nov 1, 2022
1 parent 45e0a9b commit 5135f8b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,16 @@ void chroot_start(const char *path)
if (chroot(path))
fatal_with_errno(EXIT_FAILURE, "chroot(%s)", path);

#else
upsdebugx(1, "Can not chroot into %s: not implemented on this platform", path);
#endif

if (chdir("/"))
fatal_with_errno(EXIT_FAILURE, "chdir(/)");

#ifndef WIN32
upsdebugx(1, "chrooted into %s", path);
#endif
}

#ifdef WIN32
Expand Down

0 comments on commit 5135f8b

Please sign in to comment.