------------------------------------------------------------ revno: 12408 revision-id: squid3@treenet.co.nz-20121124035151-vs4xy4d3okj943hu parent: squid3@treenet.co.nz-20121124035014-givrsd2vk1gh78yt author: Andreas Jaeger committer: Amos Jeffries branch nick: 3.3 timestamp: Fri 2012-11-23 20:51:51 -0700 message: Fix OpenSUSE glibc 2.17 compile issues ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20121124035151-vs4xy4d3okj943hu # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: b31178217bdc0d6535bc72697eecb4079dc8b720 # timestamp: 2012-11-24 03:53:43 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20121124035014-\ # givrsd2vk1gh78yt # # Begin patch === modified file 'src/icmp/pinger.cc' --- src/icmp/pinger.cc 2012-09-01 14:38:36 +0000 +++ src/icmp/pinger.cc 2012-11-24 03:51:51 +0000 @@ -179,8 +179,18 @@ } max_fd = max(max_fd, squid_link); - setgid(getgid()); - setuid(getuid()); + if (setgid(getgid()) < 0) { + debugs(42, DBG_CRITICAL, "FATAL: pinger: setgid(" << getgid() << ") failed: " << xstrerror()); + icmp4.Close(); + icmp6.Close(); + exit (1); + } + if (setuid(getuid()) < 0) { + debugs(42, DBG_CRITICAL, "FATAL: pinger: setuid(" << getuid() << ") failed: " << xstrerror()); + icmp4.Close(); + icmp6.Close(); + exit (1); + } last_check_time = squid_curtime; === modified file 'src/tools.cc' --- src/tools.cc 2012-10-04 13:01:09 +0000 +++ src/tools.cc 2012-11-24 03:51:51 +0000 @@ -663,10 +663,10 @@ void enter_suid(void) { - debugs(21, 3, "enter_suid: PID " << getpid() << " taking root priveleges"); + debugs(21, 3, "enter_suid: PID " << getpid() << " taking root privileges"); #if HAVE_SETRESUID - - setresuid((uid_t)-1, 0, (uid_t)-1); + if (setresuid((uid_t)-1, 0, (uid_t)-1) < 0) + debugs (21, 3, "enter_suid: setresuid failed: " << xstrerror ()); #else setuid(0); @@ -691,10 +691,11 @@ uid = geteuid(); debugs(21, 3, "no_suid: PID " << getpid() << " giving up root priveleges forever"); - setuid(0); + if (setuid(0) < 0) + debugs(50, DBG_IMPORTANT, "WARNING: no_suid: setuid(0): " << xstrerror()); if (setuid(uid) < 0) - debugs(50, DBG_IMPORTANT, "no_suid: setuid: " << xstrerror()); + debugs(50, DBG_IMPORTANT, "ERROR: no_suid: setuid(" << uid << "): " << xstrerror()); restoreCapabilities(0);