summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-06-15 10:16:13 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-06-21 07:42:50 -0400
commit7767a7d37685ee8863873d65fdbf21122d742a28 (patch)
tree74d683e390e470d0300b4f52cab14e143ca9ba17 /src
parent387349ae092f6dbeb8e4bca291a772695836629c (diff)
downloadsssd-7767a7d37685ee8863873d65fdbf21122d742a28.tar.gz
sssd-7767a7d37685ee8863873d65fdbf21122d742a28.tar.xz
sssd-7767a7d37685ee8863873d65fdbf21122d742a28.zip
Do not leak file descriptors in client libs.
We need to make sure the mc socket is not leaked otherwise child processes will pile up leaked file descriptors. Add O_CLOEXEC when opening the cache.
Diffstat (limited to 'src')
-rw-r--r--src/sss_client/nss_mc_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sss_client/nss_mc_common.c b/src/sss_client/nss_mc_common.c
index 5391df979..d910e17ba 100644
--- a/src/sss_client/nss_mc_common.c
+++ b/src/sss_client/nss_mc_common.c
@@ -106,7 +106,7 @@ errno_t sss_nss_mc_get_ctx(const char *name, struct sss_cli_mc_ctx *ctx)
goto done;
}
- ctx->fd = open(file, O_RDONLY);
+ ctx->fd = open(file, O_RDONLY|O_CLOEXEC);
if (ctx->fd == -1) {
ret = EIO;
goto done;