You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Jan Lehnardt (Assigned) (JIRA)" <ji...@apache.org> on 2012/02/22 18:35:48 UTC

[jira] [Assigned] (COUCHDB-603) init script needlessly 'su's, and non-superuser use fails

     [ https://issues.apache.org/jira/browse/COUCHDB-603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Lehnardt reassigned COUCHDB-603:
------------------------------------

    Assignee: Noah Slater
    
> init script needlessly 'su's, and non-superuser use fails
> ---------------------------------------------------------
>
>                 Key: COUCHDB-603
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-603
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: Infrastructure
>         Environment: Unix
>            Reporter: Chad MILLER
>            Assignee: Noah Slater
>            Priority: Trivial
>         Attachments: 0001-Adding-a-UID-check-before-su-ing-to-see-if-we-are-al.patch
>
>
> The init script runs 'su' if the COUCHDB_USER variable is set, but it doesn't need to if the script is already running as that user.  Add an additional condition on that test, so that normal role users can start and stop the server.
> --- couchdb/etc/init/couchdb.tpl.in	2009-10-02 07:10:18.475913699 -0400
> +++ couchdb/etc/init/couchdb.tpl.in	2009-10-02 07:22:22.711911041 -0400
> @@ -77,7 +77,7 @@
>          command="$command $COUCHDB_OPTIONS"
>      fi
>      mkdir -p "$RUN_DIR"
> -    if test -n "$COUCHDB_USER"; then
> +    if test -n "$COUCHDB_USER" -a "`id -u \"$COUCHDB_USER\" 2>&1`" != "`id -u`"; then
>          chown $COUCHDB_USER "$RUN_DIR"
>          if su $COUCHDB_USER -c "$command" > /dev/null; then
>              return $SCRIPT_OK
> (Reported as bug at https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/435484  )

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira