Changeset 3821

Show
Ignore:
Timestamp:
12/15/08 12:29:21 (4 years ago)
Author:
gpolo
Message:

Merged revisions 1370,1377,1406,1450-1453,1458,1463-1464 via svnmerge from
http://svn.umitproject.org/svnroot/umit/trunk

........

r1370 | ignotus21 | 2007-08-14 22:16:00 -0300 (Tue, 14 Aug 2007) | 1 line


Solve the missing markup in 'OS Class' on HostDetailsPage?.

........

r1377 | ejlb | 2007-08-15 09:27:32 -0300 (Wed, 15 Aug 2007) | 2 lines


Merge from r5558. Error message when no target is specified

........

r1406 | ejlb | 2007-08-17 06:38:06 -0300 (Fri, 17 Aug 2007) | 1 line


Merge from r5593. Now .usr is only added when no extension is specified by the user

........

r1450 | ejlb | 2007-08-20 07:30:40 -0300 (Mon, 20 Aug 2007) | 7 lines


Merge from r5624 nmap trunk


Added support to umit for searching unsaved scans. If an unsaved scan
matches the search query it's name (prepended with 'Unsaved') will
appear in the results. When it is clicked on the scans tab will be
automatically switched to.

........

r1451 | boltrix | 2007-08-20 09:39:21 -0300 (Mon, 20 Aug 2007) | 1 line


Setting a less restrictive umask during installation

........

r1452 | boltrix | 2007-08-20 09:48:17 -0300 (Mon, 20 Aug 2007) | 1 line


Resolved the conflict generated by the update version script

........

r1453 | boltrix | 2007-08-20 09:55:03 -0300 (Mon, 20 Aug 2007) | 1 line


Removed umit.db from setup.py

........

r1458 | boltrix | 2007-08-20 11:31:10 -0300 (Mon, 20 Aug 2007) | 1 line


Now setup will set permission to every file installed, except the umit script, which distutils already take care of. The system wide umask didn't work.

........

r1463 | boltrix | 2007-08-20 15:29:52 -0300 (Mon, 20 Aug 2007) | 1 line


Now, umit will find the modules path even if the user used --prefix to specify a different path for installation

........

r1464 | boltrix | 2007-08-20 16:59:10 -0300 (Mon, 20 Aug 2007) | 1 line


Installer will set perms of reguar files to 644 instead of 744

........

Location:
branch/NetworkInventory
Files:
17 modified

Legend:

Unmodified
Added
Removed
  • branch/NetworkInventory

    • Property svnmerge-integrated
      •  

        old new  
        1 /trunk:1-560 
         1/trunk:1-560,1370-1397,1399-1418,1420-1464 
  • branch/NetworkInventory/install_scripts/macosx/setup.py

    r1318 r3821  
    2727 
    2828VERSION = "0.9.4" 
    29 REVISION = "1288" 
     29REVISION = "1453" 
    3030 
    3131# Directories for POSIX operating systems 
     
    5959                            [os.path.join(config_dir, 'scan_profile.usp')] + 
    6060                            [os.path.join(config_dir, 'umit_version')] + 
    61                             [os.path.join(config_dir, 'umit.db')] +  
    6261                            glob(os.path.join(config_dir, '*.xml'))+ 
    6362                            glob(os.path.join(config_dir, '*.txt'))), 
  • branch/NetworkInventory/install_scripts/unix/MANIFEST.in

    r1349 r3821  
    1010recursive-include share/umit/docs/wizard *.xml 
    1111recursive-include share/umit/docs/screenshots *.png 
    12 recursive-include share/umit/config *.xml *.conf *.usp *.txt *.db umit_version 
     12recursive-include share/umit/config *.xml *.conf *.usp *.txt umit_version 
    1313recursive-include share/umit/misc *.dmp 
    1414recursive-include umitCore *.py 
  • branch/NetworkInventory/install_scripts/unix/setup.py

    r1349 r3821  
    2626 
    2727from glob import glob 
    28 from stat import ST_MODE 
     28from stat import ST_MODE, S_IRWXU, S_IRGRP, S_IROTH 
    2929 
    3030 
    3131VERSION = "0.9.4" 
    32 REVISION = "1288" 
     32REVISION = "1463" 
    3333 
    3434# Directories for POSIX operating systems 
     
    118118        install.run(self) 
    119119 
     120        self.set_perms() 
     121        self.set_modules_path() 
    120122        self.fix_paths() 
    121123        self.create_uninstaller() 
     
    156158        mode = ((os.stat(uninstaller_filename)[ST_MODE]) | 0555) & 07777 
    157159        os.chmod(uninstaller_filename, mode) 
     160 
     161    def set_modules_path(self): 
     162        umit = os.path.join(self.install_scripts, "umit") 
     163        modules = self.install_lib 
     164 
     165        re_sys = re.compile("^import sys$") 
     166 
     167        ufile = open(umit, "r") 
     168        ucontent = ufile.readlines() 
     169        ufile.close() 
     170 
     171        uline = None 
     172        for line in xrange(len(ucontent)): 
     173            if re_sys.match(ucontent[line]): 
     174                uline = line + 1 
     175                break 
     176 
     177        ucontent.insert(uline, "sys.path.append('%s')\n" % modules) 
     178 
     179        ufile = open(umit, "w") 
     180        ufile.writelines(ucontent) 
     181        ufile.close() 
     182 
     183        print ">>> UMIT", open(umit, "r").readlines()[:uline + 5] 
     184 
     185    def set_perms(self): 
     186        re_bin = re.compile("(bin)") 
     187        for output in self.get_outputs(): 
     188            if re_bin.findall(output): 
     189                continue 
     190 
     191            if os.path.isdir(output): 
     192                os.chmod(output, S_IRWXU | \ 
     193                                 S_IRGRP | \ 
     194                                 S_IXGRP | \ 
     195                                 S_IROTH | \ 
     196                                 S_IXOTH) 
     197            else: 
     198                os.chmod(output, S_IRUSR | 
     199                                 S_IWUSR | \ 
     200                                 S_IRGRP | \ 
     201                                 S_IROTH) 
    158202 
    159203    def fix_paths(self): 
     
    241285      version = VERSION, 
    242286      scripts = ['umit', 'scheduler-umit'], 
    243       packages = ['', 'umitCore', 'umitDB', 'umitGUI', 'umitInventory',  
     287      packages = ['', 'umitCore', 'umitDB', 'umitGUI', 'umitInventory', 
    244288                  'higwidgets'], 
    245289      data_files = data_files, 
  • branch/NetworkInventory/install_scripts/utils/add_splash_version.py

    r1318 r3821  
    3030FONT = os.path.join(BASE_DIR, "fonts", "FreeSansBold.ttf") 
    3131VERSION = "0.9.4" 
    32 REVISION = "1288" 
     32REVISION = "1453" 
    3333 
    3434splash = Image.open(os.path.join(BASE_DIR, "images", "splash.png")) 
  • branch/NetworkInventory/install_scripts/windows/setup.py

    r1318 r3821  
    3131 
    3232VERSION = "0.9.4" 
    33 REVISION = "1288" 
     33REVISION = "1453" 
    3434 
    3535# Directories for POSIX operating systems 
     
    7373                            [os.path.join(config_dir, 'scan_profile.usp')] + 
    7474                            [os.path.join(config_dir, 'umit_version')] + 
    75                             [os.path.join(config_dir, 'umit.db')] +  
    7675                            glob(os.path.join(config_dir, '*.xml'))+ 
    7776                            glob(os.path.join(config_dir, '*.txt'))), 
  • branch/NetworkInventory/share/umit/config/umit_version

    r1318 r3821  
    110.9.4 
    2 1288 
     21453 
  • branch/NetworkInventory/umitCore/Diff.py

    r1179 r3821  
    3131         
    3232        self.umit_top_banner = ['|'+'-'*70+'|\n', 
    33                             '|'+_('UMIT - The nmap frontend').center (70)+'|\n', 
    34                             '|'+_('http://umit.sourceforge.net').center(70)+'|\n', 
    35                             '|'+' '*70+'|\n', 
    36                             '|'+_('This diff was generated by UMIT').center(70)+'|\n', 
    37                             '|'+_("(Changes to this file can make UMIT unable to read it.)").center(70)+'|\n', 
    38                             '|'+'-'*70+'|\n', 
    39                             '\n', 
    40                             '-'*10+_(' Start of diff ')+'-'*10+'\n'] 
     33            '|'+_('UMIT - The nmap frontend').center (70)+'|\n', 
     34            '|'+_('http://umit.sourceforge.net').center(70)+'|\n', 
     35            '|'+' '*70+'|\n', 
     36            '|'+_('This diff was generated by UMIT').center(70)+'|\n', 
     37            '|'+_("(Changes to this file can make UMIT unable to read it.)").center(70)+'|\n', 
     38            '|'+'-'*70+'|\n', 
     39            '\n', 
     40            '-'*10+_(' Start of diff ')+'-'*10+'\n'] 
    4141         
    4242        self.end_diff = ['\n'+'-'*10+_(' End of diff ')+'-'*10+'\n'] 
  • branch/NetworkInventory/umitCore/NmapParser.py

    r1318 r3821  
    751751 
    752752        self.nmap_xml_file = None 
     753        self.unsaved = False 
    753754 
    754755    def set_parser(self, parser): 
     
    12711272                return xml_file 
    12721273 
     1274    def set_unsaved(self): 
     1275        self.unsaved = True 
     1276 
     1277    def is_unsaved(self): 
     1278        return self.unsaved 
    12731279 
    12741280def nmap_parser_sax(nmap_xml_file=""): 
  • branch/NetworkInventory/umitCore/Paths.py

    r1349 r3821  
    3030 
    3131VERSION = "0.9.4" 
    32 REVISION = "1288" 
     32REVISION = "1453" 
    3333 
    3434CONFIG_DIR = join("share", "umit", "config") 
     
    295295    copy_config_file("target_list.txt", main_dir, user_dir) 
    296296    copy_config_file("umit_version", main_dir, user_dir) 
    297     copy_config_file("umit.db", main_dir, user_dir) 
    298297    copy_config_file("umitng.db", main_dir, user_dir) 
    299298    copy_config_file("timeline-settings.conf", main_dir, user_dir) 
  • branch/NetworkInventory/umitCore/SearchResult.py

    r1318 r3821  
    295295                    yield parsed 
    296296 
     297class SearchTabs(SearchResult, object): 
     298    def __init__(self, notebook): 
     299        self.scan_notebook = notebook 
     300 
     301    def get_scan_results(self): 
     302        scan_file = None 
     303        for i in range(self.scan_notebook.get_n_pages()): 
     304            sbook_page = self.scan_notebook.get_nth_page(i) 
     305 
     306            if not sbook_page.status.get_empty(): 
     307                scan_file = sbook_page.command_execution.get_xml_output_file() 
     308            if scan_file and os.access(scan_file, os.R_OK) and os.path.isfile(scan_file): 
     309                log.debug(">>> Retrieving unsaved scan result: %s" % scan_file) 
     310 
     311                try: 
     312                    parsed = NmapParser() 
     313                    parsed.set_xml_file(scan_file) 
     314                    parsed.parse() 
     315                    parsed.set_scan_name("Unsaved " + sbook_page.get_tab_label()) 
     316                    parsed.set_unsaved() 
     317                except: 
     318                    pass 
     319                else: 
     320                    yield parsed 
    297321 
    298322if __name__ == "__main__": 
  • branch/NetworkInventory/umitGUI/MainWindow.py

    r1331 r3821  
    469469 
    470470    def _search_scan_result(self, widget): 
    471         search_window = SearchWindow(self._load_search_result) 
     471        search_window = SearchWindow(self._load_search_result, self.scan_notebook) 
    472472        search_window.show_all() 
    473473 
    474474    def _load_search_result(self, results): 
    475475        for result in results: 
    476             page = self._load(parsed_result=results[result][1], 
     476            if results[result][1].is_unsaved(): 
     477                for i in range(self.scan_notebook.get_n_pages()): 
     478                    if results[result][0] == "Unsaved " + \ 
     479                    self.scan_notebook.get_nth_page(i).get_tab_label(): 
     480                        self.scan_notebook.set_current_page(i) 
     481            else: 
     482                page = self._load(parsed_result=results[result][1], 
    477483                              title=results[result][1].scan_name) 
    478             page.status.set_search_loaded() 
     484                page.status.set_search_loaded() 
    479485 
    480486    def _close_scan_cb(self, widget, data=None): 
     
    867873            if (response == gtk.RESPONSE_OK): 
    868874                filename = self._save_results_filechooser_dialog.get_filename() 
    869                 filter = self._save_results_filechooser_dialog.get_filter() 
    870                 # determine file extension from filter and filename 
    871                 if (filter.get_name() == "UMIT Scan Results (*.usr)" and 
    872                 not (filename.find('.usr') == len(filename)-4)): 
    873                     filename += '.usr' 
     875                # add .usr to filename if there is no other extension 
     876                if filename.find('.') == -1: 
     877                    filename += ".usr" 
    874878                self._save(current_page, filename) 
    875879                 
  • branch/NetworkInventory/umitGUI/ScanHostDetailsPage.py

    r1179 r3821  
    265265            try: 
    266266                self.set_osclass(os['osclass']) 
     267                self.osclass_expander.set_use_markup(True) 
    267268                table.attach(self.osclass_expander,0,2,y1,y2) 
    268269            except:pass 
  • branch/NetworkInventory/umitGUI/ScanNotebook.py

    r1331 r3821  
    461461            self.set_tab_label(profile) 
    462462 
    463         #### 
    464         # Setting status to scanning 
    465         self.status.set_scanning() 
    466         #### 
    467          
    468463        if target != '':     
    469464            self.toolbar.add_new_target(target) 
    470465 
     466        if (command.find("-iR") == -1 and command.find("-iL") == -1): 
     467            if command.find("<target>") > 0: 
     468                warn_dialog = HIGAlertDialog(message_format=_("No Target Host!"),  
     469                                             secondary_text=_("Target specification \ 
     470is mandatory. Either by an address in the target input box or through the '-iR' and \ 
     471'-iL' nmap options. Aborting scan."), 
     472                                             type=gtk.MESSAGE_ERROR) 
     473                warn_dialog.run() 
     474                warn_dialog.destroy() 
     475                return 
     476 
    471477        if command != '': 
     478            # Setting status to scanning 
     479            self.status.set_scanning() 
    472480            self.execute_command(command) 
    473481        else: 
     
    480488            warn_dialog.run() 
    481489            warn_dialog.destroy() 
    482      
     490 
    483491    def close_tab(self): 
    484492        try: 
  • branch/NetworkInventory/umitGUI/SearchGUI.py

    r1318 r3821  
    3737from umitCore.UmitLogging import log 
    3838from umitCore.NmapParser import months 
    39 from umitCore.SearchResult import SearchDir, SearchDB 
     39from umitCore.SearchResult import SearchDir, SearchDB, SearchTabs 
    4040from umitCore.UmitConf import SearchConfig 
    4141 
     
    5050 
    5151class SearchGUI(gtk.HPaned, object): 
    52     def __init__(self): 
     52    def __init__(self, notebook): 
    5353        gtk.HPaned.__init__(self) 
    5454 
     
    8989        self.scan_num = 1 
    9090        self.id = 0 
     91        self.notebook = notebook 
    9192 
    9293    def _create_widgets(self): 
     
    424425                self.append_result(result) 
    425426 
    426  
    427427        if self.directory: 
    428428            search_dir = SearchDir(self.directory, self.file_extension) 
     
    430430            for result in search_dir.search(**search_dict): 
    431431                self.append_result(result) 
     432 
     433        search_tabs = SearchTabs(self.notebook) 
     434        for result in search_tabs.search(**search_dict): 
     435            self.append_result(result)   
    432436 
    433437    def clear_result_list(self): 
  • branch/NetworkInventory/umitGUI/SearchWindow.py

    r1215 r3821  
    5252 
    5353class SearchWindow(BaseSearchWindow, object): 
    54     def __init__(self, load_method): 
     54    def __init__(self, load_method, notebook): 
    5555        BaseSearchWindow.__init__(self) 
    5656 
    5757        self.load_method = load_method 
     58        self.notebook = notebook 
    5859 
    5960        self._create_widgets() 
     
    6667        self.btn_open = HIGButton(stock=gtk.STOCK_OPEN) 
    6768        self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE) 
    68         self.search_gui = SearchGUI() 
     69        self.search_gui = SearchGUI(self.notebook) 
    6970 
    7071    def _pack_widgets(self):