You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/07/25 22:57:20 UTC

[jira] [Commented] (COUCHDB-3080) couch_db:validate_dbname fails validation for couch file

    [ https://issues.apache.org/jira/browse/COUCHDB-3080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15392808#comment-15392808 ] 

ASF GitHub Bot commented on COUCHDB-3080:
-----------------------------------------

GitHub user iilyak opened a pull request:

    https://github.com/apache/couchdb-couch/pull/188

    3080 fix validate dbname

    Fix the case when DbName contains path to db file
    In the case when DbName contains the file name we need to remove .couch
    extension in order to match ?DBNAME_REGEX.
    
    [COUCHDB-3080](https://issues.apache.org/jira/browse/COUCHDB-3080)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cloudant/couchdb-couch 3080-fix-validate_dbname

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch/pull/188.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #188
    
----
commit b622ef36abdd8b9d2f18371d749cab6139568a97
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2016-07-25T22:22:04Z

    Factor out maybe_remove_extension/1 function
    
    COUCHDB-3080

commit 3f57691a180ef3c6dfa8fa2ce7a91eb638680eaf
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2016-07-25T22:23:30Z

    Fix the case when DbName contains path to db file
    
    In the case when DbName contains the file name we need to remove .couch
    extension in order to match ?DBNAME_REGEX.
    
    COUCHDB-3080

----


> couch_db:validate_dbname fails validation for couch file
> --------------------------------------------------------
>
>                 Key: COUCHDB-3080
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-3080
>             Project: CouchDB
>          Issue Type: Bug
>            Reporter: ILYA
>
> couch_db:validate_dbname is designed to work for any of the following inputs:
>       1. expects either type binary or list
>       2. expect any kind of database name
>          - plain database name
>          - plain database name with '.couch' extension
>          - shard name with suffix (creation time)
>          - shard name with suffix (creation time) and .couch extension
> However apparently it doesn't work correctly for a case when file name is given as input (i.e. when it has .couch extension).
> Steps to reproduce:
> {code}
> > couch_db:validate_dbname(<<"something.1415960794">>).
> ok
> > couch_db:validate_dbname(<<"something.1415960794.couch">>).
> {error,{illegal_database_name,<<"something.1415960794.couch">>}}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)