cmake: Configure nss_wrapper and uid_wrapper
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
родитель
6596d27e19
Коммит
21b0d29e38
@ -46,6 +46,8 @@ add_subdirectory(unittests)
|
|||||||
if (WITH_CLIENT_TESTING)
|
if (WITH_CLIENT_TESTING)
|
||||||
find_package(socket_wrapper 1.1.5 REQUIRED)
|
find_package(socket_wrapper 1.1.5 REQUIRED)
|
||||||
find_package(nss_wrapper 1.1.2 REQUIRED)
|
find_package(nss_wrapper 1.1.2 REQUIRED)
|
||||||
|
find_package(uid_wrapper 1.2.0 REQUIRED)
|
||||||
|
|
||||||
find_program(SSHD_EXECUTABLE
|
find_program(SSHD_EXECUTABLE
|
||||||
NAME
|
NAME
|
||||||
sshd
|
sshd
|
||||||
@ -56,6 +58,24 @@ if (WITH_CLIENT_TESTING)
|
|||||||
if (NOT SSHD_EXECUTABLE)
|
if (NOT SSHD_EXECUTABLE)
|
||||||
message(SEND_ERROR "Could not find sshd which is required for client testing")
|
message(SEND_ERROR "Could not find sshd which is required for client testing")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# homedir will be used in passwd
|
||||||
|
set(HOMEDIR ${CMAKE_CURRENT_BINARY_DIR}/home)
|
||||||
|
|
||||||
|
### Setup nss_wrapper
|
||||||
|
configure_file(etc/passwd.in ${CMAKE_CURRENT_BINARY_DIR}/etc/passwd @ONLY)
|
||||||
|
configure_file(etc/shadow.in ${CMAKE_CURRENT_BINARY_DIR}/etc/shadow @ONLY)
|
||||||
|
configure_file(etc/group.in ${CMAKE_CURRENT_BINARY_DIR}/etc/group @ONLY)
|
||||||
|
configure_file(etc/hosts.in ${CMAKE_CURRENT_BINARY_DIR}/etc/hosts @ONLY)
|
||||||
|
|
||||||
|
set(TORTURE_ENVIRONMENT "LD_PRELOAD=${SOCKET_WRAPPER_LIBRARY}:${NSS_WRAPPER_LIBRARY}:${UID_WRAPPER_LIBRARY}")
|
||||||
|
list(APPEND TORTURE_ENVIRONMENT UID_WRAPPER=1)
|
||||||
|
list(APPEND TORTURE_ENVIRONMENT NSS_WRAPPER_PASSWD=${CMAKE_CURRENT_BINARY_DIR}/etc/passwd)
|
||||||
|
list(APPEND TORTURE_ENVIRONMENT NSS_WRAPPER_SHADOW=${CMAKE_CURRENT_BINARY_DIR}/etc/shadow)
|
||||||
|
list(APPEND TORTURE_ENVIRONMENT NSS_WRAPPER_GROUP=${CMAKE_CURRENT_BINARY_DIR}/etc/group)
|
||||||
|
|
||||||
|
message(STATUS "TORTURE_ENVIRONMENT=${TORTURE_ENVIRONMENT}")
|
||||||
|
|
||||||
add_subdirectory(client)
|
add_subdirectory(client)
|
||||||
endif (WITH_CLIENT_TESTING)
|
endif (WITH_CLIENT_TESTING)
|
||||||
|
|
||||||
|
5
tests/etc/group.in
Обычный файл
5
tests/etc/group.in
Обычный файл
@ -0,0 +1,5 @@
|
|||||||
|
users:x:1000:
|
||||||
|
sshd:x:65531:
|
||||||
|
nobody:x:65533:
|
||||||
|
nogroup:x:65534:nobody
|
||||||
|
root:x:65532:
|
2
tests/etc/hosts.in
Обычный файл
2
tests/etc/hosts.in
Обычный файл
@ -0,0 +1,2 @@
|
|||||||
|
127.0.0.10 server.libssh.site
|
||||||
|
127.0.0.21 client.libssh.site
|
5
tests/etc/passwd.in
Обычный файл
5
tests/etc/passwd.in
Обычный файл
@ -0,0 +1,5 @@
|
|||||||
|
bob:x:1000:1000:bob gecos:@HOMEDIR@/bob:/bin/false
|
||||||
|
alice:x:1001:1000:alice gecos:@HOMEDIR@/alice:/bin/bash
|
||||||
|
sshd:x:65530:65531:sshd:@HOMEDIR@:/sbin/nologin
|
||||||
|
nobody:x:65533:65534:nobody gecos:@HOMEDIR@:/bin/false
|
||||||
|
root:x:65534:65532:root gecos:@HOMEDIR@:/bin/false
|
2
tests/etc/shadow.in
Обычный файл
2
tests/etc/shadow.in
Обычный файл
@ -0,0 +1,2 @@
|
|||||||
|
alice:$6$0jWkA8VP$MvBUvtGy38jWCZ5KtqnZEKQWXvvImDkDhDQII1kTqtAp3/xH31b71c.AjGkBFle.2QwCJQH7OzB/NXiMprusr/::0:::::
|
||||||
|
bob:$6$0jWkA8VP$MvBUvtGy38jWCZ5KtqnZEKQWXvvImDkDhDQII1kTqtAp3/xH31b71c.AjGkBFle.2QwCJQH7OzB/NXiMprusr/::0:::::
|
Загрузка…
Ссылка в новой задаче
Block a user