master - clmvd: fix decriptor leak on restart
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7b1315411f1de73801fd38f264ca507ae3807e53 Commit: 7b1315411f1de73801fd38f264ca507ae3807e53 Parent: 16c1dacb6e98c8b49462a7ca9f98687c0affe498 Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Aug 6 16:07:50 2013 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Aug 6 16:20:36 2013 +0200
clmvd: fix decriptor leak on restart
Do not leave descriptor used for dup2() openned.
--- WHATS_NEW | 1 + daemons/clvmd/clvmd.c | 4 ++++ 2 files changed, 5 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.100 - ================================ + Fix clvmd descriptor leak on restart. Add pipe_open/close() to replace less secure popen() glibc call. Fix metadata area offset/size overflow if it's >= 4g and while using lvmetad. Inherit and apply any profile attached to a VG if creating new thin pool.
daemons/clvmd/clvmd.c +4 -0
@@ -1085,6 +1085,10 @@ static void be_daemon(int timeout)log_error ("Error setting terminal FDs to /dev/null: %m" );exit (5 ); } +if ((devnull >STDERR_FILENO ) &&close (devnull)) { +log_sys_error ("close" ,"/dev/null" ); +exit (7 ); + }if (chdir ("/" )) {log_error ("Error setting current directory to /: %m" );exit (6 );