Mercurial > p > roundup > code
comparison roundup/backends/sessions_dbm.py @ 3609:f2fda3e6fc8b
umask is now configurable (with the same 0002 default)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 27 Apr 2006 04:59:37 +0000 |
| parents | 04dc3eef67b7 |
| children | 21d3d7eeea8c |
comparison
equal
deleted
inserted
replaced
| 3608:19c0ee158c29 | 3609:f2fda3e6fc8b |
|---|---|
| 1 #$Id: sessions_dbm.py,v 1.6 2006-04-27 04:03:11 richard Exp $ | 1 #$Id: sessions_dbm.py,v 1.7 2006-04-27 04:59:37 richard Exp $ |
| 2 """This module defines a very basic store that's used by the CGI interface | 2 """This module defines a very basic store that's used by the CGI interface |
| 3 to store session and one-time-key information. | 3 to store session and one-time-key information. |
| 4 | 4 |
| 5 Yes, it's called "sessions" - because originally it only defined a session | 5 Yes, it's called "sessions" - because originally it only defined a session |
| 6 class. It's now also used for One Time Key handling too. | 6 class. It's now also used for One Time Key handling too. |
| 17 _db_type = None | 17 _db_type = None |
| 18 | 18 |
| 19 def __init__(self, db): | 19 def __init__(self, db): |
| 20 self.config = db.config | 20 self.config = db.config |
| 21 self.dir = db.config.DATABASE | 21 self.dir = db.config.DATABASE |
| 22 # ensure files are group readable and writable | 22 os.umask(db.config.UMASK) |
| 23 os.umask(0002) | |
| 24 | 23 |
| 25 def exists(self, infoid): | 24 def exists(self, infoid): |
| 26 db = self.opendb('c') | 25 db = self.opendb('c') |
| 27 try: | 26 try: |
| 28 return db.has_key(infoid) | 27 return db.has_key(infoid) |
