summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* getpwman(3) can return NULL without setting errnoRobbie Harwood2015-09-141-0/+3
| | | | | Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Allow configdir and configfile to be specified togetherRobbie Harwood2015-09-141-7/+0
| | | | | | | Not being able to do this is a relic of a previous design. Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Fix formatting on noncompliant copyright linesRobbie Harwood2015-09-0466-1574/+66
| | | | | Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Ensure ini_config >= 1.2.0 for `ini_config_augment()`Robbie Harwood2015-09-042-3/+6
| | | | | Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Add HTTP service and move NFS into its own conf fileRobbie Harwood (frozencemetery)2015-09-046-21/+41
| | | | | Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Error on `allow_any_uid` issuesRobbie Harwood (frozencemetery)2015-09-041-1/+43
| | | | | | | | As per gssproxy.conf(5), setting allow_any_uid without also setting socket or selinux_context is known to cause problems. Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Extract generalized selinux context comparison functionRobbie Harwood2015-09-042-13/+26
| | | | | Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Update man pages for symbolic euids and config snippetsRobbie Harwood (frozencemetery)2015-09-042-7/+40
| | | | | Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Add support for config directoriesRobbie Harwood (frozencemetery)2015-09-044-30/+142
| | | | | | | | | | Option '-C|--configdir' has been added, and defaults to /etc/gssproxy. File "gssproxy.conf" and all files of the form "##-foo.conf" will be read from that directory. Ticket: https://fedorahosted.org/gss-proxy/ticket/122 Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Remove one layer of abstraction over dinglibsRobbie Harwood (frozencemetery)2015-08-315-400/+261
| | | | | | | | A handful of parameter name differences (`key` vs. `keyname`) have been tweaked but the function bodies are otherwise unchanged. Signed-off-by: Robbie Harwood (frozencemetery) <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Allow symbolic euids in conf filesRobbie Harwood (frozencemetery)2015-08-261-9/+25
| | | | | | Fixes: https://fedorahosted.org/gss-proxy/ticket/151 Signed-off-by: Robbie Harwood (frozencemetery) <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Specify KRB5RCACHEDIR in systemd unit fileRobbie Harwood (frozencemetery)2015-08-182-0/+3
| | | | | | | | | | | | Moving out of /var/tmp allows for improved separation with selinux and fixes an AVC denial. Signed-off-by: Robbie Harwood (frozencemetery) <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com> Ticket: https://fedorahosted.org/gss-proxy/ticket/145 Ticket: https://fedorahosted.org/gss-proxy/ticket/130 Closes #1
* Update BUILD.txtRoland Mainz2015-04-171-5/+13
| | | | | | | | | Update BUILD.txt, including package requirements for tests Fixes: https://fedorahosted.org/gss-proxy/ticket/148 Signed-off-by: Roland Mainz <rmainz@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Remove support for iniparse libraryRoland Mainz2015-04-155-272/+1
| | | | | | | | | | This library already does not support some features we need and we want to drop its usage as the code quality is bad. Fixes: https://fedorahosted.org/gss-proxy/ticket/139 Signed-off-by: Roland Mainz <rmainz@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Turn on strict aliasing rulesRoland Mainz2015-04-091-2/+4
| | | | | | | | | | | Remove -fno-strict-aliasing (this is not required because gssproxy is mostly a good ISO C99/C11 citizen) and replace it with -Werror=strict-aliasing to ensure that if *anything* creeps up the build will just fail (this requires in gcc4.x's case the use of -fstrict-aliasing, too). Signed-off-by: Roland Mainz <rmainz@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Release version 0.4.1Simo Sorce2015-03-301-1/+1
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix configuration file substitutionsSimo Sorce2015-03-302-3/+3
| | | | | | | Fixes: https://fedorahosted.org/gss-proxy/ticket/138 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Lukas Slebodnik <lslebodn@redhat.com>
* Fix handling of context initializationSimo Sorce2015-03-301-5/+7
| | | | | | | | | | | | | | If a previous call has decided to use only local (to the process) credentials, then we need to override all the way to the end. A previous patch also swapped the order in which credential handler and context handler are initialized, make sure also to swap the fallback checks. Set the behavior to the process default only if it wasn't forced to local. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Lukas Slebodnik <lslebodn@redhat.com>
* Suppress warning: use after freeLukas Slebodnik2015-03-291-0/+1
| | | | | | | | | | | | | | | | | gssx_ctx is released in case of error. After the latest changes, the old ctx is always replaced to new one and output argument is set. Although it would not be used because return code would not be success it's safer to set NULL to the pointer and avoid warnings from static analyzers. src/client/gpm_init_sec_context.c:108: alias: Assigning: "ctx" = "res->context_handle". Now both point to the same storage. src/client/gpm_init_sec_context.c:156: freed_arg: "free" frees "ctx". src/client/gpm_init_sec_context.c:173: use_after_free: Using freed pointer "ctx". Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Include header file with prototypes in implementation moduleLukas Slebodnik2015-03-291-0/+2
| | | | | | | | | Functions implemented in gp_util.c have prototypes in header file gp_common.h, but it was not included. This patch prevent potential conflicts between ptototype and definition of function. Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Remove unused parameter from get_pipe_nameLukas Slebodnik2015-03-291-2/+2
| | | | | Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Fix warning value stored to 'ret' is never readLukas Slebodnik2015-03-291-1/+2
| | | | | | | | | | | | | | Error: UNUSED_VALUE src/gp_rpc_import_and_canon_name.c:87: value_overwrite: Overwriting previous write to "ret" with value from "gp_conv_status_to_gssx(&icna->call_ctx, ret_maj, ret_min, mech, &icnr->status)". src/gp_rpc_import_and_canon_name.c:52: assigned_value: Assigning value "22" to "ret" here, but that stored value is overwritten before it can be used. Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Use pkg-config for krb5 libs tooSimo Sorce2015-03-242-55/+5
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Switch to use pkg-config for krb5-gssapiSimo Sorce2015-03-241-4/+5
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Release version 0.4.0Simo Sorce2015-03-241-1/+1
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Suppress exported_composite_name for the kernelSimo Sorce2015-03-241-0/+10
| | | | | | | | | | The kernel makes no use of this data, and ita causes allocation issues in some cases with waste of space on the kernel side. Fixes: https://fedorahosted.org/gss-proxy/ticket/129 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Nathaniel McCallum <npmccallum@redhat.com>
* Properly handle security contexts on errorSimo Sorce2015-03-245-39/+62
| | | | | | | | | | | | | | | | On error we need to make sure we do not return a pointer to a security context that may have been already freed. So make sure to always unconditionally return the context that we've been returned by our callees. Also reorganize the code so we do not accidently wipe the context and leak memoy on error. This fixed a double-free bug found by NFS folks @ Red Hat Fixes: https://fedorahosted.org/gss-proxy/ticket/137 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Nathaniel McCallum <npmccallum@redhat.com>
* Fix few build issuesLukas Slebodnik2015-03-242-8/+13
| | | | | | | | | | | - use automake variables for simplification of file installation instead of make install hooks - if configure is not called from $srcdir then few directories were not created. - few files were not removed with make unistall Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Fix variable replacement in non config filesSimo Sorce2015-03-242-7/+35
| | | | | | | Fixes: #132 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Lukas Slebodnik <lslebodn@redhat.com>
* Default to systemd initscript in rpm spec fileSimo Sorce2015-03-241-1/+1
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Lukas Slebodnik <lslebodn@redhat.com>
* Fix error in compiling without SELinuxSimo Sorce2015-03-241-10/+9
| | | | | | | | Fixes: #131 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Nathaniel McCallum <npmccallum@redhat.com> Reviewed-by: Roland Mainz <rmainz@redhat.com>
* Fix cast errorSimo Sorce2015-03-241-1/+3
| | | | | | | | | | An unsigned int cannot be cast to a size_t. On some architectures (like s390) they have different sizes resulting in both writing out of bounds and getting just a zero in the length field and causing the next operation to fail. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Nathaniel McCallum <npmccallum@redhat.com> Reviewed-by: Roland Mainz <rmainz@redhat.com>
* Really use gss-proxy in testsSimo Sorce2015-03-241-3/+4
| | | | | | | | | | | | | This is embarrassing, but due to the fact we were passing in client evnironment variables we were not actually testing the GSS-Proxy, just regular GSSAPI as the client started so quickly that the socket was not available yet and it simply fell back to regular GSSAPI. This commit allows some time for the GSS-Proxy to actually start and prevents the client from falling back by not telling it where client credentials are. Signed-off-by: Simo Sorce <simo@redhat.com>
* Use different env vars bases for gssapi testsSimo Sorce2015-03-241-2/+3
| | | | | Restrict what environment variables are available by default. gssapienv in particular should not bleed in KRB5_KTNAME.
* Prevent a backtrace when a subprocess is not foundSimo Sorce2015-03-241-2/+8
| | | | | | | Trap OSError is the kill does not find the subprocess. This may happen if the subprocess fails early and terminates on its own. Signed-off-by: Simo Sorce <simo@redhat.com>
* Do not open logfile multiple timesSimo Sorce2015-03-241-20/+20
| | | | | | Instead reuse it across the whole test by passing it down Signed-off-by: Simo Sorce <simo@redhat.com>
* Log why acquiring credentials failed.Simo Sorce2015-03-241-0/+2
| | | | | | | This will help understanding why gss-proxy interposed programs are failing. Signed-off-by: Simo Sorce <simo@redhat.com>
* Generalize GSS Display Status logger codeSimo Sorce2015-03-244-22/+65
| | | | | | | This way it can be used both in stderr debugging as well as for sending errors to syslog. Signed-off-by: Simo Sorce <simo@redhat.com>
* Install gssproxy mechanism config in mech.dSimo Sorce2015-03-241-4/+5
| | | | | | | | This requires at least Fedora version 1.11.5 where mech.d support was backported or upstreams > 1.12 version. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Guenther Deschner <gdeschner@redhat.com>
* Zero out the outputs of display_nameSimo Sorce2015-01-221-0/+5
| | | | | | | | | | The mechglue expects the mechanism function to zero them in all cases. Otherwise on error it will later try to free the output buffer value which can be an arbitrary pointer. This will cause a segfault or worse in glibc's free(). Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Roland Mainz <rmainz@redhat.com>
* BUILD: Fix building with automake 1.15Lukas Slebodnik2015-01-163-3/+10
| | | | | | | | | | | | | | | The macro AC_BUILD_AUX_DIR was used too late. As a result of this automake 1.15 generated configure script which ignored the directory build/ and was not able to find missing files. configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../..". After removing macro AC_BUILD_AUX_DIR, autoreconf will install auxiliary files into $srcdir. Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Fix memory leakLukas Slebodnik2015-01-151-2/+4
| | | | | Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Use defined enum instead of constantLukas Slebodnik2015-01-151-3/+3
| | | | | | | | Value of enum gp_rpc_accept_status GP_RPC_SUCCESS is 0 Value of enum gp_rpc_reject_status GP_RPC_RPC_MISMATCH is 0 Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Wrong coversion function was usedLukas Slebodnik2015-01-151-1/+1
| | | | | Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Suppress clang warningLukas Slebodnik2015-01-151-1/+1
| | | | | | | | Result of 'malloc' is converted to a pointer of type 'uint32_t', which is incompatible with sizeof operand type 'int32_t' Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* BUILD: Change ordering of invoking MakefilesLukas Slebodnik2015-01-151-1/+1
| | | | | | | | | | | | | | Make distcheck failed with error: Makefile:1229: tests/.deps/cli_srv_comm.Po: No such file or directory Makefile:1230: tests/.deps/interposetest.Po: No such file or directory make[2]: *** No rule to make target 'tests/.deps/interposetest.Po'. Stop. make[2]: Leaving directory './gss-proxy/proxy/bdir/gssproxy-0.3.1/_build' Makefile:1528: recipe for target 'distclean-recursive' failed make[1]: *** [distclean-recursive] Error 1 Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* BUILD: Tests did not work from parallel directoryLukas Slebodnik2015-01-151-2/+2
| | | | | | | | | | | | | | | | | | | mkdir build_dir cd build_dir ../configiure make tests ./tests/runtests.py make: ./tests/runtests.py: Command not found Makefile:2010: recipe for target 'tests' failed make: *** [tests] Error 127 make test_proxymech TMPDIR=tests/scripts/ ./tests/scripts/dlopen.sh ./.libs/proxymech.so || exit 1 /bin/sh: ./tests/scripts/dlopen.sh: No such file or directory Makefile:2056: recipe for target 'test_proxymech' failed make: *** [test_proxymech] Error 1 Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* BUILD: Fix building rpmsLukas Slebodnik2015-01-151-0/+3
| | | | | | | | | | | | | | make rpms failed becuase header file t_utils.h was not included in tarball t_accept.c:3:21: fatal error: t_utils.h: No such file or directory #include "t_utils.h" ^ compilation terminated. Makefile:445: recipe for target 't_accept.o' failed make[3]: *** [t_accept.o] Error 1 Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Add a test framework for gss-proxySimo Sorce2014-09-159-2/+727
| | | | | | | | | | | | This sets up a kdc using socket_wrapper and nss_wrapper from the cwrap project, and uses a dirty hack to force gssapi to load the current proxymech interposer library. It provisions a service and a user key then runs the interpostest binary in this artifical environment. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Guenther Deschner <gdeschner@redhat.com>
* Add cmdline option to override default socketSimo Sorce2014-09-154-4/+25
| | | | | | | | This is especially useful for testing, but can be useful for custom configurations of gss-proxy as well (containers, chroots, etc..) Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Guenther Deschner <gdeschner@redhat.com>