Jackson wrote:
> I was given a machine runnig SuSE Enterprise Linux 10 and told to set
> up Trac and Subversion accessed via Apache. So, I have tried to do
> that. Now, I am trying to configure auhorization. When I try to access
> the Trac environment, I get the above message.
> Apache is running as 'root' (bad idea, I know ...). So this makes no
> sense. I solved the problem by "chmod -R 777 /var/trac", which seems
> rather drastic.

If that chmod worked, it suggests that Apache may not really be running
as root.  I've seen that before where the username reported in the
error message is "root" although Apache is not really running as root.
When they drop permissions the $USER environment variable may still be
set to "root" which is being picked up by Trac in that message.

Set your permissions back to something sane:
chmod -R 644 /var/trac
find /var/trac -type d | xargs chmod 755

Then apply this patch which I think should give you the right username
in that error message:

Index: trac/db/sqlite_backend.py
===================================================================
--- trac/db/sqlite_backend.py   (revision 4297)
+++ trac/db/sqlite_backend.py   (working copy)
@@ -146,11 +146,12 @@
             dbdir = os.path.dirname(path)
             if not os.access(path, os.R_OK + os.W_OK) or \
                    not os.access(dbdir, os.R_OK + os.W_OK):
-                from getpass import getuser
+                import pwd
+                username = pwd.getpwuid(os.getuid())[0]
                 raise TracError('The user %s requires read _and_ write
' \
                                 'permission to the database file %s
and the ' \
                                 'directory it is located in.' \
-                                % (getuser(), path))
+                                % (username, path))

         if have_pysqlite == 2:
             self._active_cursors = weakref.WeakKeyDictionary()


If that works I'll update Trac to use the "pwd" module instead of
"getpass" when possible (it's not available on Windows).  Then you
should be able to just make sure the Apache user owns the files in the
Trac projects:

chown -R www-data /var/trac

Replacing www-data with the right user name.

-- Matt Good


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Trac Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to