This is an automated email from the git hooks/post-receive script.
mreynolds pushed a change to branch master in repository 389-ds-base.
from eef2ee8 Issue 49065 - dbmon.sh fails if you have nsslapd-require-secure-binds enabled new 28e4be0 Issue 49157 - ds-logpipe.py crashes for non-existing users
The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference.
Summary of changes: ldap/admin/src/scripts/ds-logpipe.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch master in repository 389-ds-base.
commit 28e4be01a7be5c8b5bed85dc847cf65329449dd1 Author: Mark Reynolds mreynolds@redhat.com Date: Mon Mar 20 15:29:48 2017 -0400
Issue 49157 - ds-logpipe.py crashes for non-existing users
Description: Added try/except's for various OS function calls, as the tool should gracefully exit when there is a problem and not crash
https://pagure.io/389-ds-base/issue/49157
Reviewed by: firstyear(Thanks!) --- ldap/admin/src/scripts/ds-logpipe.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/ldap/admin/src/scripts/ds-logpipe.py b/ldap/admin/src/scripts/ds-logpipe.py index 4ba4d1b..dc1856a 100644 --- a/ldap/admin/src/scripts/ds-logpipe.py +++ b/ldap/admin/src/scripts/ds-logpipe.py @@ -262,7 +262,8 @@ def parse_options():
options, logfname = parse_options()
-if options.debug: debug = True +if options.debug: + debug = True
if len(plgfuncs) == 0: plgfuncs.append(defaultplugin) @@ -270,9 +271,15 @@ if len(plgpostfuncs) == 0: plgpostfuncs.append(defaultpost)
if options.user: - try: userid = int(options.user) - except ValueError: # not a numeric userid - look it up - userid = pwd.getpwnam(options.user)[2] + try: + userid = int(options.user) + except ValueError: # not a numeric userid - look it up + try: + userid = pwd.getpwnam(options.user)[2] + except Exception as e: + print("Failed to lookup name (%s) error: %s" % + (options.user, str(e))) + sys.exit(1) os.seteuid(userid)
if options.scriptpidfile: @@ -298,8 +305,12 @@ except OSError as e: if e.errno == errno.ENOENT: if debug: print("Creating log pipe", logfname) - os.mkfifo(logfname) - os.chmod(logfname, 0o600) + try: + os.mkfifo(logfname) + os.chmod(logfname, 0o600) + except Exception as e: + print("Failed to create log pipe: " + str(e)) + sys.exit(1) else: raise Exception("%s [%d]" % (e.strerror, e.errno))
@@ -393,7 +404,7 @@ while not done: else: # we read something # pipe closed - usually when server shuts down done = True - + if not done and debug: print("log pipe", logfname, "closed - reopening - read", totallines, "total lines")
389-commits@lists.fedoraproject.org