Check if SMACK is enabled, if not skip code so cookie creation doesn't fail 57/3257/1
authorbrianjjones <brian.j.jones@intel.com>
Fri, 29 Mar 2013 19:20:28 +0000 (12:20 -0700)
committerbrianjjones <brian.j.jones@intel.com>
Fri, 29 Mar 2013 19:20:28 +0000 (12:20 -0700)
src/security-srv/server/security-server-cookie.c

index 518134b..04dafbb 100644 (file)
@@ -487,6 +487,7 @@ out_of_while:
                goto error;
        }
 
+#ifdef SMACK_ENABLED
         /* Check SMACK label */
         ret = smack_new_label_from_socket(sockfd, &smack_label);
         if (ret != 0)
@@ -496,6 +497,7 @@ out_of_while:
                added = NULL;
                goto error;
        }
+#endif        
 
        added->path_len = strlen(cmdline);
        added->path = calloc(1, strlen(cmdline));
@@ -504,7 +506,9 @@ out_of_while:
        added->permission_len = perm_num;
        added->pid = pid;
        added->permissions = permissions;
+#ifdef SMACK_ENABLED   
        added->smack_label = smack_label;
+#endif 
        added->prev = current;
        current->next = added;
        added->next = NULL;