Opened 12 years ago

Closed 11 years ago

Last modified 3 years ago

#9970 closed defect (wontfix)

Only root may execute trac-admin commands — at Version 4

Reported by: Jan Z Owned by: Mikael Relbe
Priority: high Component: TracTicketChangesetsPlugin
Severity: major Keywords:
Cc: Trac Release: 0.12

Description (last modified by Ryan J Ollos)

Only root may execute trac-admin commands, which prevents me to allow "apache" user to execute trac-admin commands within pre-commit and pre-revprop-change subversion hooks scripts.

Even root encounters error when invoking command help (see example below). That may be caused by something in file "console.py" of trac installation, or, "admin.py" from ticketchangesetsplugin .

[root@my_server hooks]# trac-admin /home/trac/project7 ticket_changesets help
Error: Command not found

ticket_changesets diff

    Examine ticket commit messages before reformat

ticket_changesets get [ticketid]

    Get a comma-separated list of related revisions.

ticket_changesets reformat

    Reformat ticket commit messages (DANGEROUS!)

ticket_changesets resync

    Re-synchronize ticket changesets with all repositories

root

[root@my_server admin]# trac-admin /home/trac/project7 ?
trac-admin - The Trac Administration Console 0.12.2

Usage: trac-admin </path/to/projenv> [command [subcommand] [option ...]]

Invoking trac-admin without command starts interactive mode.

help                        Show documentation
initenv                     Create and initialize a new environment
attachment add              Attach a file to a resource
...
...
ticket remove               Remove ticket
ticket_changesets diff      Examine ticket commit messages before reformat
ticket_changesets get       Get a comma-separated list of related revisions.
ticket_changesets reformat  Reformat ticket commit messages (DANGEROUS!)
ticket_changesets resync    Re-synchronize ticket changesets with all repositories
ticket_type add             Add a ticket type
...
wiki replace                Replace the content of wiki pages from files (DANGEROUS!)
wiki upgrade                Upgrade default wiki pages to current version

apache (non-root)

[apache_user@my_server admin]# trac-admin /home/trac/project7 ?
trac-admin - The Trac Administration Console 0.12.2

Usage: trac-admin </path/to/projenv> [command [subcommand] [option ...]]

Invoking trac-admin without command starts interactive mode.

help                        Show documentation
initenv                     Create and initialize a new environment
attachment add              Attach a file to a resource
...
...
ticket remove               Remove ticket
ticket_type add             Add a ticket type
...
wiki replace                Replace the content of wiki pages from files (DANGEROUS!)
wiki upgrade                Upgrade default wiki pages to current version
}}}}}}
see, that ticket_changesets commands are missing here. Why?

Change History (4)

comment:1 Changed 12 years ago by Mikael Relbe

Status: newassigned

Weird, I'll try to have a look at this when I get the time do get my act together (this plugin is really suffering from lack of time from my part).

However, I'm only running Trac och Windows environments and have limited experience with user account policies (though a restricted apache user is running here as well, I have not noticed this problem).

comment:2 Changed 11 years ago by anonymous

This looks more like a problem with permissions in this particular Trac instance rather than problems in the plugin itself. In fact, it seems to me that it is not related to TracTicketChangesetsPlugin at all. In Trac 0.12 you need to run post-commit hooks containing trac-admin commands, but that's just Trac. The fact that you are trying to run as root at all is probably part of the problem, as files created by root might not be readable/writable to the apache user. Just my 2 cents, I was actually looking into using this plugin and was at first reluctant when I saw the ticket, but after reading it I think it should be marked invalid.

comment:3 in reply to:  2 Changed 11 years ago by Mikael Relbe

Resolution: worksforme
Status: assignedclosed

Replying to anonymous:

This looks more like a problem with permissions in this particular Trac instance rather than problems in the plugin itself. In fact, it seems to me that it is not related to TracTicketChangesetsPlugin at all.

I think so to.

comment:4 Changed 11 years ago by Ryan J Ollos

Description: modified (diff)
Note: See TracTickets for help on using tickets.