/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

working new feature: network-hooks - Enables user-scripts to take up
                     interfaces during bootup

Show diffs side-by-side

added added

removed removed

Lines of Context:
2165
2165
        # Close all input and output, do double fork, etc.
2166
2166
        daemon()
2167
2167
    
2168
 
    gobject.threads_init()
2169
 
    
2170
2168
    global main_loop
2171
2169
    # From the Avahi example code
2172
2170
    DBusGMainLoop(set_as_default=True )
2218
2216
                           .format(e))
2219
2217
            if e.errno != errno.ENOENT:
2220
2218
                raise
2221
 
        except EOFError as e:
2222
 
            logger.warning("Could not load persistent state: "
2223
 
                           "EOFError: {0}".format(e))
2224
2219
    
2225
2220
    with PGPEngine() as pgp:
2226
2221
        for client_name, client in clients_data.iteritems():
2406
2401
        
2407
2402
        try:
2408
2403
            with os.fdopen(os.open(stored_state_path,
2409
 
                                   (os.O_CREAT | os.O_WRONLY
2410
 
                                    | os.O_TRUNC | os.O_EXCL),
2411
 
                                   (stat.S_IREAD | stat.S_IWRITE)),
2412
 
                           "wb") as stored_state:
 
2404
                                   os.O_CREAT|os.O_WRONLY|os.O_TRUNC,
 
2405
                                   0600), "wb") as stored_state:
2413
2406
                pickle.dump((clients, client_settings), stored_state)
2414
2407
        except (IOError, OSError) as e:
2415
2408
            logger.warning("Could not save persistent state: {0}"
2416
2409
                           .format(e))
2417
 
            if e.errno not in set((errno.ENOENT, errno.EACCES,
2418
 
                                   errno.EEXIST)):
 
2410
            if e.errno not in (errno.ENOENT, errno.EACCES):
2419
2411
                raise
2420
2412
        
2421
2413
        # Delete all clients, and settings from config