Don't free cred handle used in kadm5 server handle
authorTomas Kuthan <tkuthan@gmail.com>
Wed, 26 Mar 2014 16:04:30 +0000 (17:04 +0100)
committerGreg Hudson <ghudson@mit.edu>
Thu, 27 Mar 2014 15:42:11 +0000 (11:42 -0400)
commitb24c362f0589a6212f2f544263bdb76e0988c582
tree4d07a9f882eee3f9e5e999d191430804cddf461d
parent54c97cd0c435f78880d80541a20cf7f08928705d
Don't free cred handle used in kadm5 server handle

At the end of setup_gss(), gss_client_creds is released, but an alias
to the credential handle is saved in kadm5_server_handle_t in
handle->clnt->cl_auth->(struct rpc_gss_data *)ah_private->sec.cred.
Accessing these credentials (by authgss_refresh) can result in use
after free.

This fix stores credential reference in server handle and releases
the credentials in kadm5_destroy.

[ghudson@mit.edu: initialize handle->cred to correct constant; get rid
of gss_client_creds variable; clarify commit message slightly]

ticket: 7891 (new)
src/lib/kadm5/clnt/client_init.c
src/lib/kadm5/clnt/client_internal.h