-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: Spotlight: searching in user homes, bug #543 #7
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -607,6 +607,7 @@ static struct vol *creatvol(AFPObj *obj, | |
char *p, *q; | ||
bstring dbpath = NULL; | ||
bstring global_path_tmp = NULL; | ||
bstring cmd = NULL; | ||
|
||
strlcpy(path, path_in, MAXPATHLEN); | ||
|
||
|
@@ -1028,6 +1029,21 @@ static struct vol *creatvol(AFPObj *obj, | |
volume->v_localname, volume->v_uuid); | ||
} | ||
|
||
#ifdef HAVE_TRACKER | ||
if (STRCMP(section, ==, INISEC_HOMES) && IS_AFP_SESSION(obj)) { | ||
if (volume->v_flags & AFPVOL_SPOTLIGHT) { | ||
setenv("DBUS_SESSION_BUS_ADDRESS", "unix:path=" _PATH_STATEDIR "spotlight.ipc", 1); | ||
setenv("XDG_DATA_HOME", _PATH_STATEDIR, 0); | ||
setenv("XDG_CACHE_HOME", _PATH_STATEDIR, 0); | ||
setenv("TRACKER_USE_LOG_FILES", "1", 0); | ||
system(TRACKER_PREFIX "/bin/tracker-control -s"); | ||
cmd = bformat("tracker-control -f \"%s\"", path); | ||
LOG(log_debug, logtype_sl, "creatvol: sl (re)indexing home: %s", bdata(cmd)); | ||
system(bdata(cmd)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And another one: will system() return after tracker-control -f scheduled the reindexing or will it wait until the reindexing completed ? If tracker-control -f doesn't exit until the reindexing is complete so would system(), so you may test this by calling tracker-control -f on some big directory tree. If it turns out that tracker-control -f waits till the indexing completes, the afpd process waiting for the system() command will be stuck there and the AFP session might run into timeouts. |
||
} | ||
} | ||
#endif | ||
|
||
/* no errors shall happen beyond this point because the cleanup would mess the volume chain up */ | ||
volume->v_next = Volumes; | ||
Volumes = volume; | ||
|
@@ -1039,6 +1055,8 @@ static struct vol *creatvol(AFPObj *obj, | |
bdestroy(dbpath); | ||
if (global_path_tmp) | ||
bdestroy(global_path_tmp); | ||
if (cmd) | ||
bdestroy(cmd); | ||
if (ret != 0) { | ||
if (volume) | ||
volume_free(volume); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid calling tracker-control -s for every home mount? This should probably be moved to etc/netatalk/netatalk.c or something similar that ensures we only call out to tracker-control once in order to start it up.