# limitations under the License.
###########################################################################
-CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
+cmake_minimum_required(VERSION 3.0)
-PROJECT(cynara C)
+project(cynara C)
-SET(PROJECT_NAME "Cynara")
-SET(PROJECT_PRETTY_NAME "Permission database")
-SET(PROJECT_DESCRIPTION "Secured permission database for applications")
-SET(PROJECT_VERSION "1.99.99")
+set(PROJECT_NAME "Cynara")
+set(PROJECT_PRETTY_NAME "Permission database")
+set(PROJECT_DESCRIPTION "Secured permission database for applications")
+set(PROJECT_VERSION "1.99.99")
set(PROJECT_URL "https://gerrit.automotivelinux.org/gerrit/gitweb?p=src/cynara.git;a=summary")
-INCLUDE(FindPkgConfig)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckLibraryExists)
-INCLUDE(GNUInstallDirs)
+include(FindPkgConfig)
+include(CheckIncludeFiles)
+include(CheckLibraryExists)
+include(GNUInstallDirs)
+include(CTest)
+
if(NOT CMAKE_INSTALL_FULL_RUNSTATEDIR)
- set(CMAKE_INSTALL_FULL_RUNSTATEDIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run")
+ set(CMAKE_INSTALL_FULL_RUNSTATEDIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run")
endif()
-INCLUDE(CTest)
###########################################################################
# possible settings
###########################################################################
if(SYSTEMD)
- PKG_CHECK_MODULES(libsystemd REQUIRED libsystemd>=222)
- add_subdirectory(systemd)
+ PKG_CHECK_MODULES(libsystemd REQUIRED libsystemd>=222)
+ add_subdirectory(systemd)
endif()
add_subdirectory(include)
--- /dev/null
+<pre>
+ -++-
+ yyyyyy/
+ .syyyyyyyys.
+ .s/` yyyyyyyyyyyy `/s.
+ `yyyo-yyyyyyyyyyyyyy oyyy.
+ oyyy-syyyyyo++oyyyyys-yyyo
+ ` syyy oyys/+sddy+/syyo yyys `
+ -hh//yyo s/ohddddddho s oyy//hh-
+ ydddh+/+./hddddddddddh+.+/+hdddh
+ .` `ddddddh sdddddddddddddds hdddddd. `.
+ hddy.dddddd/sdddddddddddddddds dddddd.sddd
+ yddd/sddddd.dddddddddddddddddd.dddddy dddh
+ +dddy-ddddd yddddddddddddddddy ddddd yddd+
+ `yddd+oddddy ddddddhhhhdddddd yddddo/dddh`
+ .yddd/oddds-+++++oooooo+++++-sdddo/dddy.
+ --++./s/+dddddddddddddddddd+/s/.++--
+ /ddhy++dddddddddddddddddd+/yhdd+
+ `+ydd-hddddddddddddddddh-hdy+`
+ `--` +ossyyyyyysso+ `--`
+
+
+
+ -/++++/:`///// `////:-////. -////- ://- :///++//:` `///.
+ -oso:--:ss .+ss: /ss:``:ssss. `:ss:` :ssss. `/ss/-:oss. /ssso`
+ `sso` -- +ss.-ss- .ssoss- .ss. .ss-oso :ss- :ss- -ss-ss+
+ -ss+ /ssss. .ss-/ss/-ss. `os/ -ss/ :sso+oso: .ss: :ss:
+ `sso +ss- .ss- :ssoss. +ssssssss- :ss:.+ss. ossssssss.
+ :sso:--:++ `+ss-` `-ss:` -ssss.`:ss/` `-sss-``/ss:` +ss-`.+ss-` `:sso.
+ `:/+o+/:` +++++- -++++: .+++`/++++- .+++++-/++++: `/++:+++++. -+++++.
+</pre>
+
+# Cynara
+
+[Cynara][1] is fast, simple and safe permission database
+service.
+Functions of Cynara are:
+* checking access for certain permission
+* holding permission database
+* simple, single function API - for checking permissions
+* thin client library - to make access control even more simple
+* ability to use external agent
+(in case of policies that can't be full processed in cynara and plugins)
+
+## API Overview
+
+Please refer to a wiki page on [Cynara's API][2].
+
+## Documentation
+
+Documentation is kept on [wiki][1].
+
+## Repositories
+
+Cynara repositories are available on:
+* GitHub - [samsung/Cynara][3] repository
+* tizen.org - [platform/core/security/cynara][4] repository - requires account on tizen.org
+
+## Contact information
+
+| Name | E-mail | Function |
+|----------------------|----------------------------------|------------|
+| Łukasz Wojciechowski | l.wojciechow@partner.samsung.com | Maintainer |
+| Aleksander Zdyb | a.zdyb@samsung.com | Integrator |
+
+## License
+
+Cynara is licensed under a Apache License Version 2.0, January 2004.
+Available on Apache [website][5] or in LICENSE file.
+
+[1]: https://wiki.tizen.org/wiki/Security:Cynara
+[2]: https://wiki.tizen.org/wiki/Security:Cynara:API
+[3]: https://github.com/Samsung/cynara
+[4]: https://review.tizen.org/gerrit/#/admin/projects/platform/core/security/cynara
+[5]: https://www.apache.org/licenses/
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cynara.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+configure_file(cynara-compat.pc.in cynara-compat.pc @ONLY)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cynara-compat.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+
foreach(item cynara-admin.pc
cynara-agent.pc
cynara-client-async.pc
cynara-monitor.pc
cynara-plugin.pc
cynara-session.pc)
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/link.pc
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/link-to-cynara-compat.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
RENAME ${item})
endforeach(item)
--- /dev/null
+Name: cynara
+Description: cynara package
+Version: @CYNARA_VERSION@
+Libs: -L@CMAKE_INSTALL_FULL_LIBDIR@ -lcynara-compat
+Cflags: -I@CMAKE_INSTALL_FULL_INCLUDEDIR@ -I@CMAKE_INSTALL_FULL_INCLUDEDIR@/cynara
Name: cynara
Description: cynara package
Version: @CYNARA_VERSION@
-Libs: -L@CMAKE_INSTALL_FULL_LIBDIR@ -lcynara
+Libs: -L@CMAKE_INSTALL_FULL_LIBDIR@ -lcynara-client
Cflags: -I@CMAKE_INSTALL_FULL_INCLUDEDIR@ -I@CMAKE_INSTALL_FULL_INCLUDEDIR@/cynara
--- /dev/null
+cynara-compat.pc
\ No newline at end of file
+++ /dev/null
-cynara.pc
\ No newline at end of file
# limitations under the License.
###########################################################################
-set(SERVER_SOURCES
- agent-at.c
+set(LIBCORE_SOURCES
anydb.c
cyn.c
db.c
expire.c
fbuf.c
filedb.c
- main-cynarad.c
memdb.c
pollitem.c
- prot.c
queue.c
+)
+
+set(SERVER_SOURCES
+ agent-at.c
+ main-cynarad.c
+ prot.c
rcyn-protocol.c
rcyn-server.c
socket.c
)
-set(LIB_SOURCES
+set(LIBCLI_SOURCES
cache.c
lib-compat.c
prot.c
socket.c
)
+set(LIBCLI_SOURCES
+ cache.c
+ prot.c
+ rcyn-client.c
+ rcyn-protocol.c
+ socket.c
+)
+
+set(LIBCOMPAT_SOURCES
+ lib-compat.c
+)
+
add_compile_definitions(_GNU_SOURCE)
###########################################
-# build and install libcynara
+# build and install libcynara-core
###########################################
-ADD_LIBRARY(cynara SHARED ${LIB_SOURCES})
-target_compile_definitions(cynara PRIVATE
+add_library(cynara-core SHARED ${LIBCORE_SOURCES})
+set_target_properties(cynara-core PROPERTIES
+ VERSION ${CYNARA_VERSION}
+ SOVERSION ${CYNARA_SOVERSION})
+target_link_libraries(cynara-core
+ -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export-cynara-core.map
+ -Wl,--as-needed
+ -Wl,--gc-sections
+)
+install(TARGETS cynara-core LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
+
+###########################################
+# build and install libcynara-client
+###########################################
+add_library(cynara-client SHARED ${LIBCLI_SOURCES})
+target_compile_definitions(cynara-client PRIVATE
RCYN_DEFAULT_SOCKET_DIR="${DEFAULT_SOCKET_DIR}"
)
-SET_TARGET_PROPERTIES(cynara PROPERTIES
+set_target_properties(cynara-client PROPERTIES
+ VERSION ${CYNARA_VERSION}
+ SOVERSION ${CYNARA_SOVERSION})
+target_link_options(cynara-client
+ PRIVATE
+ -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export-cynara-client.map
+ -Wl,--as-needed
+ -Wl,--gc-sections
+)
+install(TARGETS cynara-client LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
+install(FILES rcyn-client.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/cynara)
+
+###########################################
+# build and install libcynara-compat
+###########################################
+add_library(cynara-compat SHARED ${LIBCOMPAT_SOURCES})
+set_target_properties(cynara-compat PROPERTIES
VERSION ${CYNARA_VERSION}
SOVERSION ${CYNARA_SOVERSION})
-TARGET_LINK_LIBRARIES(cynara
- -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map
+target_link_libraries(cynara-compat
+ PRIVATE cynara-client
+)
+target_link_options(cynara-compat
+ PRIVATE
+ -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export-cynara-compat.map
-Wl,--as-needed
-Wl,--gc-sections
)
-INSTALL(TARGETS cynara LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
-INSTALL(FILES rcyn-client.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/cynara)
+install(TARGETS cynara-compat LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
###########################################
# build and install cynarad
DEFAULT_INIT_FILE="${DEFAULT_INIT_FILE}"
RCYN_DEFAULT_SOCKET_DIR="${DEFAULT_SOCKET_DIR}"
)
-target_link_libraries(cynarad cap)
+if(SYSTEMD)
+ target_compile_definitions(cynarad PRIVATE WITH_SYSTEMD_ACTIVATION)
+ target_link_libraries(cynarad ${libsystemd_LDFLAGS} ${libsystemd_LINK_LIBRARIES})
+ target_include_directories(cynarad PRIVATE ${libsystemd_INCLUDE_DIRS})
+ target_compile_options(cynarad PRIVATE ${libsystemd_CFLAGS})
+endif()
+target_link_libraries(cynarad cynara-core cap)
install(TARGETS cynarad
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
###########################################
# build and install cynadm
###########################################
-ADD_EXECUTABLE(cynadm main-cynadm.c expire.c)
-TARGET_LINK_LIBRARIES(cynadm cynara)
-INSTALL(TARGETS cynadm
+add_executable(cynadm main-cynadm.c expire.c)
+target_link_libraries(cynadm cynara-client)
+install(TARGETS cynadm
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
###########################################
# build and install test-old-cynara
###########################################
-ADD_EXECUTABLE(test-old-cynara main-test-old-cynara.c)
-TARGET_LINK_LIBRARIES(test-old-cynara cynara)
-INSTALL(TARGETS test-old-cynara
+add_executable(test-old-cynara main-test-old-cynara.c)
+target_link_libraries(test-old-cynara cynara-compat)
+install(TARGETS test-old-cynara
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
-###########################################
-# alterations for SYSTEMD and socket specs
-###########################################
-
-if(SYSTEMD)
- target_compile_definitions(cynarad PRIVATE WITH_SYSTEMD_ACTIVATION)
- target_link_libraries(cynarad ${libsystemd_LDFLAGS} ${libsystemd_LINK_LIBRARIES})
- target_include_directories(cynarad PRIVATE ${libsystemd_INCLUDE_DIRS})
- target_compile_options(cynarad PRIVATE ${libsystemd_CFLAGS})
-endif()
-
--- /dev/null
+{
+global:
+ rcyn_*;
+local:
+ *;
+};
+
+
{
global:
- rcyn_*;
cynara_*;
local:
*;
--- /dev/null
+{
+global:
+ *;
+};
+
+