summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e9eb8f7)
trying it. They will still fail in all the cases they did before but
much more gracefuly.
The web interface is a bit more liberal in the cookie value syntax it
will accept.
The web interface is a bit more liberal in the cookie value syntax it
will accept.
+Clients fail more gracefully if no password is available.
+
* Changes up to version 3.0.1
Debian upgrades from 2.0.x should now work better.
* Changes up to version 3.0.1
Debian upgrades from 2.0.x should now work better.
return -1;
}
password = config->password;
return -1;
}
password = config->password;
- if(!password) {
- /* Maybe we can read the database */
- /* TODO failure to open the database should not be fatal */
+ /* Maybe we can read the database */
+ if(!password && trackdb_readable()) {
trackdb_init(TRACKDB_NO_RECOVER|TRACKDB_NO_UPGRADE);
trackdb_open(TRACKDB_READ_ONLY);
password = trackdb_get_password(username);
trackdb_init(TRACKDB_NO_RECOVER|TRACKDB_NO_UPGRADE);
trackdb_open(TRACKDB_READ_ONLY);
password = trackdb_get_password(username);
void trackdb_init(int attribute((unused)) flags) {
}
void trackdb_init(int attribute((unused)) flags) {
}
+int trackdb_readable(void) {
+ return 0;
+}
+
/*
Local Variables:
c-basic-offset:2
/*
Local Variables:
c-basic-offset:2
return compare_path_raw(a->data, a->size, b->data, b->size);
}
return compare_path_raw(a->data, a->size, b->data, b->size);
}
+/** @brief Test whether the track database can be read
+ * @return 1 if it can, 0 if it cannot
+ */
+int trackdb_readable(void) {
+ char *usersdb;
+
+ byte_xasprintf(&usersdb, "%s/users.db", config->home);
+ return access(usersdb, R_OK) == 0;
+}
+
/** @brief Open database environment
* @param flags Flags word
*
/** @brief Open database environment
* @param flags Flags word
*
char **trackdb_listusers(void);
int trackdb_confirm(const char *user, const char *confirmation,
rights_type *rightsp);
char **trackdb_listusers(void);
int trackdb_confirm(const char *user, const char *confirmation,
rights_type *rightsp);
+int trackdb_readable(void);