From 04ba0da5353433c05d43447a76a7669bae3a09da Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Mon, 21 Jul 2014 17:31:00 +0200 Subject: [PATCH] fce: afpd: fix event names array Signed-off-by: Ralph Boehme --- etc/afpd/fce_api.c | 9 ++++++++- include/atalk/fce_api.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/etc/afpd/fce_api.c b/etc/afpd/fce_api.c index c2afc82f..158ad608 100644 --- a/etc/afpd/fce_api.c +++ b/etc/afpd/fce_api.c @@ -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); diff --git a/include/atalk/fce_api.h b/include/atalk/fce_api.h index 4608a95c..c804d900 100755 --- a/include/atalk/fce_api.h +++ b/include/atalk/fce_api.h @@ -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" -- 2.39.2