Fix permissions on keys and certificates
Make sure to generate them with mode 400. Adjust permissions on preexisiting keys. Regenerate empty keys.
This commit is contained in:
parent
6277dbab0f
commit
cb6a7d777b
22
xrdp.spec
22
xrdp.spec
@ -77,25 +77,22 @@ echo '#!/bin/bash -l
|
|||||||
#install 'bash -l' startwm script
|
#install 'bash -l' startwm script
|
||||||
%{__install} -Dp -m 755 sesman/startwm-bash.sh %{buildroot}%{_sysconfdir}/xrdp/startwm-bash.sh
|
%{__install} -Dp -m 755 sesman/startwm-bash.sh %{buildroot}%{_sysconfdir}/xrdp/startwm-bash.sh
|
||||||
|
|
||||||
#rsakeys.ini
|
|
||||||
touch %{buildroot}%{_sysconfdir}/xrdp/rsakeys.ini
|
|
||||||
%{__chmod} 0600 %{buildroot}%{_sysconfdir}/xrdp/rsakeys.ini
|
|
||||||
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%systemd_post xrdp.service
|
%systemd_post xrdp.service
|
||||||
|
|
||||||
if [ ! -f %{_sysconfdir}/xrdp/rsakeys.ini ]; then
|
if [ ! -s %{_sysconfdir}/xrdp/rsakeys.ini ]; then
|
||||||
xrdp-keygen xrdp %{_sysconfdir}/xrdp/rsakeys.ini > /dev/null
|
(umask 377; xrdp-keygen xrdp %{_sysconfdir}/xrdp/rsakeys.ini >/dev/null)
|
||||||
%{__chmod} 0600 %{_sysconfdir}/xrdp/rsakeys.ini
|
|
||||||
fi
|
fi
|
||||||
|
chmod 400 %{_sysconfdir}/xrdp/rsakeys.ini
|
||||||
|
|
||||||
if [ ! -f %{_sysconfdir}/xrdp/cert.pem ]; then
|
if [ ! -s %{_sysconfdir}/xrdp/cert.pem ]; then
|
||||||
openssl req -x509 -newkey rsa:2048 -sha256 -nodes -days 3652 \
|
(umask 377; openssl req -x509 -newkey rsa:2048 -sha256 -nodes -days 3652 \
|
||||||
-keyout %{_sysconfdir}/xrdp/key.pem \
|
-keyout %{_sysconfdir}/xrdp/key.pem \
|
||||||
-out %{_sysconfdir}/xrdp/cert.pem \
|
-out %{_sysconfdir}/xrdp/cert.pem \
|
||||||
-config %{_sysconfdir}/xrdp/openssl.conf
|
-config %{_sysconfdir}/xrdp/openssl.conf >/dev/null 2>&1)
|
||||||
fi
|
fi
|
||||||
|
chmod 400 %{_sysconfdir}/xrdp/cert.pem
|
||||||
|
chmod 400 %{_sysconfdir}/xrdp/key.pem
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%systemd_preun xrdp.service
|
%systemd_preun xrdp.service
|
||||||
@ -178,14 +175,13 @@ fi
|
|||||||
%exclude %{_libdir}/xrdp/*.la
|
%exclude %{_libdir}/xrdp/*.la
|
||||||
%ghost %{_localstatedir}/log/xrdp.log
|
%ghost %{_localstatedir}/log/xrdp.log
|
||||||
%ghost %{_localstatedir}/log/xrdp-sesman.log
|
%ghost %{_localstatedir}/log/xrdp-sesman.log
|
||||||
%attr(0600,root,root) %verify(not size md5 mtime) %{_sysconfdir}/xrdp/rsakeys.ini
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_includedir}/*
|
%{_includedir}/*
|
||||||
%{_libdir}/pkgconfig/xrdp.pc
|
%{_libdir}/pkgconfig/xrdp.pc
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Jan 23 2017 Pavel Roskin <plroskin@gmail.com> - 1:0.9.1-2
|
* Tue Jan 24 2017 Pavel Roskin <plroskin@gmail.com> - 1:0.9.1-2
|
||||||
- Split out xrdp-devel
|
- Split out xrdp-devel
|
||||||
- Generate certificate for TLS authentication on package install
|
- Generate certificate for TLS authentication on package install
|
||||||
- Add fastpath hotfix
|
- Add fastpath hotfix
|
||||||
|
Loading…
Reference in New Issue
Block a user