Update to use the registry for denying capabilities.

This commit is contained in:
James Vega 2004-08-01 15:35:31 +00:00
parent a927e5d897
commit 09c81c6d24
2 changed files with 18 additions and 6 deletions

View File

@ -67,7 +67,9 @@ def configure(advanced):
to run the file command. I'll disable this command
now. When you get zgrep in your path, use the command
'enable Debian.file' to re-enable the command.""")
conf.supybot.defaultCapabilities().add('-Debian.file')
capabilities = conf.supybot.capabilities()
capabilities.add('-Debian.file')
conf.supybot.capabilities.set(capabilities)
else:
output("""I can't find zgrep in your path. If you want to run
the file command with any sort of expediency, you'll
@ -78,7 +80,9 @@ def configure(advanced):
conf.supybot.plugins.Debian.pythonZgrep.setValue(True)
else:
output('I\'ll disable file now.')
conf.supybot.defaultCapabilities().add('-Debian.file')
capabilities = conf.supybot.capabilities()
capabilities.add('-Debian.file')
conf.supybot.capabilities.set(capabilities)
conf.registerPlugin('Debian')
conf.registerGlobalValue(conf.supybot.plugins.Debian, 'pythonZgrep',

View File

@ -66,28 +66,36 @@ def configure(advanced):
function of this module will not work. You may choose to
install it later. To re-enable the command then, give the
bot the command 'enable Unix.spell'.""")
conf.supybot.defaultCapabilities().add('-Unix.spell')
capabilities = conf.supybot.capabilities()
capabilities.add('-Unix.spell')
conf.supybot.capabilities.setValue(capabilities)
fortuneCmd = utils.findBinaryInPath('fortune')
if not fortuneCmd:
output("""NOTE: I couldn't find fortune in your path, so that function
of this module will not work. You may choose to install it
later. To re-enable this command then, give the bot the
command 'enable Unix.fortune'.""")
conf.supybot.defaultCapabilities().add('-Unix.fortune')
capabilities = conf.supybot.capabilities()
capabilities.add('-Unix.fortune')
conf.supybot.capabilities.setValue(capabilities)
wtfCmd = utils.findBinaryInPath('wtf')
if not wtfCmd:
output("""NOTE: I couldn't find wtf in your path, so that function of
this module won't work. You may choose to install it later;
to re-enable this command then, give the bot the command
'enable Unix.wtf'.""")
conf.supybot.defaultCapabilities().add('-Unix.wtf')
capabilities = conf.supybot.capabilities()
capabilities.add('-Unix.wtf')
conf.supybot.capabilities.setValue(capabilities)
output("""The "progstats" command can reveal potentially sensitive
information about your machine. Here's an example of its output:
%s\n""" % progstats())
if yn('Would you like to disable this command for non-owner users?',
default=True):
conf.supybot.defaultCapabilities().add('-Unix.progstats')
capabilities = conf.supybot.capabilities()
capabilities.add('-Unix.progstats')
conf.supybot.capabilities.setValue(capabilities)
def progstats():
pw = pwd.getpwuid(os.getuid())