samba-tool: convert octal 'O1234' format to python3 compatible '0o1234'
authorNoel Power <noel.power@suse.com>
Fri, 23 Feb 2018 13:03:28 +0000 (13:03 +0000)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 28 Feb 2018 22:01:39 +0000 (23:01 +0100)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/user.py

index 2cc74c7f80b12f9cc0d93c5cf5cae39e8f2fdeab..7feb0870dceb828cd63e3235e4a418382b29f834 100644 (file)
@@ -1807,7 +1807,7 @@ samba-tool user syncpasswords --terminate \\
                     logfile = self.logfile
                     self.logfile = None
                     log_msg("Closing logfile[%s] (st_nlink == 0)\n" % (logfile))
-                    logfd = os.open(logfile, os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0600)
+                    logfd = os.open(logfile, os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0o600)
                     os.dup2(logfd, 0)
                     os.dup2(logfd, 1)
                     os.dup2(logfd, 2)
@@ -1969,7 +1969,7 @@ samba-tool user syncpasswords --terminate \\
                 flags |= os.O_CREAT
 
             try:
-                self.lockfd = os.open(self.lockfile, flags, 0600)
+                self.lockfd = os.open(self.lockfile, flags, 0o600)
             except IOError as (err, msg):
                 if err == errno.ENOENT:
                     if terminate:
@@ -2212,7 +2212,7 @@ samba-tool user syncpasswords --terminate \\
             maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
             if maxfd == resource.RLIM_INFINITY:
                 maxfd = 1024 # Rough guess at maximum number of open file descriptors.
-            logfd = os.open(logfile, os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0600)
+            logfd = os.open(logfile, os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0o600)
             self.outf.write("Using logfile[%s]\n" % logfile)
             for fd in range(0, maxfd):
                 if fd == logfd: