There is a known problem with Linux and Threads and Setuid, all together.
If you setuid while running a threaded Tcl, then a number of
system-related threads do not also change their uid.  Threads with
different user IDs cannot signal each other (done under the covers
by the Linux pthread library) and so things deadlock.

Its rather complex to fix this, although it has been done for AOLserver
using a separate "binding" thread that listens on privileged ports.

>>>[EMAIL PROTECTED] said:
 > Hi,
 > 
 > I'm using  Linux 2.2.16, tclhttpd3.0.3 and tcl8.4.  Setuid (as compiled, fro
     m 
 > source) doesn't seem to work as I'd expect.
 > 
 > Here's what I've narrowed it down to:
 > 
 > sharedtech:/home/colin/Desktop/tclhttpdtest# tclsh8.4
 > % package require setuid
 > 1.0
 > % setuid 33
 > % whoami
 > www-data
 > % exit
 > 
 > At this point, it hangs (after exit, never terminating.)
 > 
 > The other symptom I noticed is that no fileevents seemed to trigger.  This 
 > prevents my use of tclhttpd in setuid mode, so I'll either have to run as ro
     ot 
 > (and damn the consequences) or use a non-standard port.
 > 
 > I suspect, strongly, some adverse interaction between threads and the 
 > setuid.so, although I'm not sure what.  Note that I've compiled these from 
 > source.
 > 
 > Colin.
 > 
 > 
 > 
 > 

--      Brent Welch     <[EMAIL PROTECTED]>
        http://www.ajubasolutions.com
        Scriptics changes to Ajuba Solutions
        scriptics.com => ajubasolutions.com


Reply via email to