Merge missing code pieces from private repository.
authorRafal Krypa <r.krypa@samsung.com>
Fri, 3 May 2013 13:44:18 +0000 (15:44 +0200)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Thu, 6 Feb 2014 16:07:44 +0000 (17:07 +0100)
[Issue#]       N/A
[Bug]          Patches applied in different version in RSA and private repository
[Cause]        Developers not careful enough about applying patches in both places
[Solution]     Move missing bits of code
[Verification] Build

Change-Id: If1f65e07b44e1a2ad40f9d67f0ae211511948632

src/server/security-server-cookie.c
src/server/security-server-main.c

index 6c29bda..4578d0b 100644 (file)
@@ -477,17 +477,26 @@ out_of_while:
     if(added == NULL)
         goto error;
 
+    ret = generate_random_cookie(added->cookie, SECURITY_SERVER_COOKIE_LEN);
+    if(ret != SECURITY_SERVER_SUCCESS)
+    {
+        SEC_SVR_DBG("Error on making random cookie: %d", ret);
+        free(added);
+        added = NULL;
+        goto error;
+    }
+
     /* Check SMACK label */
     if (smack_check())
     {
         ret = smack_new_label_from_socket(sockfd, &smack_label);
         if (ret != 0)
-               {
-                       SEC_SVR_DBG("Error checking peer label: %d", ret);
-                       free(added);
-                       added = NULL;
-                       goto error;
-               }
+        {
+            SEC_SVR_DBG("Error checking peer label: %d", ret);
+            free(added);
+            added = NULL;
+            goto error;
+        }
     }
 
     /* Check SMACK label */
@@ -503,8 +512,6 @@ out_of_while:
         }
     }
 
-       added->path = exe;
-       exe = NULL;
     added->permission_len = perm_num;
     added->pid = pid;
     added->permissions = permissions;
index 689b0db..bb27a45 100644 (file)
@@ -49,8 +49,6 @@
 
 const char * const LABEL_SECURITY_SERVER_API_DATA_SHARE = "security-server::api-data-share";
 
-const char * const LABEL_SECURITY_SERVER_API_DATA_SHARE = "security-server::api-data-share";
-
 /* Set cookie as a global variable */
 cookie_list *c_list;
 pthread_mutex_t cookie_mutex;