소스 검색

1. "ssh-keysign" has to be setuid root in order to allow "ssh" (which is not setuid root) to read the host keys (which are readable only by root) in SSH2 host based authentication. 2. use an empty subdir for the priviledge separation and make only this one owned by root (as required by Linux)

Ralf S. Engelschall 24 년 전
부모
커밋
ea86d8d783
1개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 6 3
      openssh/openssh.spec

+ 6 - 3
openssh/openssh.spec

@@ -158,7 +158,7 @@ AutoReqProv:  no
           --with-mantype=man \
           --with-default-path=%{l_prefix}/bin:/bin:/usr/bin:/usr/local/bin \
           --with-privsep-user=%{l_nusr} \
-          --with-privsep-path=%{l_prefix}/var/openssh
+          --with-privsep-path=%{l_prefix}/var/openssh/empty
 
       #   build package
       %{l_make} %{l_mflags -O}
@@ -184,7 +184,9 @@ AutoReqProv:  no
         %{SOURCE ssh-askpass} $RPM_BUILD_ROOT%{l_prefix}/libexec/openssh/
 
     #   make sure the state directory exists
-    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/openssh
+    %{l_shtool} mkdir -f -p -m 755 \
+	    $RPM_BUILD_ROOT%{l_prefix}/var/openssh \
+	    $RPM_BUILD_ROOT%{l_prefix}/var/openssh/empty
 
     #   install addons
     %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
@@ -210,7 +212,8 @@ AutoReqProv:  no
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
         %{l_files_std} \
         '%config %{l_prefix}/etc/openssh/*' \
-        '%dir %attr(700,root,root) %{l_prefix}/var/openssh'
+        '%attr(4711,root,%{l_mgrp}) %{l_prefix}/libexec/openssh/ssh-keysign' \
+        '%dir %attr(700,root,root) %{l_prefix}/var/openssh/empty'
 
 %files -f files