File syslog-ng-chroot_CVE-2008-5110.dif of Package syslog-ng
--- src/main.c +++ src/main.c 2008/11/18 16:51:25 @@ -279,6 +279,13 @@ { if (chroot_dir) { + if (chdir(chroot_dir) < 0) + { + msg_error("Error during chdir into chroot", + evt_tag_errno(EVT_TAG_OSERROR, errno), + NULL); + return 0; + } if (chroot(chroot_dir) < 0) { msg_error("Error during chroot()", @@ -286,6 +293,7 @@ NULL); return 0; } + chdir("/"); } if (uid || gid || run_as_user)