#
# MIT Kerberos server class
#
# Copyright (c) 2016 Red Hat, Inc.
#
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 only
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import os
import subprocess
"""
Helper class to test Kerberos command line utilities
"""
if 'KRB5CCNAME' in my_env:
del my_env['KRB5CCNAME']
if extra_env is not None:
return cmd
args = ["kdestroy"]
if all_ccaches is True:
args += ["-A"]
return retval
return retval
try:
except ValueError:
return False
return False
if exp_principal != princ:
return False
return True
if retval != 0:
return 0
if retval == 1:
raise NoPrincipals
elif retval != 0:
raise Exception("Not enough output from klist -l")
try:
except NoPrincipals:
return False
return True
return False
dflprinc = None
thisrealm = None
ccache_dict = dict()
if dflprinc in ccache_dict:
else:
return ccache_dict
if retval == 1:
raise NoPrincipals
elif retval != 0: