summaryrefslogtreecommitdiffstats
path: root/proxy
Commit message (Collapse)AuthorAgeFilesLines
* Fix potential segfault in gssi_inquire_context().Günther Deschner2014-02-051-2/+2
| | | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Block parent process until child is initialized.Simo Sorce2014-01-153-6/+50
| | | | | | | | | | | | This way the init system will not proceed starting dependencies until gssproxy is actually ready to serve requests. In particular this is used to make sure the nfsd proc file has been touched before the nfsd server is started. Resolves: https://fedorahosted.org/gss-proxy/ticket/114 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add utility functions to read()/write() safelySimo Sorce2014-01-152-0/+41
| | | | | | | Automatically handle short reads due to singals interrupting the process. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Make name conversion more robust to failureSimo Sorce2014-01-151-10/+14
| | | | | | | | | | | | | | | | NTLMSSP does not have export_name functions yet, this was causing gss_export_composite_name() to fail with a GSS_S_UNAVAILABLE error. This should be ignored, however it wasn't and on top of that the output structure was initialized but held pointers to memory freed at exit (due to the error). Make the function not failed if a mechanism do not have composite export function, but if it does make sure the output is not littered with invalid pointers. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add zero termination when the buffer is a stringSimo Sorce2014-01-153-1/+24
| | | | | | | | | | | | | This shouldn't be needed but apaprently there are a number of applications like mod_auth_kerb that just blindly assume the out buffer returned by gss_diplay_name() is a zero terminated string even though there is no guarantee it is in the API. To avoid annoying misbehavior we forcibly zero terminate strings copied and returned by the interposer. Fixes: https://fedorahosted.org/gss-proxy/ticket/101 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add support for dropping privilegesSimo Sorce2014-01-145-0/+75
| | | | | | | | | | | | | | If the 'proxy user' configuation option is set in the [gssproxy] section then GSS Proxy will drop privileges to the specified after setting up all the sockets. Care must be taken to make sure all the resources the daemon need access to (keytabs, ccache directories, etc..) are accessible as the proxy user. Implements: https://fedorahosted.org/gss-proxy/ticket/102 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Fix config token parsing.Simo Sorce2013-12-091-1/+0
| | | | | | | Resolves: https://fedorahosted.org/gss-proxy/ticket/112 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Change version to 0.3.1Günther Deschner2013-11-261-1/+1
| | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com>
* Use gp_strerror() everywhere instead of strerror()Simo Sorce2013-11-225-17/+17
| | | | | | https://fedorahosted.org/gss-proxy/ticket/111 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add Thread-safe implementation of strerror()Simo Sorce2013-11-222-0/+62
| | | | | | | | | | | | Unfortunately strerror() is not thread safe so we have to juggle with strerror_r() which is a can of worms as 2 incompatible implementations are available depending on what is defined at compile time. Try to do something sane. https://fedorahosted.org/gss-proxy/ticket/111 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Use secure_getenv in client and mechglue moduleSimo Sorce2013-11-216-6/+30
| | | | | | | | | | proxymehc.so may be used in setuid binaries so follow best security practices and use secure_getenv() if available. Fallback to poorman emulation when secure_getenv() is not available. Resolves: https://fedorahosted.org/gss-proxy/ticket/110 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* creds: Allow admins to define only client credsSimo Sorce2013-11-201-1/+6
| | | | | | | When a service is configured with cred_usage = initiate it is ok to allow only client credentials to be defined. Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* config: Do not modify const stringsSimo Sorce2013-11-201-1/+9
| | | | | | | Take a copy here, the option string is const and strtok_r() is not a safe function as it may change the string it manipulates. Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* man: Describe new flag filtering/enforcing optionsSimo Sorce2013-11-201-0/+58
| | | | | | Resolves: https://fedorahosted.org/gss-proxy/ticket/109 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* server: Implement flag filtering enforcementSimo Sorce2013-11-203-0/+11
| | | | | | Resolves: https://fedorahosted.org/gss-proxy/ticket/109 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* config: Add code to source flag filtersSimo Sorce2013-11-202-0/+90
| | | | | | | | | | | | | | | | | | | 2 New configuration options are made available: - filter_flags - enforce_flags Any GSS Flags listed in the filter_flags option is forcibly filtered out before a gss_init_sec_context() call is invoked. Any GSS Flags listed in the enforce_flags option is forcibly added to the list of flags requested by a gss_init_sec_context() call is invoked. Flags can be either literals or numeric and must be preceded by the sign + (to add to the list) or - (to remove from the list). Resolves: https://fedorahosted.org/gss-proxy/ticket/109 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Try impersonation even when a name is not providedSimo Sorce2013-11-201-0/+5
| | | | | | | In some cases a name may not be provided, still try to perform impersonation if the service is configured that way. Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Autoinitialize creds on init_sec_contextSimo Sorce2013-11-201-6/+19
| | | | | | | | If the remote client tries to initialize the context without first acquiring credentials, try to acquire appropriate credentials if the service allows it. Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Fix continuations in context establishment callsSimo Sorce2013-11-199-24/+77
| | | | | | | | | | | | Properly support continuations, including returning the rigth error code and exporting partial contexts. Fixes multistep authentications in particular for the initialization case which always uses continuations. Resolves: https://fedorahosted.org/gss-proxy/ticket/108 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Fix calling gpm_inquire_cred_by_mechSimo Sorce2013-11-191-1/+2
| | | | | | | | | | | We need to pass the real mechanism oid here, not the spcial oid. special oids are used exclusively by the interposer and gssapi machinery that calls the interposer, they must never be propagated to clients or servers. https://fedorahosted.org/gss-proxy/ticket/107 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add way to return regular oid from specialSimo Sorce2013-11-192-13/+43
| | | | | | | | | | In some cases we need to pass on the corresponding real oid, after we are given a special oid. Add helper functions to do that. https://fedorahosted.org/gss-proxy/ticket/107 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Preserve requested flags and lifetimeSimo Sorce2013-11-191-0/+3
| | | | | | | | | These arguments have been accidentally forgotten causing failures for applications that specify non default flags and non indefinite lifetime. https://fedorahosted.org/gss-proxy/ticket/106 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Change version to 0.3.0Simo Sorce2013-10-231-1/+1
| | | | Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add impersonation supportSimo Sorce2013-10-234-55/+173
| | | | | | | | | | | | | By setting the impersonate flag to true, the acquisition of credentials will be done using constrained delegation (s4uself + s4u2proxy). To work this needs MIT Kereberos 1.11.4 or later. Previous versions have a bug in the import_cred function that prevents the library from properly importing previously exported delegated credentials. Resolves: https://fedorahosted.org/gss-proxy/ticket/95 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Move uid to name resolution in its own function.Simo Sorce2013-10-231-6/+19
| | | | Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add man page entry for cred_usageSimo Sorce2013-10-231-0/+9
| | | | Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add man page entry for allow_any_uidSimo Sorce2013-10-231-0/+14
| | | | Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add option to specify allowed usage.Simo Sorce2013-10-184-2/+33
| | | | | | | | | | Credentials can often be used both to accept and to initiate contexts. With this option admins can allow a specific usage only. This is to avoid allowing an unprivileged process to fool a remote client by allowing it to impersonate a server, when we only want to allow this service to use credentials to initiate contexts. Reviewed-by: Günther Deschner <gdeschner@redhat.com
* Allow arbitrary users to connect to a serviceSimo Sorce2013-10-1822-70/+90
| | | | | | | | | | | The rpc.gssd daemon is changing to fork and change uid to the unprivileged user it wants to authenticate, this means gssproxy needs to allow connection from any euid. When this is done though, the trusted flag needs to be dropped, if the connecting euid does not match the default trusted uid to prevent improper impersonation. Resolves: https://fedorahosted.org/gss-proxy/ticket/103 Reviewed-by: Günther Deschner <gdeschner@redhat.com
* docs: Fill in GSSPROXY_BEHAVIOR default setting from configure option.Günther Deschner2013-10-182-3/+11
| | | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* docs: autogenerate proxymech manpage.Günther Deschner2013-10-182-1/+2
| | | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Fix documentation to match realitySimo Sorce2013-10-181-4/+4
| | | | | | LOCAL_FIRST is our default Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Fix LOCAL_FIRST behaviorSimo Sorce2013-10-181-20/+19
| | | | | | | | | We were erroneously returning and never falling back if LOCAL_FIRST was selected. Correct also the remote first fallback flow. Resolves: https://fedorahosted.org/gss-proxy/ticket/105 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Fix resource leak in gpm_accept_sec_context().Günther Deschner2013-10-151-8/+8
| | | | | | | Resolves Coverity CID #12027. Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Use right signedness for creds buffer.Günther Deschner2013-08-281-2/+2
| | | | | | | gp_export_creds_*() functions are using a arrays of int32_t values, however this array holds uids and gids which are unsigned integers. Signed-off-by: Günther Deschner <gdeschner@redhat.com>
* Fix selinux option checkSimo Sorce2013-08-261-1/+1
| | | | | | Found by coverity (CID 11894) Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add service match using SeLinux ContextSimo Sorce2013-07-027-13/+160
| | | | | | | | | | | | Using getpeercon we can know the elinux context of the process talking to gssproxy. Use this information as an optional additional filter to match processes to service definitions. If a selinux_context option with a full user;role;type context is specified into a service section, then the connecting process must also be running under the specified selinux context in order to be allowed to connect. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Coverity fixes.Simo Sorce2013-06-273-10/+10
| | | | | | | | | | | Fix a 4 coverity issues, ranging from memory leaks, to uninitialized variables, to potential NULL derefernce. Also a TOCTOU report that is in one of the accessory test scripts. The bug itself is not reallya TOCTOU, but the check done in the script is unecessary, so I just removed it. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Further improve debugging, mention servicename, socket and euid.Günther Deschner2013-06-241-1/+4
| | | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Properly check socket for connection matching.Simo Sorce2013-06-211-3/+8
| | | | | | | | | We always need to chekc if the socket matches otherwise the worng service may be selected if a specific socket is being used but a service allowing the same euid is confgured to use the deault socket as well. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Split nfs server and client servicesSimo Sorce2013-06-211-3/+8
| | | | | | | | | | | | | | The NFS server uses a special socket for the kernel communication. Split configuration in 2 distinct services so we can use specific options that may be different between server and client. The 3 main differences so far are: 1. socket: default for client, custom for server 2. kernel_nfd option only for server 3. ccache and client keytab options only for client Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Bump version for 0.2.3 release.Günther Deschner2013-06-061-1/+1
| | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com>
* Fix nfsd socketSimo Sorce2013-06-061-0/+1
| | | | | | | | | | | The Kernel expect the knfsd socket in a specific plce that is not where our standard socket is created. Add a knfsd specific socket in the default configuration. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com> Resolves: https://fedorahosted.org/gss-proxy/ticket/93
* Add Requires: libini_config >= 1.0.0.1 to the rpm spec file.Günther Deschner2013-06-061-0/+2
| | | | | | | | | | Otherwise we would allow to be installed with an outdated and non-working libiniconfig version. Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com> Resolves: https://fedorahosted.org/gss-proxy/ticket/92
* Use verbose ding-libs error reporting when config parsing failed.Günther Deschner2013-06-051-1/+9
| | | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Require libverto-tevent to make sure libverto initialization succeedsGünther Deschner2013-06-031-0/+1
| | | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* gssproxy: report an error message on event loop failure.Günther Deschner2013-06-031-0/+2
| | | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* systemd: add require for the nfs kernel modules.Günther Deschner2013-06-031-0/+1
| | | | | | | | This assures the right startup and checking order for gssproxy and kernel nfs gssproxy client interface. Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* systemd: Make sure we start before nfs-secure services.Günther Deschner2013-05-291-0/+1
| | | | | | | They might want to use gssproxy so we need to run in advance. Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Add "make test_proxymech" to provided specfile.Günther Deschner2013-05-221-0/+1
| | | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>