]> arthur.barton.de Git - netatalk.git/commitdiff
fce: afpd: fix event names array
authorRalph Boehme <rb@sernet.de>
Mon, 21 Jul 2014 15:31:00 +0000 (17:31 +0200)
committerRalph Boehme <rb@sernet.de>
Mon, 21 Jul 2014 15:31:00 +0000 (17:31 +0200)
Signed-off-by: Ralph Boehme <rb@sernet.de>
etc/afpd/fce_api.c
include/atalk/fce_api.h

index c2afc82f0dc2f5512b3b8d8604370e6630a4648c..158ad608c1e370b9192af9b9e6fdc7fbae254947 100644 (file)
@@ -80,7 +80,11 @@ static unsigned char iobuf[MAXIOBUF];
 static const char **skip_files;
 static struct fce_close_event last_close_event;
 
-static char *fce_event_names[] = {
+/*
+ * This only initializes consecutive events beginning at 1, high
+ * numbered events must be initialized in the code
+ */
+static char *fce_event_names[FCE_LAST_EVENT + 1] = {
     "",
     "FCE_FILE_MODIFY",
     "FCE_FILE_DELETE",
@@ -295,6 +299,9 @@ static void send_fce_event(const AFPObj *obj, int event, const char *path, const
     if (first_event == true) {
         first_event = false;
 
+        fce_event_names[FCE_CONN_START] = "FCE_CONN_START";
+        fce_event_names[FCE_CONN_BROKEN] = "FCE_CONN_BROKEN";
+
         struct passwd *pwd = getpwuid(obj->uid);
         user = strdup(pwd->pw_name);
 
index 4608a95c5b9a5396ffbfffc93f2e2cb174582f72..c804d900bc08b46641c18b357668ae5871405975 100755 (executable)
@@ -28,7 +28,7 @@
 #define FCE_CONN_BROKEN    99
 
 #define FCE_FIRST_EVENT     FCE_FILE_MODIFY /* keep in sync with last file event above */
-#define FCE_LAST_EVENT      FCE_DIR_CREATE  /* keep in sync with last file event above */
+#define FCE_LAST_EVENT      FCE_LOGOUT      /* keep in sync with last file event above */
 
 /* fce_packet.fce_magic */
 #define FCE_PACKET_MAGIC  "at_fcapi"