def create_gpo_struct(policy_path):
if not os.path.exists(policy_path):
- os.makedirs(policy_path, 0775)
+ os.makedirs(policy_path, 0o775)
f = open(os.path.join(policy_path, "GPT.INI"), 'w')
try:
f.write("[General]\r\nVersion=0")
f.close()
p = os.path.join(policy_path, "MACHINE")
if not os.path.exists(p):
- os.makedirs(p, 0775)
+ os.makedirs(p, 0o775)
p = os.path.join(policy_path, "USER")
if not os.path.exists(p):
- os.makedirs(p, 0775)
+ os.makedirs(p, 0o775)
def create_default_gpo(sysvolpath, dnsdomain, policyguid, policyguid_dc):
file = tempfile.NamedTemporaryFile(dir=os.path.abspath(sysvol))
try:
try:
- smbd.set_simple_acl(file.name, 0755, gid)
+ smbd.set_simple_acl(file.name, 0o755, gid)
except OSError:
if not smbd.have_posix_acls():
# This clue is only strictly correct for RPM and
setup_encrypted_secrets_key(paths.encrypted_secrets_key_path)
if paths.sysvol and not os.path.exists(paths.sysvol):
- os.makedirs(paths.sysvol, 0775)
+ os.makedirs(paths.sysvol, 0o775)
ldapi_url = "ldapi://%s" % urllib.quote(paths.s4_ldapi_path, safe="")
raise MissingShareError("sysvol", paths.smbconf)
if not os.path.isdir(paths.netlogon):
- os.makedirs(paths.netlogon, 0755)
+ os.makedirs(paths.netlogon, 0o755)
if adminpass is None:
adminpass = samba.generate_random_password(12, 32)
# chown the dns.keytab in the bind-dns directory
if paths.bind_gid is not None:
try:
- os.chmod(paths.binddns_dir, 0770)
+ os.chmod(paths.binddns_dir, 0o770)
os.chown(paths.binddns_dir, -1, paths.bind_gid)
except OSError:
if not os.environ.has_key('SAMBA_SELFTEST'):
paths.binddns_dir, paths.bind_gid)
try:
- os.chmod(bind_dns_keytab_path, 0640)
+ os.chmod(bind_dns_keytab_path, 0o640)
os.chown(bind_dns_keytab_path, -1, paths.bind_gid)
except OSError:
if not os.environ.has_key('SAMBA_SELFTEST'):
self.slapd_path)
if not os.path.isdir(self.ldapdir):
- os.makedirs(self.ldapdir, 0700)
+ os.makedirs(self.ldapdir, 0o700)
# Put the LDIF of the schema into a database so we can search on
# it to generate schema-dependent configurations in Fedora DS and
finally:
f.close()
- os.chmod(ldap_backend_script, 0755)
+ os.chmod(ldap_backend_script, 0o755)
# Now start the slapd, so we can provision onto it. We keep the
# subprocess context around, to kill this off at the successful
:param dbdir: Database directory.
"""
if not os.path.exists(dbdir):
- os.makedirs(dbdir, 0700)
+ os.makedirs(dbdir, 0o700)
def provision(self):
from samba.provision import ProvisioningError, setup_path
# Wipe the old sam.ldb databases away
shutil.rmtree(self.olcdir, True)
- os.makedirs(self.olcdir, 0770)
+ os.makedirs(self.olcdir, 0o770)
# If we were just looking for crashes up to this point, it's a
# good time to exit before we realise we don't have OpenLDAP on
except OSError:
pass
- os.mkdir(dns_dir, 0770)
+ os.mkdir(dns_dir, 0o770)
if paths.bind_gid is not None:
try:
os.chown(dns_dir, -1, paths.bind_gid)
# chmod needed to cope with umask
- os.chmod(dns_dir, 0770)
+ os.chmod(dns_dir, 0o770)
except OSError:
if not os.environ.has_key('SAMBA_SELFTEST'):
logger.error("Failed to chown %s to bind gid %u" % (
try:
os.chown(paths.dns, -1, paths.bind_gid)
# chmod needed to cope with umask
- os.chmod(paths.dns, 0664)
+ os.chmod(paths.dns, 0o664)
except OSError:
if not os.environ.has_key('SAMBA_SELFTEST'):
logger.error("Failed to chown %s to bind gid %u" % (
for d in dirs:
dpath = os.path.join(dirname, d)
os.chown(dpath, -1, paths.bind_gid)
- os.chmod(dpath, 0770)
+ os.chmod(dpath, 0o770)
for f in files:
if f.endswith('.ldb') or f.endswith('.tdb'):
fpath = os.path.join(dirname, f)
os.chown(fpath, -1, paths.bind_gid)
- os.chmod(fpath, 0660)
+ os.chmod(fpath, 0o660)
except OSError:
if not os.environ.has_key('SAMBA_SELFTEST'):
logger.error(