The branch, master has been updated via e7e1cf3 Update README. via b711455 cmake: Add cmake config mode file. via 3f4070e cmake: Add pkgconfig file. from 6cf4553 nwrap: Fix fd checks.
http://gitweb.samba.org/?p=nss_wrapper.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit e7e1cf368958d20b8174e035e9faca8be291341e Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 22 10:33:06 2014 +0100 Update README. commit b711455f25980f0e8bc6049c9f800d3fdbeac20a Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 22 10:29:07 2014 +0100 cmake: Add cmake config mode file. commit 3f4070e7d15528e785fe11de8ca62ba56613f059 Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 22 10:28:11 2014 +0100 cmake: Add pkgconfig file. ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 22 ++++++++++++++++ README | 47 +++++++++++++++++++++++++++++------ nss_wrapper-config-version.cmake.in | 11 ++++++++ nss_wrapper.pc.cmake | 3 ++ 4 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 nss_wrapper-config-version.cmake.in create mode 100644 nss_wrapper.pc.cmake Changeset truncated at 500 lines: diff --git a/CMakeLists.txt b/CMakeLists.txt index e8b0ad0..8359849 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,28 @@ install( DESTINATION ${BIN_INSTALL_DIR}) +# pkg-config file +configure_file(nss_wrapper.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/nss_wrapper.pc @ONLY) +install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/nss_wrapper.pc + DESTINATION + ${LIB_INSTALL_DIR}/pkgconfig + COMPONENT + pkgconfig +) + +# cmake config files +configure_file(nss_wrapper-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/nss_wrapper-config-version.cmake @ONLY) +install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/nss_wrapper-config-version.cmake + DESTINATION + ${CMAKE_INSTALL_DIR} + COMPONENT + devel +) + if (UNIT_TESTING) find_package(CMocka REQUIRED) include(AddCMockaTest) diff --git a/README b/README index 53646c7..3edef91 100644 --- a/README +++ b/README @@ -1,19 +1,50 @@ NSS wrapper library ==================== -This is a wrapper for the user, group and hosts NSS API allowing the use of -other data sources. +There are projects which provide daemons needing to be able to create, modify +and delete unix users. Or just switch user ids to interact with the system e.g. +a user space file server. To be able to test that you need the privilege to +modify the passwd and groups file. With nss_wrapper it is possible to define +your own passwd and groups file which will be used by software to act correctly +while under test. -To be able to use it you need to set the following environment variables: +If you have a client and server under test they normally use functions to +resolve network names to addresses (dns) or vice versa. The nss_wrappers allow +you to create a hosts file to setup name resolution for the addresses you use +with socket_wrapper. + +The first environment variable you need to set is: LD_PRELOAD=libnss_wrapper.so -NSS_WRAPPER_PASSWD=/path/to/your/passwd -NSS_WRAPPER_GROUP=/path/to/your/group + +For user and group accounts you need to create two files: 'passwd' and 'group'. +The format of the passwd file is described in 'man 5 passwd' and the group file +in 'man 5 group'. So you can fill these files with made up accounts. You point +nss_wrapper to them using the two variables: + +NSS_WRAPPER_PASSWD=/path/to/your/passwd and +NSS_WRAPPER_GROUP=/path/to/your/group. + +If you also need to emulate network name resolution in your enviornment, +especially with socket_wrapper, you can write a hosts file. The format is +described in 'man 5 hosts'. Then you can point nss_wrapper to your hosts +file using: NSS_WRAPPER_HOSTS=/path/to/your/hosts +If you need to return a hostname which is different from the one of your +machine is using you can use: + NSS_WRAPPER_HOSTNAME=test.example.org -You can either enable user and group resolving or only hosts. If you don't know -how the passwd file should look like, please read 'man 5 passwd', for the -groups file 'man 5 group' and for hosts 'man 5 hosts'. +If you have a project which also provides user and group information out of a +database, you normally write your own nss modules. nss_wrapper is able to load +nss modules and ask them first before looking into the faked passwd and group +file. To point nss_wrapper to the module you can do that using + +NSS_WRAPPER_MODULE_SO_PATH=/path/to/libnss_yourmodule.so + +As each nss module has a special prefix like _nss_winbind_getpwnam() you need +to set the prefix too so nss_wrapper can load the functions with: + +NSS_WRAPPER_MODULE_FN_NAME=<prefix> diff --git a/nss_wrapper-config-version.cmake.in b/nss_wrapper-config-version.cmake.in new file mode 100644 index 0000000..98f292c --- /dev/null +++ b/nss_wrapper-config-version.cmake.in @@ -0,0 +1,11 @@ +set(PACKAGE_VERSION @APPLICATION_VERSION@) + +# Check whether the requested PACKAGE_FIND_VERSION is compatible +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/nss_wrapper.pc.cmake b/nss_wrapper.pc.cmake new file mode 100644 index 0000000..6fb8ff2 --- /dev/null +++ b/nss_wrapper.pc.cmake @@ -0,0 +1,3 @@ +Name: @APPLICATION_NAME@ +Description: The nss_wrapper library +Version: @APPLICATION_VERSION@ -- NSS Wrapper Repository