]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/fce_api.c
fce: afpd: fix event names array
[netatalk.git] / etc / afpd / fce_api.c
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);