Modify

Opened 13 years ago

Closed 4 years ago

#9970 closed defect (wontfix)

Only root may execute trac-admin commands

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?

Attachments (0)

Change History (7)

comment:1 Changed 13 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 12 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 12 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 12 years ago by Ryan J Ollos

Description: modified (diff)

comment:5 Changed 11 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 11 years ago by anonymous

Resolution: worksforme
Status: closedreopened

comment:7 Changed 4 years ago by Ryan J Ollos

Resolution: wontfix
Status: reopenedclosed

This plugin is deprecated in Trac 1.2 and later.

Please use TracTicketChangelogPlugin and request any missing features as enhancements for that plugin.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Mikael Relbe.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.