From dfa55b821d7cf0652a084e54b44329c87d0b79cf Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Tue, 26 May 2015 14:09:04 +0900 Subject: [PATCH] Fix _mkdir_for_user add constraint to prevent infinite loop Change-Id: Iab35153b83a7d53cde23b5cbe2720aa7672f16cd Signed-off-by: Sangyoon Jang --- src/pkgmgr-info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkgmgr-info.c b/src/pkgmgr-info.c index 46b28c0..2b8283b 100644 --- a/src/pkgmgr-info.c +++ b/src/pkgmgr-info.c @@ -318,7 +318,7 @@ static int _mkdir_for_user(const char* dir, uid_t uid, gid_t gid) fullpath = strdup(dir); subpath = dirname(fullpath); - if (strlen(subpath) > 1) { + if (strlen(subpath) > 1 && strcmp(subpath, fullpath) != 0) { ret = _mkdir_for_user(fullpath, uid, gid); if (ret == -1) { free(fullpath); -- 2.7.4