In re-arranging how the mount points arre named the path variable was being used uninitialized leading to segmentation faults. This patch corrects the error by memsetting path to 0 at each iteration to clear the old value.
Signed-off-by: Eric B Munson <[email protected]> --- hugeadm.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hugeadm.c b/hugeadm.c index c0f1fa1..20a3231 100644 --- a/hugeadm.c +++ b/hugeadm.c @@ -623,6 +623,7 @@ void create_mounts(char *user, char *group, char *base, mode_t mode) } for (pos=0; cnt--; pos++) { + memset(path, 0, PATH_MAX); if (user) snprintf(path, PATH_MAX, "%s/%s", base, user); else if (group) @@ -630,8 +631,8 @@ void create_mounts(char *user, char *group, char *base, mode_t mode) scaled = scale_pagesize(units, 4, pools[pos].pagesize); - snprintf(path, PATH_MAX, "%s/pagesize-%d%s", - path, scaled, units); + snprintf(path, PATH_MAX, "%s/%s/pagesize-%d%s", + base, path, scaled, units); snprintf(options, OPT_MAX, "pagesize=%ld", pools[pos].pagesize); -- 1.7.1 ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Libhugetlbfs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel
