aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2019-09-29 19:26:29 +0200
committerLibravatar smitsohu <smitsohu@gmail.com>2019-09-29 19:26:29 +0200
commit13305e4937dd1d48b8e11c03288f1f170d4c8d7d (patch)
treeb98eeac3572dc37f00822f74f0849d0f0f5f48b5 /src
parentchroot module (diff)
downloadfirejail-13305e4937dd1d48b8e11c03288f1f170d4c8d7d.tar.gz
firejail-13305e4937dd1d48b8e11c03288f1f170d4c8d7d.tar.zst
firejail-13305e4937dd1d48b8e11c03288f1f170d4c8d7d.zip
improve variable names
Diffstat (limited to 'src')
-rw-r--r--src/firejail/chroot.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/firejail/chroot.c b/src/firejail/chroot.c
index c99af1d52..4eff84494 100644
--- a/src/firejail/chroot.c
+++ b/src/firejail/chroot.c
@@ -141,14 +141,14 @@ static void copy_resolvconf(int parentfd) {
141 fwarning("/etc/resolv.conf not initialized\n"); 141 fwarning("/etc/resolv.conf not initialized\n");
142 return; 142 return;
143 } 143 }
144 struct stat instat; 144 struct stat src;
145 if (fstat(in, &instat) == -1) 145 if (fstat(in, &src) == -1)
146 errExit("fstat"); 146 errExit("fstat");
147 // try to detect if resolv.conf has been bind mounted into the chroot 147 // try to detect if resolv.conf has been bind mounted into the chroot
148 // do nothing in this case in order to not truncate the real file 148 // do nothing in this case in order to not truncate the real file
149 struct stat outstat; 149 struct stat dst;
150 if (fstatat(parentfd, "etc/resolv.conf", &outstat, 0) == 0) { 150 if (fstatat(parentfd, "etc/resolv.conf", &dst, 0) == 0) {
151 if (instat.st_dev == outstat.st_dev && instat.st_ino == outstat.st_ino) { 151 if (src.st_dev == dst.st_dev && src.st_ino == dst.st_ino) {
152 close(in); 152 close(in);
153 return; 153 return;
154 } 154 }
@@ -158,7 +158,7 @@ static void copy_resolvconf(int parentfd) {
158 int out = openat(parentfd, "etc/resolv.conf", O_CREAT|O_WRONLY|O_TRUNC|O_CLOEXEC, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH); 158 int out = openat(parentfd, "etc/resolv.conf", O_CREAT|O_WRONLY|O_TRUNC|O_CLOEXEC, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH);
159 if (out == -1) 159 if (out == -1)
160 errExit("open"); 160 errExit("open");
161 if (sendfile(out, in, NULL, instat.st_size) == -1) 161 if (sendfile(out, in, NULL, src.st_size) == -1)
162 errExit("sendfile"); 162 errExit("sendfile");
163 close(in); 163 close(in);
164 close(out); 164 close(out);