286 |
286 |
{
|
287 |
287 |
string ext;
|
288 |
288 |
const char * dot_ptr = strrchr(d.leafname(), '.');
|
|
289 |
#ifdef HAVE_LIBACL
|
|
290 |
map<string, int> acl_users;
|
|
291 |
map<string, int> acl_groups;
|
|
292 |
map<string, int>::iterator acl;
|
|
293 |
#endif
|
|
294 |
|
289 |
295 |
if (dot_ptr)
|
290 |
296 |
ext.assign(dot_ptr + 1);
|
291 |
297 |
|
... | ... | |
902 |
908 |
newdocument.add_value(VALUE_SIZE,
|
903 |
909 |
Xapian::sortable_serialise(d.get_size()));
|
904 |
910 |
|
905 |
|
bool inc_tag_added = false;
|
906 |
|
if (d.is_other_readable()) {
|
907 |
|
inc_tag_added = true;
|
|
911 |
if (d.is_other_readable())
|
908 |
912 |
newdocument.add_boolean_term("I*");
|
909 |
|
} else if (d.is_group_readable()) {
|
910 |
|
const char * group = d.get_group();
|
911 |
|
if (group) {
|
912 |
|
newdocument.add_boolean_term(string("I#") + group);
|
913 |
|
inc_tag_added = true;
|
914 |
|
}
|
|
913 |
|
|
914 |
const char * group = d.get_group();
|
|
915 |
if (group) {
|
|
916 |
newdocument.add_boolean_term(string("G") + group);
|
|
917 |
if (d.is_group_readable())
|
|
918 |
newdocument.add_boolean_term(string("I#") + group);
|
915 |
919 |
}
|
|
920 |
|
916 |
921 |
const char * owner = d.get_owner();
|
917 |
922 |
if (owner) {
|
918 |
923 |
newdocument.add_boolean_term(string("O") + owner);
|
919 |
|
if (!inc_tag_added && d.is_owner_readable())
|
920 |
|
newdocument.add_boolean_term(string("I@") + owner);
|
|
924 |
if (d.is_owner_readable())
|
|
925 |
newdocument.add_boolean_term(string("I@") + owner);
|
921 |
926 |
}
|
922 |
|
|
|
927 |
#ifdef HAVE_LIBACL
|
|
928 |
d.get_acls(&acl_users, &acl_groups); //, &acl_groups);
|
|
929 |
for (acl = acl_users.begin(); acl != acl_users.end(); ++acl) {
|
|
930 |
newdocument.add_boolean_term(string("O") + acl->first);
|
|
931 |
if (acl->second == 1)
|
|
932 |
newdocument.add_boolean_term(string("I@") + acl->first);
|
|
933 |
}
|
|
934 |
for (acl = acl_groups.begin(); acl != acl_groups.end(); ++acl) {
|
|
935 |
newdocument.add_boolean_term(string("G") + acl->first);
|
|
936 |
if (acl->second == 1)
|
|
937 |
newdocument.add_boolean_term(string("I#") + acl->first);
|
|
938 |
}
|
|
939 |
#endif
|
923 |
940 |
string ext_term("E");
|
924 |
941 |
for (string::iterator i = ext.begin(); i != ext.end(); ++i) {
|
925 |
942 |
char ch = *i;
|