From 3bc23e1ad08e212538d325ec0196ec7488ae7e62 Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Thu, 30 Jan 2014 19:50:06 +0530 Subject: changelog: Restrict length of unix socket files to UNIX_PATH_MAX. Bug fix for Coverity-CID 1124847. Change-Id: I410ef8e06cbc491b1f72535298fae5e9bc77220d BUG: 789278 Signed-off-by: Raghavendra Talur Reviewed-on: http://review.gluster.org/6870 Reviewed-by: Venky Shankar Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/changelog/lib/src/gf-changelog-helpers.h | 2 +- xlators/features/changelog/lib/src/gf-changelog.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/features/changelog/lib') diff --git a/xlators/features/changelog/lib/src/gf-changelog-helpers.h b/xlators/features/changelog/lib/src/gf-changelog-helpers.h index 3aa6ed7b8..7e13d9376 100644 --- a/xlators/features/changelog/lib/src/gf-changelog-helpers.h +++ b/xlators/features/changelog/lib/src/gf-changelog-helpers.h @@ -51,7 +51,7 @@ typedef struct gf_changelog { /* connection retries */ int gfc_connretries; - char gfc_sockpath[PATH_MAX]; + char gfc_sockpath[UNIX_PATH_MAX]; char gfc_brickpath[PATH_MAX]; diff --git a/xlators/features/changelog/lib/src/gf-changelog.c b/xlators/features/changelog/lib/src/gf-changelog.c index ca8e373e7..1b014640e 100644 --- a/xlators/features/changelog/lib/src/gf-changelog.c +++ b/xlators/features/changelog/lib/src/gf-changelog.c @@ -173,7 +173,7 @@ gf_changelog_notification_init (xlator_t *this, gf_changelog_t *gfc) } CHANGELOG_MAKE_SOCKET_PATH (gfc->gfc_brickpath, - gfc->gfc_sockpath, PATH_MAX); + gfc->gfc_sockpath, UNIX_PATH_MAX); gf_log (this->name, GF_LOG_INFO, "connecting to changelog socket: %s (brick: %s)", gfc->gfc_sockpath, gfc->gfc_brickpath); -- cgit From 432f7e45b2ddf511660d269548f248217a2b45ad Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Tue, 4 Feb 2014 15:57:05 +0530 Subject: changelog: When connection is unsuccessful, close socket too. Bug fix for Coverity CID: 1124791 Change-Id: I0362d45123ebc250290f3a5231f7fb113fa41212 BUG: 789278 Signed-off-by: Raghavendra Talur Reviewed-on: http://review.gluster.org/6900 Reviewed-by: Krishnan Parthasarathi Reviewed-by: Santosh Pradhan Reviewed-by: Venky Shankar Tested-by: Gluster Build System --- xlators/features/changelog/lib/src/gf-changelog.c | 1 + 1 file changed, 1 insertion(+) (limited to 'xlators/features/changelog/lib') diff --git a/xlators/features/changelog/lib/src/gf-changelog.c b/xlators/features/changelog/lib/src/gf-changelog.c index 1b014640e..4b2b25ad5 100644 --- a/xlators/features/changelog/lib/src/gf-changelog.c +++ b/xlators/features/changelog/lib/src/gf-changelog.c @@ -202,6 +202,7 @@ gf_changelog_notification_init (xlator_t *this, gf_changelog_t *gfc) gf_log (this->name, GF_LOG_ERROR, "could not connect to changelog socket!" " bailing out..."); + close (sockfd); ret = -1; } else gf_log (this->name, GF_LOG_INFO, -- cgit