Opened 5 years ago

# Only root may execute trac-admin commands

Reported by: Owned by: Jan Z Mikael Relbe high TracTicketChangesetsPlugin major 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

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


### comment:1 Changed 5 years ago by Mikael Relbe

Status: new → 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).

### comment:2 follow-up:  3 Changed 4 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 4 years ago by Mikael Relbe

Resolution: → worksforme assigned → closed

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 4 years ago by Ryan J Ollos

Description: modified (diff)

### comment:5 Changed 4 years ago by rdeman

I was testing this on Trac 1.0.1 and I am getting this when running as root or as normal user.. same thing

Error: Command not found

No documentation found for 'ticket_changesets'. Use 'help' to see the list of commands.

Did you mean one of these?
changeset
ticket_type
ticket



### comment:6 Changed 4 years ago by anonymous

Resolution: worksforme closed → reopened

### Modify Ticket

Action
as reopened The owner will remain Mikael Relbe.