/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

  • Committer: teddy at bsnet
  • Date: 2011-12-23 18:19:02 UTC
  • mfrom: (505.1.25 teddy)
  • Revision ID: teddy@fukt.bsnet.se-20111223181902-fef09t3yxc3epbgy
Merge state file creation fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2406
2406
        
2407
2407
        try:
2408
2408
            with os.fdopen(os.open(stored_state_path,
2409
 
                                   os.O_CREAT|os.O_WRONLY|os.O_TRUNC,
2410
 
                                   0600), "wb") as stored_state:
 
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:
2411
2413
                pickle.dump((clients, client_settings), stored_state)
2412
2414
        except (IOError, OSError) as e:
2413
2415
            logger.warning("Could not save persistent state: {0}"
2414
2416
                           .format(e))
2415
 
            if e.errno not in (errno.ENOENT, errno.EACCES):
 
2417
            if e.errno not in set((errno.ENOENT, errno.EACCES,
 
2418
                                   errno.EEXIST)):
2416
2419
                raise
2417
2420
        
2418
2421
        # Delete all clients, and settings from config