Fix segfault when moving folder outside the sync directory when using --monitor (#957)

Fix segfault when moving folder outside the sync directory when using --monitor on Arch Linux
This commit is contained in:
Christian Ponte-Fernández 2020-06-16 22:28:55 +02:00 committed by GitHub
parent 6fcc5f8196
commit 9e020f05cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,8 +231,6 @@ final class Monitor
while (i < length) {
inotify_event *event = cast(inotify_event*) &buffer[i];
string path;
path = getPath(event);
// inotify event debug
log.vdebug("inotify event wd: ", event.wd);
log.vdebug("inotify event mask: ", event.mask);
@ -272,6 +270,9 @@ final class Monitor
throw new MonitorException("Inotify overflow, events missing");
}
// if the event is not to be ignored, obtain path
path = getPath(event);
// skip events that should be excluded based on application configuration
if (selectiveSync.isDirNameExcluded(path.strip('.').strip('/'))) {
goto skip;