diff options
author | Simo Sorce <simo@redhat.com> | 2012-06-15 10:16:13 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-06-21 07:42:50 -0400 |
commit | 7767a7d37685ee8863873d65fdbf21122d742a28 (patch) | |
tree | 74d683e390e470d0300b4f52cab14e143ca9ba17 /src/sss_client | |
parent | 387349ae092f6dbeb8e4bca291a772695836629c (diff) | |
download | sssd-7767a7d37685ee8863873d65fdbf21122d742a28.tar.gz sssd-7767a7d37685ee8863873d65fdbf21122d742a28.tar.bz2 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/sss_client')
-rw-r--r-- | src/sss_client/nss_mc_common.c | 2 |
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 5391df97..d910e17b 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; |