나는 이것이 여러 번 전에 물어 왔다는 것을 알고 있지만, 내 상황이 다르다고 생각한다.SVN 후크 pre-revprop-change not working
로그 메시지를 변경하려면 SVN 저장소에 pre-revprop-change 후크를 추가하려고합니다. 나는 pre-revprop-change
파일을 추가하기 전에
나는이 오류가 발생되었습니다
$ svn propset -r 557 --revprop svn:log "New message!" https://myserver/repos/myrepo
svn: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent
svn: At least one property change failed; repository is unchanged
svn: Error setting property 'log':
Repository has not been enabled to accept revision propchanges;
ask the administrator to create a pre-revprop-change hook
문제 없음, 나는 생각했다. 나는 그것을 추가 할 것이다 :
$ cd /var/www/svn/myrepo/hooks
$ # Create the simplest hook possible
$ echo '#!/bin/sh' > pre-revprop-change
$ echo 'exit 0' >> pre-revprop-change
$ # Check that it looks correct
$ cat pre-revprop-change
#!/bin/sh
exit 0
$ # Looks good, now make it executable
$ chmod a+x pre-revprop-change
$ # Check the permissions
$ ls -al pre-revprop-change
-rwxr-xr-x 1 apache apache 17 2012-05-24 12:05 pre-revprop-change
$ # Run it, to make sure it runs, and check the error code
$ ./pre-revprop-change
$ echo $?
0
그래서 내가 읽었던 그 밖의 모든 것에 따르면, 나는 그것이 작동하도록해야한다.
$ svn propset -r 557 --revprop svn:log "New message!" https://myserver/repos/myrepo
svn: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent
svn: At least one property change failed; repository is unchanged
svn: Error setting property 'log':
Revprop change blocked by pre-revprop-change hook (exit code 255) with no output.
주의 할 몇 가지 포인트가 있습니다 :
1) 저장소 내가 다시 로그 메시지를 편집하려고 할 때, 난 여전히 오류 (다른 사람이 시간)을 얻을 SELinux 서버 (Fedora 코어 10)에서 호스팅됩니다. 아마도 그 권한과 관련하여 제가해야 할 일이 있습니까? WebDAV를 저장소 (리포지토리 이름에 https://
참고)를 통해 액세스되는
$ ls -alZ pre-revprop-change
-rwxr-xr-x apache apache unconfined_u:object_r:httpd_sys_content_rw_t:s0 pre-revprop-change
2) 여기서 후크의 SE 권한이다. 사전 revprop 변경 변경을 허용하기 위해 WebDAV 측에서 설정해야 할 것이 있습니까?
이 보안 여부는 :) ...하지만 네, SELinux를 일으킬 수있는 몇 가지 미묘한 문제가 될 수 있습니다 "안전한"당신의 기준에 따라 달라집니다 그래도 로깅을 활성화하여 진단 할 수 있습니다. – 0xC0000022L
감사합니다. 그래, 우리 서버가 해킹 중심이 될 것이라고 생각하지 않지만 막 방대한 보안 구멍을 열지 않았는지 확인하고 싶었습니다! 'httpd_sys_script_exec_t '를 사용하지 않는 이유를 알고 있습니까? 그것은 그것이 있어야한다고 문서에서 보인다 ... –
나는 이것이 효과가 있어야한다고 생각했을 것이다. 'httpd_sys_script_exec_t' 대신'httpd_exec_t'가되어야하는 이유는 알 수 없습니다. 그러나 SELinux가 어떤 방법으로 Apache로 출력되는 스크립트를 다른 곳으로가는 스크립트와 구별 할 수는 있습니다.당신은 아파치를 사용하고 어디서나'svnserve'를 사용하지 않습니다 (아파치가 그것을 대리 할지라도), 맞습니까? – 0xC0000022L