Esempio n. 1
0
"""

import sys
import urllib2
from SimpleXMLRPCServer import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
from optparse import OptionParser

from authorizedkeys import AuthorizedKeysDB
from admintools import get_key_from_input
from keyparsers import PubKeyException
import tools
import config
import customlogger

logger = customlogger.get_logger("xmlrpc", filepath=config.XMLRPC_LOG)

class Unauthorized(Exception): pass




def add_key(username, key_input, comment):
    if username == config.ADMIN:
        raise Unauthorized("Cannot set admin's key over xmlrpc!")
    
    # Cannot use stdin from xmlprc
    if key_input == '-':
        raise PubKeyException("Invalid public key")
        
    
Esempio n. 2
0
License along with Subssh.  If not, see
<http://www.gnu.org/licenses/>.
"""

import sys
import os
import subprocess
import re
import inspect
import getpass
from string import Template
from optparse import OptionParser

import config
import customlogger
logger = customlogger.get_logger(__name__)

username_chars = r"a-zA-Z_-"

safe_chars = r"a-zA-Z0-9_\-\."

safe_chars_only_pat = re.compile(r"^[%s]+$" % safe_chars )


not_safe_char = re.compile(r"[^%s]{1}" % safe_chars)
def to_safe_chars(string):
    string = string.replace("ä", "a")
    string = string.replace("Ä", "A")
    string = string.replace("ö", "o")
    string = string.replace("Ö", "O")
    string = string.replace(" ", "_")
Esempio n. 3
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public
License along with Subssh.  If not, see
<http://www.gnu.org/licenses/>.
"""


import config



import customlogger
logger = customlogger.get_logger(__name__)

access_logger = customlogger.get_logger("access", filepath=config.LOG_ACCESS)


import apprunner
import shell
import tools
import appimporter
appimporter.import_all_apps_from_config()




def dispatch():