Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 97926 - dev-util/subversion - /etc/init.d/svnserve does not change cwd
Summary: dev-util/subversion - /etc/init.d/svnserve does not change cwd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor
Assignee: Paul de Vrieze (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-04 12:40 UTC by Florian Westphal
Modified: 2005-08-25 07:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Westphal 2005-07-04 12:40:44 UTC
/etc/init.d/svnserve does not change the current working directory.
svnserve does not change its cwd either. Some hooks-scripts may fail silently.
Running strace on svnserve will show something like this:

[pid 29826] stat64("/svn/repo/hooks/post-commit", {st_mode=S_IFREG|0755,
st_size=1527, ...}) = 0
[..]
[pid 29826] clone(Process 29827 attached
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
[..]
[pid 29827] chdir(".")                  = -1 EACCES (Permission denied)
[pid 29827] exit_group(-1)              = ?

In this case, cwd was set to /root.

Reproducible: Always
Steps to Reproduce:
1. run /etc/init.d/svnserve start from a directory that the svnserve user cannot
read.

Actual Results:  
post-commit-hook stopped working.

Expected Results:  
Have /etc/init.d/svnserve cd to / before running start-stop-daemon.
Comment 1 Paul de Vrieze (RETIRED) gentoo-dev 2005-08-25 06:59:52 UTC
Does this not work with any hook scripts, or only with broken ones? In any case
I've changed the init.d script.
Comment 2 Florian Westphal 2005-08-25 07:52:02 UTC
Its caused by svnserve itself rather than the scripts, there is no execve()
between the call to fork/clone and the chdir(".").
Thanks for fixing this.