URL: https://github.com/SSSD/sssd/pull/898 Author: alexey-tikhonov Title: #898: util/server: amended close_low_fds() Action: opened
PR body: """ Rewrote close_low_fds() to use freopen() as it fits better here and some flags passed to open() previously didn't make a sense.
Also fixed a number of identical Coverity issues: ``` Error: RESOURCE_LEAK (CWE-772): sssd-2.2.3/src/util/server.c:58: open_fn: Returning handle opened by "open". [Note: The source code implementation of the function has been overridden by a user model.] sssd-2.2.3/src/util/server.c:58: var_assign: Assigning: "fd" = handle returned from "open("/dev/null", 1, 0)". sssd-2.2.3/src/util/server.c:56: overwrite_var: Overwriting handle "fd" in "fd = open("/dev/null", 2, 0)" leaks the handle. 54| library routines writing to stdout etc. won't cause havoc */ 55| for (i = 0; i < 3; i++) { 56|-> fd = open("/dev/null", O_RDWR, 0); 57| if (fd < 0) 58| fd = open("/dev/null", O_WRONLY, 0); ``` """
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/898/head:pr898 git checkout pr898
URL: https://github.com/SSSD/sssd/pull/898 Title: #898: util/server: amended close_low_fds()
Label: +Waiting for review
URL: https://github.com/SSSD/sssd/pull/898 Title: #898: util/server: amended close_low_fds()
mzidek-rh commented: """ I agree that this patch makes the code much more readable. ACK. """
See the full comment at https://github.com/SSSD/sssd/pull/898#issuecomment-542637560
URL: https://github.com/SSSD/sssd/pull/898 Title: #898: util/server: amended close_low_fds()
Label: -Waiting for review
URL: https://github.com/SSSD/sssd/pull/898 Title: #898: util/server: amended close_low_fds()
Label: +Accepted
URL: https://github.com/SSSD/sssd/pull/898 Title: #898: util/server: amended close_low_fds()
Label: +Ready to push
URL: https://github.com/SSSD/sssd/pull/898 Title: #898: util/server: amended close_low_fds()
pbrezina commented: """ * `master` * 00c60805a4d75be4c8d1be8643f8848d23bcf87c - util/server: amended close_low_fds()
"""
See the full comment at https://github.com/SSSD/sssd/pull/898#issuecomment-543174121
URL: https://github.com/SSSD/sssd/pull/898 Title: #898: util/server: amended close_low_fds()
Label: +Pushed
URL: https://github.com/SSSD/sssd/pull/898 Title: #898: util/server: amended close_low_fds()
Label: -Accepted
URL: https://github.com/SSSD/sssd/pull/898 Title: #898: util/server: amended close_low_fds()
Label: -Ready to push
URL: https://github.com/SSSD/sssd/pull/898 Author: alexey-tikhonov Title: #898: util/server: amended close_low_fds() Action: closed
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/898/head:pr898 git checkout pr898
sssd-devel@lists.fedorahosted.org