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

Jelmer Vernooij jelmer at samba.org
Fri Feb 3 05:26:45 MST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Horacio,

On 02/03/2012 04:10 AM, Horacio G. de Oro wrote:
> 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! 'dir' is indeed the right thing to use here, not 'prefix'. I've
applied your patch and pushed to autobuild.

Cheers,

Jelmer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPK9KFAAoJEACAbyvXKaRXPiEP/R3aQWdCPDfZWykl8Sb3my+g
QeyYuiQn8JaSUSVW1KWt8W5rGdXgIszROIKCLHAxqNONocuOvgy2g1s6L2GDeA7N
4yZGexTo5sGJasxbhseJrPdYTiEicM2iCsqN9ZhufYWw/QobZI6iQtIuLw+S96sv
EL3jfZcAkxk3/wlYQLg7EKgPR4/JRuBmZ+fU5fNpKHQ5Te1ary9doA5BT/pS8VQv
q9O0YJHXHEhqPGUpd/uLSjc7tZz07stTwzneVuNnzhjV95cZ7eMILiDLMQvNjsi7
fNC8RBVPIl2X9+b2lKGfWtIxSkC3h2x4lUcdCqI/75P29uadyjp3p86kiD+7XXhh
0A4M8v2M/hlXY87+xMUBYDDrUM7kkYyu5QZ+i75KHPlRzzhvLzvhj2i3z7/MPuj2
8MwsBNTeok/AEGBiumpNbK6BR/+S505ltPuADCwvzKS7Gm3n+NEe4AaMUz31rheE
6YX+w3t7D2W1fxFvli1ZGoms4dar3goc2IG83WILbwcdsmlkfmo+chiZjQB7a/aM
MtDx3s32bWGrAMmmjBtx20sa2UoWcGpxiJc3ObFJd+/Z6GQ8vmsWgCsT9Yx3iaKz
ufJtmr/fE3+9QVgfALXX+9rYSRDwBYM+/zAAZXrPlw2t0HAva3jWjFboOrR6vs++
5YAnrwunOxC7Q2OYHqFh
=E/YQ
-----END PGP SIGNATURE-----



More information about the samba-technical mailing list