"Permission denied" when running provision (with possible fix)

Horacio G. de Oro hgdeoro at gmail.com
Thu Feb 2 20:10:50 MST 2012


I've compiled Samba 4 (from git) and installed it to an non-default
location successfully, all this with a non-root user... but, when I
try to execute the provision script, I get:

./source4/setup/provision --realm=samba4-git.hgdeoro.com.ar
--domain=HGDEORODEV --adminpass=randompass --server-role='domain
controller'
Traceback (most recent call last):
  File "./source4/setup/provision", line 228, in <module>
    file = tempfile.NamedTemporaryFile(prefix=os.path.abspath(os.path.dirname(lp.get("private
dir"))))
  File "/usr/lib64/python2.6/tempfile.py", line 444, in NamedTemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
  File "/usr/lib64/python2.6/tempfile.py", line 228, in _mkstemp_inner
    fd = _os.open(file, flags, 0600)
OSError: [Errno 13] Permission denied: '/opt/samba4-3bea5a147b3fYaLt'

The install location is "/opt/samba4-3bea5a147b/" (I think the extra
"3fYaLt" is a random string added to create the temporary file) and I
think the problem is that the directory name is passed to
NamedTemporaryFile() with "prefix". I'm the owner of
"/opt/samba4-3bea5a147b/" but I've no permission on /opt. Using "dir"
instead of "prefix" makes the script work. The attached patch 0001
changes that.

I've found that the same is used on
source4/scripting/python/samba/netcmd/domain.py, so the 0002 patch
removes "prefix" an put "dir" in that file, but this is totally
untested and don't know if the changes of the two patches breaks
anythiny... I don't know if 0002 is really needed...

Thanks!
Horacio de Oro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Use-named-argument-dir-instead-of-prefix-on-NamedTem.patch
Type: text/x-patch
Size: 1181 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20120203/8fe86b02/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Use-named-argument-dir-instead-of-prefix-on-NamedTem.patch
Type: text/x-patch
Size: 1394 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20120203/8fe86b02/attachment-0001.bin>


More information about the samba-technical mailing list