Viewing file: authconfig-tui (31.64 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#
# Authconfig - client authentication configuration program
# Copyright (c) 1999-2008 Red Hat, Inc.
#
# Original authors: Preston Brown
# Nalin Dahyabhai
# Matt Wilson
# Python rewrite and further development by: Tomas Mraz
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# 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, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
import authinfo, acutil
import gettext, os, signal, sys
_ = gettext.lgettext
from optparse import OptionParser
import locale
locale.setlocale(locale.LC_ALL, '')
def runsAs(name):
return sys.argv[0].find(name) >= 0
if runsAs("authconfig-tui"):
import snack
class UnihelpOptionParser(OptionParser):
def print_help(self, file=None):
if file is None:
file = sys.stdout
srcencoding = locale.getpreferredencoding()
encoding = getattr(file, "encoding", None)
if not encoding or encoding == "ascii":
encoding = srcencoding
file.write(self.format_help().decode(srcencoding).encode(encoding, "replace"))
class Authconfig:
def __init__(self):
nis_avail = False
kerberos_avail = False
ldap_avail = False
smb_avail = False
cache_avail = False
def module(self):
return "authconfig"
def printError(self, error):
sys.stderr.write("%s: %s\n" % (self.module(), error))
def listHelp(self, l, addidx):
idx = 0
help = "<"
for item in l:
if idx > 0:
help += " bool(false)
|