use getpwuid_r getgrnam_r to guarantee thread safety 00/93700/1
authorchen89.chen <chen89.chen@samsung.com>
Tue, 25 Oct 2016 10:27:21 +0000 (18:27 +0800)
committerchen89.chen <chen89.chen@samsung.com>
Tue, 25 Oct 2016 10:34:45 +0000 (18:34 +0800)
Change-Id: I723f2becdbec8e6c9f8d27d99a8074f2ff0c14ac

packaging/media-server.spec
src/common/media-common-utils.c

index 3539972..52c1f9a 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       media-server
 Summary:    A server for media content management
-Version:    0.3.5
+Version:    0.3.6
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0
index 15f19b0..fed09ca 100755 (executable)
@@ -593,7 +593,7 @@ char* ms_get_path(uid_t uid)
                goto END;
        }
 
-       if (uid == getuid()) {  
+       if (uid == getuid()) {
                if (MS_STRING_VALID(MEDIA_ROOT_PATH_INTERNAL))
                        result_passwd = strndup(MEDIA_ROOT_PATH_INTERNAL, strlen(MEDIA_ROOT_PATH_INTERNAL));
        } else {
@@ -627,7 +627,7 @@ char* ms_get_path(uid_t uid)
                        MS_DBG_ERR("UID [%d] does not belong to 'users' group!", uid);
                        return NULL;
                }
-       
+
                len = snprintf(passwd_str, sizeof(passwd_str), "%s/%s", pwdinfo.pw_dir, MEDIA_CONTENT_PATH);
                if (len > 0)
                        result_passwd = strndup(passwd_str, len);