diff --git a/management/univention-directory-notifier/src/notify.c b/management/univention-directory-notifier/src/notify.c index f7eb26562b..2967ef4d32 100644 --- a/management/univention-directory-notifier/src/notify.c +++ b/management/univention-directory-notifier/src/notify.c @@ -423,7 +423,10 @@ char* notify_transcation_get_one_dn ( unsigned long last_known_id ) memset(buffer, 0, sizeof(buffer)); if ((pos = index_get(index, last_known_id)) >= 0) { - fseek(notify.tf, pos, SEEK_SET); + if (fseek(notify.tf, pos, SEEK_SET) != 0) { + univention_debug(UV_DEBUG_TRANSFILE, UV_DEBUG_WARN, "invalid transaction index"); + index_invalidate(notify.tf); + } if (fgets(buffer, sizeof(buffer), notify.tf) != NULL) { univention_debug(UV_DEBUG_TRANSFILE, UV_DEBUG_ALL, "BUFFER=%s", buffer); if ( buffer[strlen(buffer)-1] == '\n' ) { @@ -433,6 +436,9 @@ char* notify_transcation_get_one_dn ( unsigned long last_known_id ) if (id == last_known_id) { found = true; univention_debug(UV_DEBUG_TRANSFILE, UV_DEBUG_INFO, "Found (get_one_dn, index) %ld",id); + } else { + univention_debug(UV_DEBUG_TRANSFILE, UV_DEBUG_WARN, "invalid transaction index"); + index_invalidate(notify.tf); } } }