1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-21 18:50:38 +03:00

Remove Kerberos 5 credential cache on interrupt

This commit is contained in:
Игорь Чудов 2020-06-25 14:45:47 +04:00
parent 9bc426fa0c
commit 2803d2be72
Signed by untrusted user: nir
GPG Key ID: 0F3883600CAE7AAC

View File

@ -16,16 +16,23 @@
# 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 signal
from sys import exit
from .arguments import ExitCodeUpdater
from .kerberos import machine_kdestroy
default_handler = signal.getsignal(signal.SIGINT)
def signal_handler(sig_number, frame):
# Ignore extra signals
signal.signal(sig_number, signal.SIG_IGN)
# Kerberos cache cleanup on interrupt
machine_kdestroy(os.environ['KRB5CCNAME'])
print('Received signal, exiting gracefully')
exit(ExitCodeUpdater.EXIT_SIGINT)