# Ticket #9970 (closed defect: worksforme)

Opened 1 year ago

## Only root may execute trac-admin commands

Reported by: Assigned to: jan.zilka@gmail.com mrelbe high TracTicketChangesetsPlugin major 0.12

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

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@my_server admin]# trac-admin /home/trac/project7 ?

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
...
wiki replace                Replace the content of wiki pages from files (DANGEROUS!)


apache (non-root)

[apache_user@my_server admin]# trac-admin /home/trac/project7 ?

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
...
wiki replace                Replace the content of wiki pages from files (DANGEROUS!)
}}}}}}
see, that ticket_changesets commands are missing here. Why?


## Change History

### 04/17/12 22:05:05 changed by mrelbe

• status changed from new to assigned.

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).

### (follow-up: ↓ 3 ) 03/21/13 17:57:02 changed 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.

### (in reply to: ↑ 2 ) 03/21/13 21:14:52 changed by mrelbe

• status changed from assigned to closed.
• resolution set to worksforme.

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.

### 03/21/13 22:50:31 changed by rjollos

• description changed.