I didn't see it in your script, but are you running the script as sudo in
the hook somewhere?

What distro are you running? Is SELinux turned on?

Christian

-- 
Christian Hammond - chip...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


On Wed, Sep 26, 2012 at 7:58 AM, Borislav Sabev <borislavsa...@gmail.com>wrote:

> I have also created a question over at superuser so if anyone has this
> issue also take a look there:
>
> http://superuser.com/questions/479803/permissions-issue-when-trying-to-execute-command-in-post-commit-hook-in-svn
>
> Cheers,
>     Borislav.
>
> On Tuesday, 25 September 2012 16:23:06 UTC+3, Borislav Sabev wrote:
>>
>> Hello all.
>>
>> I have a dull problem that I can't seem to solve.
>>
>> *What am I trying to do?*
>> I am trying to do:
>> *post-review 
>> --repository-url=http://xxx.xxx.xxx.xxx/svn/testRepo2--revision-range=6:7 
>> --server=
>> http://reviews.example.test/ --username=reviewposter
>> --password=mydullpass --submit-as=admin -p --target-groups=reviewers*
>> All is alright when I try this from bash logged in as my user. Review is
>> posted, published, etc. ==> All permissions and other miscellaneous
>> settings are OK.
>>
>> *What happens when I try this from SVN's post-commit hook?*
>> The resources are commited but the svn operation hangs - actually the
>> post-commit hook does not finish.
>>
>> *What is the problem?*
>> post-review seems to get the user that is executing it and tries to log
>> it in. The user that's executing it is www-data (apache user) I.e. when I
>> run the command as www-data:
>> *sudo -u www-data post-review --repository-url=**http://xxx.
>> xxx.xxx.xxx/svn/testRepo2** --revision-range=6:7 **--server=ht
>> tp://reviews.example.test/** --username=reviewposter --password=**
>> mydullpass**! --submit-as=admin -p --target-groups=reviewers -d*
>> *
>> *
>> I get (notice the -d parameter in the post-review command - DEBUG):
>> *>>> RBTools 0.4.1*
>> *>>> Home = /home/borislav*
>> *Password for 'www-data':*
>>
>> This is where it hangs waiting for a password to be entered. The commit
>> operation cannot finish and it just stays there. On the other hand when I
>> do the same command with debug output but as myuser I get:
>> *>>> RBTools 0.4.1*
>> *>>> Home = /home/borislav*
>> *>>> HTTP GETting api/*
>> *>>> HTTP GETting http://reviews.example.test/api/info/*
>> *>>> Using the new web API*
>> *>>> HTTP GETting http://reviews.example.test/api/repositories/*
>> *>>> HTTP GETting http://reviews.example.test/api/repositories/1/*
>> *>>> HTTP GETting http://reviews.example.test/api/repositories/1/info/*
>> *>>> HTTP GETting http://reviews.example.test/api/repositories/2/*
>> *>>> HTTP GETting http://reviews.example.test/api/repositories/2/info/*
>> *>>> HTTP GETting http://reviews.example.test/api/repositories/3/*
>> *>>> HTTP GETting http://reviews.example.test/api/repositories/3/info/*
>> *>>> HTTP GETting http://reviews.example.test/api/repositories/4/*
>> *>>> HTTP GETting http://reviews.example.test/api/repositories/4/info/*
>> *>>> Attempting to create review request on http://xxx.xxx.xxx.xxx/svn/
>> testRepo2 for None*
>> *>>> Submitting the review request as admin*
>> *>>> HTTP POSTing to http://reviews.example.test/api/review-requests/:
>> {'submit_as': 'admin', 'repository': 'http://xxx.xxx.xxx.xxx/svn/
>> testRepo2'}*
>> *>>> Review request created*
>> *>>> Attempting to set field 'target_groups' to 'reviewers' for review
>> request '22'*
>> *>>> HTTP PUTting to http://reviews.example.test/
>> api/review-requests/22/draft/: {'target_groups': 'reviewers'}*
>> *>>> Uploading diff, size: 2316*
>> *>>> HTTP POSTing to http://reviews.example.test/
>> api/review-requests/22/diffs/: {'basedir': '/'}*
>> *>>> Publishing*
>> *>>> HTTP PUTting to http://reviews.example.test/
>> api/review-requests/22/draft/: {'public': 1}*
>> *Review request #22 posted.*
>> *
>> *
>> *http://reviews.example.test/r/22/*
>> *
>> *
>> So actually everything with the posting/publishing etc. works.
>>
>> One solution I thought of is to execute the command as my user from the
>> post-commit hook but that seems out-stretched and ugly to me.
>> Are there any other solutions?
>>
>> Thanks,
>>     Borislav.
>>
>  --
> Want to help the Review Board project? Donate today at
> http://www.reviewboard.org/donate/
> Happy user? Let us know at http://www.reviewboard.org/users/
> -~----------~----~----~----~------~----~------~--~---
> To unsubscribe from this group, send email to
> reviewboard+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/reviewboard?hl=en
>

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Reply via email to