jiangphcn commented on a change in pull request #1370: [5/5] Clustered Purge
Implementation
URL: https://github.com/apache/couchdb/pull/1370#discussion_r195010728
##########
File path: src/couch_mrview/src/couch_mrview_cleanup.erl
##########
@@ -41,7 +41,23 @@ run(Db) ->
lists:foreach(fun(FN) ->
couch_log:debug("Deleting stale view file: ~s", [FN]),
- couch_file:delete(RootDir, FN, [sync])
+ couch_file:delete(RootDir, FN, [sync]),
+ Sig = couch_mrview_util:get_signature_from_filename(FN),
+ if length(Sig) < 16 -> ok; true ->
+ case re:run(Sig,"^[a-fA-F0-9]+$",[{capture, none}]) of
Review comment:
Just double check the signature extracted from view file path is valid, i.e.
`^[a-fA-F0-9]+$`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services