1 """Delegate accounts are used to provide secure access to the XMLRPC API. They are normal Unix accounts with a shell that tunnels XMLRPC requests to the API server."""
9 SHELL = '/bin/forward_api_calls' # tunneling shell
12 def __init__(self, name): self.name = name
16 add_shell(Delegate.SHELL)
17 logger.log_call('/usr/sbin/useradd', '-p', '*', '-s', Delegate.SHELL, name)
20 def destroy(name): logger.log_call('/usr/sbin/userdel', '-r', name)
22 def configure(self, rec): accounts.install_keys(rec)
28 """Add <shell> to /etc/shells if it's not already there."""
29 etc_shells = open('/etc/shells')
30 valid_shells = etc_shells.read().split()
32 if shell not in valid_shells:
33 etc_shells = open('/etc/shells', 'a')
34 print >>etc_shells, shell