Add #ifdef SMACK_ENABLED to private code.
authorJan Cybulski <j.cybulski@samsung.com>
Thu, 25 Apr 2013 11:31:22 +0000 (13:31 +0200)
committerGerrit Code Review <gerrit2@kim11>
Tue, 30 Apr 2013 13:56:18 +0000 (22:56 +0900)
commit6646a7205feed8f653c3bd3f8878b46b5d5d93f8
tree1cc05430a3cc064866f8000b36d3cdfef05f7f5d
parent1c89c7cfbb132156ad33bdc9e6eccccd352869fa
Add #ifdef SMACK_ENABLED to private code.

With this define commented, all security-server API
should work as if there was no SMACK error and SMACK
allowed for everything.

[Issue#]   SSDWSSP-206 & SSDWSSP-221
[Bug]      N/A
[Cause]    SS should work without SMACK enabled.
[Solution] As mentioned above.

[Verification] Build with and without ADD_DEFINITIONS( -DSMACK_ENABLED ).
1. SMACK enabled system.
1.1 -DSMACK_ENABLED on: SS tests should not fail
1.2 -DSMACK_ENABLED off: Following SS tests should fail:
 -client-smack:
  -tc04_security_server_get_gid_client_is_not_allowed
  -tc05_check_privilege_by_cookie
  -tc06_check_privilege_by_sockfd
  -tc07_check_privilege_by_sockfd
 -label:
  -tc_security_server_get_smacklabel_cookie
 -server:
  -tc01a_security_server_app_give_access
  -tc02_check_privilege_by_pid
 There should be no missing SMACK rules for security server sockets in dmesg

2. SMACK disabled system. Same results for -DSMACK_ENABLED on and off. Beside tests
failing in 1.2 all test cases using smack_accesses_apply and smack_have_access will also fail.

Change-Id: Ia1074d9da4a07e3a60878030b9b8fc3760340c73

Conflicts:

src/client/security-server-client.c
src/server/security-server-cookie.c
src/server/security-server-main.c
CMakeLists.txt
src/client/security-server-client.c
src/communication/security-server-comm.c
src/include/smack-check.h
src/server/security-server-cookie.c
src/server/security-server-main.c
src/util/smack-check.c