]> TLD Linux GIT Repositories - packages/xrdp.git/blobdiff - xrdp.spec
- release 2, disallow root logins and use xrdp group instead of users
[packages/xrdp.git] / xrdp.spec
index 757d9de6b22823af8ee5ad4b6fa3d75771ccfb6b..15d527b47db3254f20c23d47c7e66319219e3bb0 100644 (file)
--- a/xrdp.spec
+++ b/xrdp.spec
@@ -2,7 +2,7 @@ Summary:        Remote desktop server
 Summary(pl.UTF-8):     Serwer remote desktop
 Name:          xrdp
 Version:       0.9.7
-Release:       1
+Release:       2
 License:       GPL
 Group:         X11/Applications/Networking
 Source0:       https://github.com/neutrinolabs/xrdp/releases/download/v%{version}/%{name}-%{version}.tar.gz
@@ -27,6 +27,9 @@ Requires(post,preun): /sbin/chkconfig
 Requires:      /usr/bin/Xvnc
 Requires:      rc-scripts
 Requires:      xinitrc-ng
+Requires(postun):       /usr/sbin/groupdel
+Requires(pre):  /usr/bin/getgid
+Requires(pre):  /usr/sbin/groupadd
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -118,6 +121,9 @@ install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/xrdp/startwm.sh
 
 :> $RPM_BUILD_ROOT/etc/security/blacklist.sesman
 
+%pre
+%groupadd -g 183 xrdp
+
 %post
 /sbin/chkconfig --add xrdp
 %service xrdp restart "xrdp server"
@@ -128,6 +134,11 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del xrdp
 fi
 
+%postun
+if [ "$1" = "0" ]; then
+       %groupremove xrdp
+fi
+
 %clean
 rm -rf $RPM_BUILD_ROOT