﻿ticket,summary,type,release,owner,status,created,modified,_description,_reporter
12644,"Incompatibilty with new directorystructure and sha1-naming-convention for attachments (trac v1.0),",defect,1.0,,new,2016-01-26T11:40:09+01:00,2016-01-27T16:26:20+01:00,"After some modifications to the 1.0 version of {{{searchattachments.py}}} the plugin was able to perform a search in wiki- and ticket-attachments in my environment (Windows, trac 1.0).

However, the resultset of the search returns links like:
{{{
Attachment::wiki/f09/f0955265d583361233790e2a4da795373c345a9f/f82e178298c44740723b7ee0c867cadcd29ff8a2.pdf
}}}

Indeed, as per t:#10313, the path is now rather based on message-digests of meaningfull words, than on readable words.

More-over, when clicking on such a link, an error-message appears saying there's no way to link to the attachment:
{{{
No handler matched request to 
/attachments/wiki/f09/f0955265d583361233790e2a4da795373c345a9f/f82e178298c44740723b7ee0c867cadcd29ff8a2.pdf
}}}

An approach would be to store the hash-based path in the database, this would allow a ""reverse lookup"" of the correct URL. ",brunodenys@…
10219,[patch] bring searchattachments plugin to a working state,defect,0.11,,new,2012-08-02T16:03:00+02:00,2015-08-28T02:14:53+02:00,"SearchAttachmentsPlugin didn't quite work for me in several aspects so I applied some fixes to it. This has been a while and I always forgot to upload the corresponding patch, so here it is now.

Changes that I made (excerpt from my mercurial local repo changelog):

{{{
$ hg log -v|egrep -v ""user""
changeset:   8:e7c0cbbd158f                                            
tag:         tip                                                       
date:        Thu Feb 18 17:02:32 2010 +0100                            
files:       0.11/searchattachments/searchattachments.py               
description:                                                           
more helpful log message if no index files found (means no attachments)


changeset:   7:cc617212dd70
date:        Thu Feb 18 16:30:19 2010 +0100
files:       0.11/searchattachments/searchattachments.py
description:                                            
fixed unicode issue                                     


changeset:   6:d0afeb0b8a4b
date:        Thu Feb 11 11:25:20 2010 +0100
files:       0.11/searchattachments/searchattachments.py
description:                                            
fixed options                                           


changeset:   5:bb5fdc6dc688
date:        Wed Feb 10 15:16:59 2010 +0100
files:       0.11/searchattachments/searchattachments.py
description:                                            
Many changes, including reformatting and saner excerpt extraction, with
options to switch off excerpts and for limiting excerpt search and excerpt
result length.                                                            


changeset:   4:49a9ec1eb7a9
date:        Tue Feb 09 15:05:44 2010 +0100
files:       0.11/searchattachments/searchattachments.py
description:
reformat for better style-guide conformity


changeset:   3:7ad1c267ebf4
date:        Wed Dec 30 15:32:39 2009 +0100
files:       0.11/searchattachments/searchattachments.py 0.11/trac-seat
description:
Fixed indentation using reindent.py, use spaces now instead of tabs.
trac-seat now indexes txt files, too. Force foreground job for attachment
deletions to not get inconsistent indexing in case of 'replace attachm.
with the same name' operations. Excerpt handling now works for files that
do not contain any newlines before a search keyword.


changeset:   2:bd327f343d0c
date:        Mon Dec 28 14:39:05 2009 +0100
files:       0.11/trac-seat
description:
removed obsolete commented-out stuff


changeset:   1:4540952d9e13
date:        Wed Dec 23 17:07:23 2009 +0100
files:       0.11/searchattachments/searchattachments.py 0.11/setup.py 0.11/trac-seat
description:
1st working version. Changes:
 * trac-seat added as script to setup.py
 * trac-seat fixed: Option parsing now working, use trac Configuration class
   for ini file access (otherwise, inherit mechanisms will not work), some
   fixes regarding reading the relevant config sections
 * change config section name to use 'searchattachments' consistently
 * fixed seat and swish options
 * use absolute urls in results to support multi-project (tracforge) setups;
   absolute urls are constructed from the request href


changeset:   0:2b345fa0a9a3
date:        Wed Dec 23 14:19:46 2009 +0100
files:       0.10/README 0.10/searchattachments/__init__.py 
0.10/searchattachments/searchattachments.py 
0.10/setup.py 
0.10/trac-seat 
0.11/README 0.11/searchattachments/__init__.py 
0.11/searchattachments/searchattachments.py 
0.11/setup.py 0.11/trac-seat
description:
initial checkin

}}}

I've been running this ever since in a production trac environment and it works quite nicely.

",jholg
2711,[Patch] Search fails with accented words,defect,0.10,deltroo,new,2008-03-10T13:08:13+01:00,2010-02-07T04:37:01+01:00,"I use trac with spanish documentation. When searching for accented word, the search fails (ascii encoding problems with commands module).

In lines 87 and 258 I replaced with encode string function. And now it doesn't fail.

{{{

 error , output = commands.getstatusoutput ( cmd.encode('utf-8') )

}}}

Best regards,
",Carlos López Pérez
12645,Command injection,defect,,,new,2016-01-26T12:35:18+01:00,2016-01-26T14:48:44+01:00,"At source:searchattachmentsplugin/1.0/searchattachments/searchattachments.py@14892:85-87#L68.

That plugin must use `subprocess.Popen` with `shell=False` instead of `commands.getstatusoutput`.",Jun Omae
12684,error: unexpected end of regular expression,defect,,,new,2016-02-26T18:54:19+01:00,2016-04-20T00:07:10+02:00,"==== How to Reproduce ====

While doing a GET operation on `/search`, Trac issued an internal error.

''(please provide additional details here)''

Request parameters:
{{{
{'attachments': u'on',
 'changeset': u'on',
 'milestone': u'on',
 'noquickjump': u'1',
 'q': u'[[movie',
 'ticket': u'on',
 'wiki': u'on'}
}}}

User agent: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36`

==== System Information ====
|| '''`Trac`''' || `1.0.2` ||
|| '''`Babel`''' || `1.3` ||
|| '''`Genshi`''' || `0.7 (without speedups)` ||
|| '''`pysqlite`''' || `2.4.1` ||
|| '''`Python`''' || `2.6.6 (r266:84292, Dec  7 2011, 20:48:22) ` [[br]] `[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)]` ||
|| '''`pytz`''' || `2010h` ||
|| '''`setuptools`''' || `0.6` ||
|| '''`SQLite`''' || `3.6.20` ||
|| '''`Subversion`''' || `1.8.3 (r1516576)` ||
|| '''`jQuery`''' || `1.7.2` ||
|| '''`jQuery UI`''' || `1.8.21` ||
|| '''`jQuery Timepicker`''' || `1.0.1` ||

==== Enabled Plugins ====
|| '''`docrender`''' || `0.2` ||
|| '''`NavAdd`''' || `0.3` ||
|| '''`SecureSession`''' || `0.10dev` ||
|| '''`SimpleMultiProject`''' || `0.0.4dev` ||
|| '''`TracAccountManager`''' || `0.4.4` ||
|| '''`TracAutocompleteUsersPlugin`''' || `0.4.3dev` ||
|| '''`TracCsvPlugin`''' || `0.0.1` ||
|| '''`TracCustomFieldAdmin`''' || `0.2.10` ||
|| '''`TracDateField`''' || `3.0.0dev` ||
|| '''`TracMovieMacro`''' || `0.3` ||
|| '''`TracPermRedirect`''' || `3.0` ||
|| '''`TracSearchAttachmentsPlugin`''' || `1.0` ||
|| '''`TracWorkflowAdmin`''' || `0.12.0.2` ||
|| '''`TracWysiwyg`''' || `0.12.0.5` ||
|| '''`username`''' || `N/A` ||

==== Python Traceback ====
{{{
Traceback (most recent call last):
  File ""/usr/lib/python2.6/site-packages/Trac-1.0.2-py2.6.egg/trac/web/main.py"", line 512, in _dispatch_request
    dispatcher.dispatch(req)
  File ""/usr/lib/python2.6/site-packages/Trac-1.0.2-py2.6.egg/trac/web/main.py"", line 221, in dispatch
    resp = chosen_handler.process_request(req)
  File ""/usr/lib/python2.6/site-packages/Trac-1.0.2-py2.6.egg/trac/search/web_ui.py"", line 105, in process_request
    results = self._do_search(req, terms, filters)
  File ""/usr/lib/python2.6/site-packages/Trac-1.0.2-py2.6.egg/trac/search/web_ui.py"", line 213, in _do_search
    or [])
  File ""build/bdist.linux-x86_64/egg/searchattachments/searchattachments.py"", line 165, in get_search_results
    keywords)
  File ""build/bdist.linux-x86_64/egg/searchattachments/searchattachments.py"", line 183, in _make_excerpt
    m = re.compile(regexp, re.IGNORECASE).search(content)
  File ""/usr/lib64/python2.6/re.py"", line 190, in compile
    return _compile(pattern, flags)
  File ""/usr/lib64/python2.6/re.py"", line 245, in _compile
    raise error, v # invalid expression
error: unexpected end of regular expression
}}}",anonymous
