Esempio n. 1
0
def create_user_dir(config_file, user_home):
    log.debug(">>> Create user dir at given home: %s" % user_home)
    log.debug(">>> Using %s as source" % config_file)

    main_umit_conf = UmitConfigParser()
    main_umit_conf.read(config_file)
    paths_section = "paths"

    user_dir = join(user_home, base_paths['config_dir'])

    if exists(user_home)\
           and access(user_home, R_OK and W_OK)\
           and not exists(user_dir):
        mkdir(user_dir)
        log.debug(">>> Umit user dir successfully created! %s" % user_dir)
    else:
        log.warning(">>> No permissions to create user dir!")
        return False

    main_dir = split(config_file)[0]
    copy_config_file("options.xml", main_dir, user_dir)
    copy_config_file("profile_editor.xml", main_dir, user_dir)
    copy_config_file("scan_profile.usp", main_dir, user_dir)
    copy_config_file("umit_version", main_dir, user_dir)
    copy_config_file("wizard.xml", main_dir, user_dir)

    return dict(user_dir = user_dir,
                config_dir = user_dir,
                config_file = copy_config_file("umit.conf",
                                               split(config_file)[0],
                                               user_dir))
    def get_ipv6_addresses (self):
        log.warning(_("umitCore.NmapParser.get_ipv6_address deprecated! Use \
umitCore.NmapParser.get_ipv6 instead."))
        return self.get_ipv6()
    def set_ipv6_address(self, addr):
        log.warning(_("umitCore.NmapParser.set_ipv6_address deprecated! Use \
umitCore.NmapParser.set_ipv6 instead."))
        self.set_ipv6(addr)
    def get_mac_address(self):
        log.warning(_("umitCore.NmapParser.get_mac_address deprecated! Use \
umitCore.NmapParser.get_mac instead."))
        return self.get_mac()