Rearrange tests for cookies
[platform/core/test/security-tests.git] / tests / security-server-tests / security_server_tests_server.cpp
index 1acc8a4..9616324 100644 (file)
@@ -81,26 +81,6 @@ unsigned char cookie[COOKIE_SIZE], wrong_cookie[COOKIE_SIZE];
 char obj_name[OBJ_NAME_SIZE];
 struct sockaddr_un clientaddr;
 
-/**
- * Dropping root privileges
- * returns 0 on success, 1 on error
- */
-int drop_root_privileges()
-{
-    if (getuid() == 0) {
-        /* process is running as root, drop privileges */
-        if (setgid(APP_GID) != 0)
-            return 1;
-        if (setuid(APP_UID) != 0)
-            return 1;
-    }
-    uid_t uid = getuid();
-    if (uid == APP_UID)
-        return 0;
-
-    return 1;
-}
-
 /* Create a Unix domain socket and bind */
 int create_new_socket()
 {