+ if (al_data->old_md5) {
+ log_size = strlen(al_data->old_md5) + 16 + 4;
+ if (body_size > log_size) {
+ strncat(logs, "Old md5sum was: ", 16);
+ strncat(logs, al_data->old_md5, body_size);
+ strncat(logs, "\r\n", 4);
+ body_size -= log_size;
+ }
+ }
+ if (al_data->new_md5) {
+ log_size = strlen(al_data->new_md5) + 16 + 4;
+ if (body_size > log_size) {
+ strncat(logs, "New md5sum is : ", 16);
+ strncat(logs, al_data->new_md5, body_size);
+ strncat(logs, "\r\n", 4);
+ body_size -= log_size;
+ }
+ }
+ if (al_data->old_sha1) {
+ log_size = strlen(al_data->old_sha1) + 17 + 4;
+ if (body_size > log_size) {
+ strncat(logs, "Old sha1sum was: ", 17);
+ strncat(logs, al_data->old_sha1, body_size);
+ strncat(logs, "\r\n", 4);
+ body_size -= log_size;
+ }
+ }
+ if (al_data->new_sha1) {
+ log_size = strlen(al_data->new_sha1) + 17 + 4;
+ if (body_size > log_size) {
+ strncat(logs, "New sha1sum is : ", 17);
+ strncat(logs, al_data->new_sha1, body_size);
+ strncat(logs, "\r\n", 4);
+ body_size -= log_size;
+ }
+ }
+ if (al_data->perm_chg) {
+ log_size = strlen(al_data->perm_chg) + 17 + 4;
+ if (body_size > log_size) {
+ strncat(logs, "Permission change: ", 20);
+ strncat(logs, al_data->perm_chg, body_size);
+ strncat(logs, "\r\n", 4);
+ body_size -= log_size;
+ }
+ }
+
+
+ /* EXTRA DATA */
+ if (al_data->srcip) {
+ log_size = snprintf(log_string, sizeof(log_string) - 1, "Src IP: %s\r\n", al_data->srcip );
+ if (body_size > log_size) {
+ if ( strncat(extra_data, log_string, log_size) != NULL ) {
+ body_size -= log_size;
+ }
+ }
+ }
+ if (al_data->dstip) {
+ log_size = snprintf(log_string, sizeof(log_string) - 1, "Dst IP: %s\r\n", al_data->dstip );
+ if (body_size > log_size) {
+ if ( strncat(extra_data, log_string, log_size) != NULL ) {
+ body_size -= log_size;
+ }
+ }
+ }
+ if (al_data->user) {
+ log_size = snprintf(log_string, sizeof(log_string) - 1, "User: %s\r\n", al_data->user );
+ if (body_size > log_size) {
+ if ( strncat(extra_data, log_string, log_size) != NULL ) {
+ body_size -= log_size;
+ }
+ }
+ }