Commit 00906d3b 00906d3b3bcef1a948ceff6f27b6052e47081552 by Sergey Poznyakoff

Bugfixes.

* libmu_dbm/dbm.c (mu_dbm_create_from_url): Parameter list beginning
with a negative parameter implies default safety criteria.
Fix semantics of the "default" keyword: it is different from "all".
* libmu_dbm/mudbm.h (DEFAULT_DBM_SAFETY_FLAGS): Remove.  Not needed now.
* pop3d/bulletin.c (read_bulletin_db): Remove a leftover call to
mu_dbm_safety_set_flags.
1 parent 1b475f7e
...@@ -179,6 +179,9 @@ mu_dbm_create_from_url (mu_url_t url, mu_dbm_file_t *db, int defsafety) ...@@ -179,6 +179,9 @@ mu_dbm_create_from_url (mu_url_t url, mu_dbm_file_t *db, int defsafety)
179 179
180 if (*name == '-') 180 if (*name == '-')
181 { 181 {
182 if (!safety_flags_set)
183 /* Imply default safety settings */
184 safety_flags = defsafety;
182 negate = 1; 185 negate = 1;
183 name++; 186 name++;
184 } 187 }
...@@ -224,7 +227,7 @@ mu_dbm_create_from_url (mu_url_t url, mu_dbm_file_t *db, int defsafety) ...@@ -224,7 +227,7 @@ mu_dbm_create_from_url (mu_url_t url, mu_dbm_file_t *db, int defsafety)
224 } 227 }
225 else if (strcmp (name, "default") == 0) 228 else if (strcmp (name, "default") == 0)
226 { 229 {
227 val = DEFAULT_DBM_SAFETY_FLAGS; 230 val = defsafety;
228 } 231 }
229 else if (mu_file_safety_name_to_code (name, &val)) 232 else if (mu_file_safety_name_to_code (name, &val))
230 return MU_ERR_URL_INVALID_PARAMETER; 233 return MU_ERR_URL_INVALID_PARAMETER;
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
28 } \ 28 } \
29 while (0) 29 while (0)
30 30
31 #define DEFAULT_DBM_SAFETY_FLAGS MU_FILE_SAFETY_ALL
32
33 #ifdef WITH_GDBM 31 #ifdef WITH_GDBM
34 extern struct mu_dbm_impl _mu_dbm_gdbm; 32 extern struct mu_dbm_impl _mu_dbm_gdbm;
35 #endif 33 #endif
......
...@@ -133,8 +133,6 @@ read_bulletin_db (size_t *pnum) ...@@ -133,8 +133,6 @@ read_bulletin_db (size_t *pnum)
133 return rc; 133 return rc;
134 } 134 }
135 135
136 mu_dbm_safety_set_flags (db, DEFAULT_GROUP_DB_SAFETY);
137
138 rc = mu_dbm_safety_check (db); 136 rc = mu_dbm_safety_check (db);
139 if (rc) 137 if (rc)
140 { 138 {
......