From 7767a7d37685ee8863873d65fdbf21122d742a28 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 15 Jun 2012 10:16:13 -0400 Subject: 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. --- src/sss_client/nss_mc_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; -- cgit