Fix _mkdir_for_user 88/39888/1
authorSangyoon Jang <s89.jang@samsung.com>
Tue, 26 May 2015 05:09:04 +0000 (14:09 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Tue, 26 May 2015 05:09:04 +0000 (14:09 +0900)
add constraint to prevent infinite loop

Change-Id: Iab35153b83a7d53cde23b5cbe2720aa7672f16cd
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
src/pkgmgr-info.c

index 46b28c0..2b8283b 100644 (file)
@@ -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);