* FIX: afpd: Solaris locking problem, bug #559
* FIX: Handling of malformed UTF8 strings, bug #524
* FIX: afpd: umask handling, bug #576
+* FIX: Spotlight: Limiting searches to subfolders, bug #581
Changes in 3.1.6
================
gchar *sparql_query;
GError *error = NULL;
bool ok;
+ sl_array_t *scope_array;
array = talloc_zero(reply, sl_array_t);
}
slq->slq_reqinfo = talloc_steal(slq, reqinfo);
+ scope_array = dalloc_value_for_key(query, "DALLOC_CTX", 0, "DALLOC_CTX", 1,
+ "kMDScopeArray");
+ if (scope_array == NULL) {
+ slq->slq_scope = talloc_strdup(slq, v->v_path);
+ } else {
+ slq->slq_scope = talloc_strdup(slq, scope_array->dd_talloc_array[0]);
+ }
+ if (slq->slq_scope == NULL) {
+ LOG(log_error, logtype_sl, "failed to setup search scope");
+ EC_FAIL;
+ }
+
+ LOG(log_debug, logtype_sl, "Search scope: \"%s\"", slq->slq_scope);
+
cnids = dalloc_value_for_key(query, "DALLOC_CTX", 0, "DALLOC_CTX", 1,
"kMDQueryItemArray");
if (cnids) {
ssp_result = talloc_asprintf(ssp_slq,
"SELECT ?url WHERE "
"{ %s . ?obj nie:url ?url . FILTER(tracker:uri-is-descendant('file://%s/', ?url)) } %s",
- (yyvsp[(1) - (1)].sval), ssp_slq->slq_vol->v_path, result_limit);
+ (yyvsp[(1) - (1)].sval), ssp_slq->slq_scope, result_limit);
(yyval.sval) = ssp_result;
}
break;
}
ssp_slq = talloc_zero(NULL, slq_t);
- struct vol *vol = talloc_zero(ssp_slq, struct vol);
- vol->v_path = "/Volumes/test";
- ssp_slq->slq_vol = vol;
+ ssp_slq->slq_scope = talloc_strdup(ssp_slq, "/Volumes/test");
ssp_slq->slq_allow_expr = true;
sparqlvar = 'a';
ssp_result = talloc_asprintf(ssp_slq,
"SELECT ?url WHERE "
"{ %s . ?obj nie:url ?url . FILTER(tracker:uri-is-descendant('file://%s/', ?url)) } %s",
- $1, ssp_slq->slq_vol->v_path, result_limit);
+ $1, ssp_slq->slq_scope, result_limit);
$$ = ssp_result;
}
;
}
ssp_slq = talloc_zero(NULL, slq_t);
- struct vol *vol = talloc_zero(ssp_slq, struct vol);
- vol->v_path = "/Volumes/test";
- ssp_slq->slq_vol = vol;
+ ssp_slq->slq_scope = talloc_strdup(ssp_slq, "/Volumes/test");
ssp_slq->slq_allow_expr = true;
sparqlvar = 'a';
slq_state_t slq_state; /* State */
AFPObj *slq_obj; /* global AFPObj handle */
const struct vol *slq_vol; /* volume handle */
+ char *slq_scope; /* search scope */
time_t slq_time; /* timestamp received query */
uint64_t slq_ctx1; /* client context 1 */
uint64_t slq_ctx2; /* client context 2 */