mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
samba-tool: convert octal 'O1234' format to python3 compatible '0o1234'
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>
This commit is contained in:
parent
31b5328c46
commit
f531c951b7
@ -1807,7 +1807,7 @@ samba-tool user syncpasswords --terminate \\
|
|||||||
logfile = self.logfile
|
logfile = self.logfile
|
||||||
self.logfile = None
|
self.logfile = None
|
||||||
log_msg("Closing logfile[%s] (st_nlink == 0)\n" % (logfile))
|
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, 0)
|
||||||
os.dup2(logfd, 1)
|
os.dup2(logfd, 1)
|
||||||
os.dup2(logfd, 2)
|
os.dup2(logfd, 2)
|
||||||
@ -1969,7 +1969,7 @@ samba-tool user syncpasswords --terminate \\
|
|||||||
flags |= os.O_CREAT
|
flags |= os.O_CREAT
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.lockfd = os.open(self.lockfile, flags, 0600)
|
self.lockfd = os.open(self.lockfile, flags, 0o600)
|
||||||
except IOError as (err, msg):
|
except IOError as (err, msg):
|
||||||
if err == errno.ENOENT:
|
if err == errno.ENOENT:
|
||||||
if terminate:
|
if terminate:
|
||||||
@ -2212,7 +2212,7 @@ samba-tool user syncpasswords --terminate \\
|
|||||||
maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
|
maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
|
||||||
if maxfd == resource.RLIM_INFINITY:
|
if maxfd == resource.RLIM_INFINITY:
|
||||||
maxfd = 1024 # Rough guess at maximum number of open file descriptors.
|
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)
|
self.outf.write("Using logfile[%s]\n" % logfile)
|
||||||
for fd in range(0, maxfd):
|
for fd in range(0, maxfd):
|
||||||
if fd == logfd:
|
if fd == logfd:
|
||||||
|
Loading…
Reference in New Issue
Block a user