Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 337636 - dev-db/couchdb-1.0.1-r1 needs write permissions to /etc/couchdb for admin-user management
Summary: dev-db/couchdb-1.0.1-r1 needs write permissions to /etc/couchdb for admin-use...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Dirkjan Ochtman (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-16 12:30 UTC by Dennis Schridde
Modified: 2010-10-27 08:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-db/couchdb-1.0.1-r2.ebuild (couchdb-1.0.1-r2.ebuild,1.57 KB, text/plain)
2010-10-19 13:35 UTC, Sam Jacobson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2010-09-16 12:30:56 UTC
Creating an admin user via http://localhost:5984/_utils/ is impossible if the user "couchdb" has no write access to /etc/couchdb.
When trying to create such a user, the webinterface will hang, constantly reloading the page, instead of creating the admin user.

Reproducible: Always
Comment 1 Dirkjan Ochtman (RETIRED) gentoo-dev 2010-09-27 10:53:52 UTC
Does it really need write access to /etc/couchdb, or just to the ini files contained in that directory? If the latter, the current ebuild already sets it up like that (with rw-rw-r-- for /etc/couchdb/*.ini).
Comment 2 Dennis Schridde 2010-09-27 13:28:54 UTC
I installed dev-db/couchdb-1.0.1-r1 on Sep 16th, and the testsuite as well as the create-admin-user-thing did not work.
Comment 3 Sam Jacobson 2010-10-19 13:01:10 UTC
I encountered the same problem, and found my solution at the following URL before finding this bug:

http://wiki.apache.org/couchdb/Installing_on_Ubuntu

The following commands fix it:
# chown -R root:couchdb /etc/couchdb
# chmod 664 /etc/couchdb/*.ini
# chmod 775 /etc/couchdb/*.d
Comment 4 Sam Jacobson 2010-10-19 13:35:53 UTC
Created attachment 251255 [details]
dev-db/couchdb-1.0.1-r2.ebuild

I've found the bug in the ebuild (see following patch). I think the problem is that the wildcard expansion on fowners and fperms doesn't work because those files aren't really in /etc/couchdb at that point in src_install (they're in ${D}), and it's usually the shell that handles wildcard expansion. This works (and fixes the reported bug), but I don't know if it's the best way.

-	fowners root:couchdb /etc/couchdb/*.ini
-	fperms 660 /etc/couchdb/*.ini
+	fowners root:couchdb /etc/couchdb/local.ini
+	fowners root:couchdb /etc/couchdb/default.ini
+	fperms 660 /etc/couchdb/local.ini
+	fperms 660 /etc/couchdb/default.ini
Comment 5 Dirkjan Ochtman (RETIRED) gentoo-dev 2010-10-19 13:40:37 UTC
Thanks for finding that! I think there's probably a better solution, let me ask around.
Comment 6 Dennis Schridde 2010-10-19 13:54:27 UTC
(In reply to comment #4)
> -       fowners root:couchdb /etc/couchdb/*.ini
> -       fperms 660 /etc/couchdb/*.ini
> +       fowners root:couchdb /etc/couchdb/local.ini
> +       fowners root:couchdb /etc/couchdb/default.ini
> +       fperms 660 /etc/couchdb/local.ini
> +       fperms 660 /etc/couchdb/default.ini
Maybe like this?
for file in "${D}"/etc/couchdb/*.ini ; do
  fowners root:couchdb ${file#${D}}
  fperms 660 ${file#${D}}
done
Comment 7 Dirkjan Ochtman (RETIRED) gentoo-dev 2010-10-27 08:59:14 UTC
This should be fixed in the r2 that's in the tree now, please check.