~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Disobedience checks server version and expects rights-changed
[disorder]
/
lib
/
trackdb.c
diff --git
a/lib/trackdb.c
b/lib/trackdb.c
index
7cc3719
..
0b10d72
100644
(file)
--- a/
lib/trackdb.c
+++ b/
lib/trackdb.c
@@
-23,15
+23,11
@@
* This file is getting in desparate need of splitting up...
*/
* This file is getting in desparate need of splitting up...
*/
-#include <config.h>
-#include "types.h"
+#include "common.h"
-#include <string.h>
-#include <stdio.h>
#include <db.h>
#include <sys/socket.h>
#include <pcre.h>
#include <db.h>
#include <sys/socket.h>
#include <pcre.h>
-#include <assert.h>
#include <unistd.h>
#include <errno.h>
#include <stddef.h>
#include <unistd.h>
#include <errno.h>
#include <stddef.h>
@@
-39,7
+35,6
@@
#include <sys/resource.h>
#include <time.h>
#include <arpa/inet.h>
#include <sys/resource.h>
#include <time.h>
#include <arpa/inet.h>
-#include <sys/wait.h>
#include <dirent.h>
#include <sys/stat.h>
#include <gcrypt.h>
#include <dirent.h>
#include <sys/stat.h>
#include <gcrypt.h>
@@
-2209,7
+2204,7
@@
static int reap_rescan(ev_source attribute((unused)) *ev,
eventlog("rescanned", (char *)0);
/* Call rescanned callbacks */
while(rescanned_list) {
eventlog("rescanned", (char *)0);
/* Call rescanned callbacks */
while(rescanned_list) {
- void (*rescanned)(void *u) = rescanned_list->rescanned;
+ void (*rescanned)(void *u
_
) = rescanned_list->rescanned;
void *ru = rescanned_list->ru;
rescanned_list = rescanned_list->next;
void *ru = rescanned_list->ru;
rescanned_list = rescanned_list->next;
@@
-2388,6
+2383,9
@@
char **trackdb_new(int *ntracksp,
* @return null-terminated array of track names, or NULL on deadlock
*
* The most recently added track is first in the array.
* @return null-terminated array of track names, or NULL on deadlock
*
* The most recently added track is first in the array.
+ *
+ * TODO: exclude tracks that have been deleted again.
+ *
*/
static char **trackdb_new_tid(int *ntracksp,
int maxtracks,
*/
static char **trackdb_new_tid(int *ntracksp,
int maxtracks,
@@
-2683,6
+2681,7
@@
int trackdb_adduser(const char *user,
user, rights, email);
else
info("created user '%s' with rights '%s'", user, rights);
user, rights, email);
else
info("created user '%s' with rights '%s'", user, rights);
+ eventlog("user-add", user, (char *)0);
return 0;
}
}
return 0;
}
}
@@
-2700,6
+2699,7
@@
int trackdb_deluser(const char *user) {
return -1;
}
info("deleted user '%s'", user);
return -1;
}
info("deleted user '%s'", user);
+ eventlog("user-delete", user, (char *)0);
return 0;
}
return 0;
}
@@
-2779,8
+2779,10
@@
int trackdb_edituserinfo(const char *user,
if(e) {
error(0, "unknown user '%s'", user);
return -1;
if(e) {
error(0, "unknown user '%s'", user);
return -1;
- } else
+ } else {
+ eventlog("user-edit", user, key, (char *)0);
return 0;
return 0;
+ }
}
/** @brief List all users
}
/** @brief List all users
@@
-2846,6
+2848,7
@@
int trackdb_confirm(const char *user, const char *confirmation,
switch(e) {
case 0:
info("registration confirmed for user '%s'", user);
switch(e) {
case 0:
info("registration confirmed for user '%s'", user);
+ eventlog("user-confirm", user, (char *)0);
return 0;
case DB_NOTFOUND:
error(0, "confirmation for nonexistent user '%s'", user);
return 0;
case DB_NOTFOUND:
error(0, "confirmation for nonexistent user '%s'", user);