"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "conv.c" between
darkstat-3.0.719.tar.gz and darkstat-3.0.721.tar.gz

About: darkstat is a network traffic analyzer (reports over HTTP).

conv.c  (darkstat-3.0.719):conv.c  (darkstat-3.0.721)
skipping to change at line 307 skipping to change at line 307
if (pw == NULL) { if (pw == NULL) {
if (errno == 0) if (errno == 0)
errx(1, "getpwnam(\"%s\") failed: no such user", privdrop_user); errx(1, "getpwnam(\"%s\") failed: no such user", privdrop_user);
else else
err(1, "getpwnam(\"%s\") failed", privdrop_user); err(1, "getpwnam(\"%s\") failed", privdrop_user);
} }
if (chroot_dir == NULL) { if (chroot_dir == NULL) {
verbosef("no --chroot dir specified, darkstat will not chroot()"); verbosef("no --chroot dir specified, darkstat will not chroot()");
} else { } else {
tzset(); /* read /etc/localtime before we chroot */ /* Read /etc/localtime before we chroot. This works on FreeBSD but not
if (chdir(chroot_dir) == -1) * on Linux / with glibc (as of 2.22) */
err(1, "chdir(\"%s\") failed", chroot_dir); tzset();
if (chroot(chroot_dir) == -1) if (chroot(chroot_dir) == -1)
err(1, "chroot(\"%s\") failed", chroot_dir); err(1, "chroot(\"%s\") failed", chroot_dir);
if (chdir("/") == -1)
err(1, "chdir(\"/\") failed");
verbosef("chrooted into: %s", chroot_dir); verbosef("chrooted into: %s", chroot_dir);
} }
{ {
gid_t list[1]; gid_t list[1];
list[0] = pw->pw_gid; list[0] = pw->pw_gid;
if (setgroups(1, list) == -1) if (setgroups(1, list) == -1)
err(1, "setgroups"); err(1, "setgroups");
} }
if (setgid(pw->pw_gid) == -1) if (setgid(pw->pw_gid) == -1)
err(1, "setgid"); err(1, "setgid");
 End of changes. 2 change blocks. 
3 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)