------------------------------------------------------------ revno: 11723 revision-id: squid3@treenet.co.nz-20121130132122-5g1uptychifuj555 parent: squid3@treenet.co.nz-20121130132010-2eo4zalbksm1zbru author: Andreas Jaeger committer: Amos Jeffries branch nick: 3.2 timestamp: Fri 2012-11-30 06:21:22 -0700 message: Fix OpenSUSE glibc 2.17 compile issues ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20121130132122-5g1uptychifuj555 # target_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_2 # testament_sha1: 6c7c356ee08b9caab31f7fb1d92d9beb23733906 # timestamp: 2012-11-30 13:26:53 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_2 # base_revision_id: squid3@treenet.co.nz-20121130132010-\ # 2eo4zalbksm1zbru # # Begin patch === modified file 'src/icmp/pinger.cc' --- src/icmp/pinger.cc 2012-02-05 06:09:46 +0000 +++ src/icmp/pinger.cc 2012-11-30 13:21:22 +0000 @@ -180,8 +180,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-07-28 05:38:50 +0000 +++ src/tools.cc 2012-11-30 13:21:22 +0000 @@ -754,10 +754,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); @@ -782,10 +782,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, 1, "no_suid: setuid: " << xstrerror()); + debugs(50, DBG_IMPORTANT, "ERROR: no_suid: setuid(" << uid << "): " << xstrerror()); restoreCapabilities(0);