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 c2afc82..158ad60 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 4608a95..c804d90 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"