Make rdcd run as user "rdc"

The rdc account will be created on installation if it does
not already exist. It will be a system account with no
home directory.

rdcd will be started as a systemd service, but change to
user "rdc". The rdc user will drop all priviliges except
CAP_DAC_OVERRIDE, permitted. This means the default mode
will have no special privileges, but have the ability to
gain write access (e.g., to sysfs) when needed.

rdc tests were being inadvertantly added to the
installation. This was adversely impacting the new
functionality, so it was corrected in this commit.

Also included are a few small formatting changes.

Change-Id: I9c6bb132fee28119fd3960594dfb97bd2e7b282a
Tá an tiomantas seo le fáil i:
Chris Freehill tiomanta 2020-08-17 14:07:25 -05:00
1 tuismitheoir 4729c47866
tiomantas 5cc498c6aa
17 comhad athraithe
+303 -112

Níor tháinig aon chomhaid le do chuardach

+8 -6
Féach ar an gComhad
@@ -88,10 +88,10 @@ message("SOVERSION: ${SO_VERSION_STRING}")
## RDC_lib-dev
set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
CACHE STRING "Location of RDC client library source code.")
# set(CMAKE_INSTALL_PREFIX "/opt/rocm"
# CACHE STRING "Default installation directory.")
# set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/rocm"
# CACHE STRING "Default packaging prefix.")
set(CMAKE_INSTALL_PREFIX ${RDC_CLIENT_ROOT_PATH}
CACHE STRING "Default installation directory.")
set(CPACK_PACKAGING_INSTALL_PREFIX ${RDC_CLIENT_ROOT_PATH}
CACHE STRING "Default packaging prefix.")
set(CPACK_GENERATOR "DEB;RPM" CACHE STRING "Default packaging generators.")
if (NOT DEFINED CPACK_PACKAGE_VENDOR)
@@ -159,9 +159,11 @@ endif ()
## Add the install directives for the runtime library.
install(TARGETS ${CLIENT_LIB}
LIBRARY DESTINATION opt/rocm/rdc/lib COMPONENT ${CLIENT_LIB_COMPONENT})
LIBRARY DESTINATION ${RDC_CLIENT_ROOT_PATH}${RDC}/lib
COMPONENT ${CLIENT_LIB_COMPONENT})
install(FILES ${SOURCE_DIR}/client/include/rdc/rdc_client.h
DESTINATION opt/rocm/rdc/include/rdc)
DESTINATION ${RDC_CLIENT_ROOT_PATH}${RDC}/include/rdc
COMPONENT ${CLIENT_HEADER_COMPONENT})
message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
message(" Finished Cmake Client Lib ")