diff options
author | Thomas Habets <habets@google.com> | 2019-11-01 14:24:09 +0000 |
---|---|---|
committer | Thomas Habets <habets@google.com> | 2019-11-01 14:24:09 +0000 |
commit | df25403a68d926f25ecf93cc9b9ea71744791cb6 (patch) | |
tree | 5b271679e95a0e3702e42f13d96850aeb5769ac4 | |
parent | 92c9786127df61d49cbbff7b5d2b231414e373ef (diff) | |
download | arping-df25403a68d926f25ecf93cc9b9ea71744791cb6.tar.gz |
chdir('/') after chroot()
-rw-r--r-- | src/arping.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/arping.c b/src/arping.c index 5473dfb..917efec 100644 --- a/src/arping.c +++ b/src/arping.c @@ -245,6 +245,12 @@ drop_fs_root() } return; } + if (chdir("/")) { + if (verbose) { + printf("arping: chdir(/): %s\n", strerror(errno)); + } + return; + } if (verbose > 1) { printf("arping: Successfully chrooted to %s\n", pw->pw_dir); } |