Author: dmeyer
Date: Sun Feb 11 10:13:58 2007
New Revision: 2478
Modified:
trunk/base/src/tmpfile.py
Log:
Respect TMPDIR env and don't care about extra flags in the
mode like the sticky bit as long as group and others have
no read, write and execute rights.
Modified: trunk/base/src/tmpfile.py
==============================================================================
--- trunk/base/src/tmpfile.py (original)
+++ trunk/base/src/tmpfile.py Sun Feb 11 10:13:58 2007
@@ -5,15 +5,17 @@
__all__ = [ 'tempfile' ]
TEMP = '/tmp/kaa-%s' % os.getuid()
+if os.environ.get('TMPDIR'):
+ TEMP = os.path.join(os.environ['TMPDIR'], 'kaa-%s' % os.getuid())
if os.path.isdir(TEMP):
# temp dir is already there, check permissions
if os.path.islink(TEMP):
- raise IOError('Security Error: %s is a link, aborted')
- if stat.S_IMODE(os.stat(TEMP)[stat.ST_MODE]) != 0700:
- raise IOError('Security Error: %s has wrong permissions, aborted')
+ raise IOError('Security Error: %s is a link, aborted' % TEMP)
+ if stat.S_IMODE(os.stat(TEMP)[stat.ST_MODE]) % 01000 != 0700:
+ raise IOError('Security Error: %s has wrong permissions, aborted' %
TEMP)
if os.stat(TEMP)[stat.ST_UID] != os.getuid():
- raise IOError('Security Error: %s does not belong to you, aborted')
+ raise IOError('Security Error: %s does not belong to you, aborted' %
TEMP)
else:
os.mkdir(TEMP, 0700)
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog