Is this a bug? [os.getcwd in combination with Access Control Lists]
Joakim Hove
hove at phys.ntnu.no
Fri Nov 10 03:47:38 EST 2000
Hello,
I am working together with a colleague on SGI computer with IRIX64
version 6.5. To work together with a set of common source files we
have made a directory "Common" under my colleagues home directory. We
have used ACL [Access Controll Lists] on this directory, and all it's
under directories, to the effect that we both have the same permissions
to all file operations under this path, even though it strictly
resides under my colleagues home directory - where I generally have no
permissions whatsoever.
However, when I run the following little Python program from within
this Common directory, the os.getcwd() command fails:
#!/home/u1/hove/Python/bin/python
import os
inputfile = open("Global.f90","r")
lineList = inputfile.readlines()
inputfile.close()
print "Could read all the lines in Global.f90 - good"
outputfile = open("Trash","w")
outputfile.write("This is a Trash file - please remove me")
outputfile.close()
print "Could write to file - good"
os.remove("Trash")
print "Trash file removed again - good"
print "OK - here I am : %s " % os.getcwd()
Output:
Could read all the lines in Global.f90 - good
Could write to file - good
Trash file removed again - good
Traceback (most recent call last):
File "/home/u1/hove/Make/simple.py", line 18, in ?
print "OK - here I am : %s " % os.getcwd()
OSError: [Errno 13] Permission denied
But as we can see the ordinary (non os module) file access routines
work as they should (i.e. they honour the ACL), however the
os.getcwd() routine fails - and it seems to me this must be because it
does not honour the ACL.
I would consider this a bug - but maybe it is just to special to be
taken seriously? If someone are interested in looking into this I
would be most happy to help testing - but as of yet I'm really not up
to trying to improve this myself. I will be out of town for a couple
of days now, but I will check the tread again when I come back.
Regards - Joakim Hove
--
=== Joakim Hove www.phys.ntnu.no/~hove/ ======================
# Institutt for fysikk (735) 93637 / E3-166 | Skøyensgate 10D #
# N - 7491 Trondheim hove at phys.ntnu.no | N - 7030 Trondheim #
================================================ 73 93 31 68 ========
More information about the Python-list
mailing list