Created attachment 13058 [details] Patch for URL Escaping Path Qualifier I originally submitted this patch to the samba-technical mailing list but received no response so I am submitting it along with this bug report. Previous discussion can be found at: https://lists.samba.org/archive/samba-technical/2016-August/115712.html Basically, when running a search from within a nested directory and that directory’s path contains spaces, the generated sparql query will always return and empty result set. The problem is that the patch needs to be escaped and it is not. For example, when searching for a file that starts with "Deposit" in given the path "/srv/smb/Groups/My Folder/Deposits/2011/" the query currently generated is: 19 Aug 2016, 02:24:15: Tracker: ---- [21|smbd|7822] query: SELECT ?url WHERE { ?obj fts:match 'Deposit*' . ?obj nie:url ?url . FILTER(tracker:uri-is-descendant('file:///srv/smb/Groups/My Folder/Deposits/2011/', ?url)) } 19 Aug 2016, 02:24:15: Tracker: ---> [21|smbd|7822] Success, no error given ...this query will always return an empty result even if there are files located within the search directory that start with the word "Deposit". The correct query should look like: SELECT ?url WHERE { ?obj fts:match 'Deposit*' . ?obj nie:url ?url . FILTER(tracker:uri-is-descendant('file:///srv/smb/Groups/My%20Folder/Deposits/2011/', ?url)) } The attached patch modifies “map_spotlight_to_sparql_query” in “samba/source3/rpc_server/mdssvc/sparql_parser.c” to url encode the directory path when generating the “FILTER” statement.
Sorry for dropping the ball on this one! I'll pick this up asap.
Created attachment 13063 [details] Patch for master Here's a slightly modified version based on your patch. Can you test it and report back please?
Thanks! Will do.
*ping*
Very Sorry. I thought I responded a long time ago to this. I went to check the status of this ticket today and realized that I never did. I can confirm that your updated patch fixes this issue. I have ran it against both 4.6.x and 4.7.x without any issues for over six months now.
Looks this your patch was applied at some point... at least as of the 4.9.1 release its there. All still seems well. This issue is resolved.