import xrdp-usb-1.1-1.el9

i9 changed/i9/xrdp-usb-1.1-1.el9
Arkady L. Shane 1 year ago
commit 76a8c125f3
Signed by: tigro
GPG Key ID: 9C7900103E1C4F8B

1
.gitignore vendored

@ -0,0 +1 @@
SOURCES/xrdp-usb-1.1.tar

@ -0,0 +1 @@
c14e57537ee63cb31d9f7114d056410e053c18e0 SOURCES/xrdp-usb-1.1.tar

@ -0,0 +1,31 @@
From 0a4e877f9dabf68e265e3d754d2a14217f0b0756 Mon Sep 17 00:00:00 2001
From: tigro <arkadiy.sheyn@softline.com>
Date: Mon, 9 Oct 2023 12:50:03 +0300
Subject: [PATCH] Update matches
---
usbip-attach | 4 ++--
2 files changed, 2 insertions(+), 2 deletions(-)
delete mode 100644 .usbip-attach.swp
diff --git a/usbip-attach b/usbip-attach
index d64767a..3e4a5f4 100755
--- a/usbip-attach
+++ b/usbip-attach
@@ -7,11 +7,11 @@
log_file="/var/log/usbip-attach"
usbip_program="/usr/sbin/usbip"
-host="$(journalctl -u xrdp-sesman | sed -n 's/^.*++ \(created\|reconnected\).* ip \([0-9.]*\):.*$/\2/p' | tail -1)"
+host="$(journalctl -u xrdp-sesman | grep -Po '(created|reconnected).*ip \K[^\s]*' | sed 's/\(.*\):/\1 /;s/::ffff://' | awk '{ print $1 }' | tail -1)"
echo "$(date) Connected from $host" >> $log_file
$usbip_program list -r "$host" 2>&1 >> $log_file
-$usbip_program list -r "$host" 2>/dev/null | sed -n 's/^ *\([0-9-]\+\):.*$/\1/p' | while read id;do
+$usbip_program list -r "$host" 2>/dev/null | awk -F/ '/\/sys\/devices\// { print $NF }' | while read id;do
echo "Found exported USB device $id, try to attach..." >> $log_file
$usbip_program attach -r "$host" -b "$id" 2>&1 >> $log_file
done
--
2.41.0

@ -0,0 +1,84 @@
Summary: Infrastructure for redirect USB devices to XRDP session
Name: xrdp-usb
Version: 1.1
Release: 1%{?dist}
License: GPLv3+
URL: http://altlinux.org
Source0: %{name}-%{version}.tar
Patch0: 0001-Update-matches.patch
BuildArch: noarch
%description
Infrastructure for redirect USB devices to XRDP session contains two packages:
- xrdp-usb-terminal for RDP client
- xrdp-usb-session for session of XRDP server
%package terminal
Summary: Redirect USB devices to XRDP session from RDP client
Requires: usbip
%description terminal
%summary
%package session
Summary: Use redirected USB devices in XRDP session
Requires: usbip
Requires(post): xrdp
Requires(preun): xrdp
%description session
%summary
%prep
%autosetup -p1
%build
# Nothing to build
%install
# For terminal
install -Dpm0440 usbip.sudoers %{buildroot}%{_sysconfdir}/sudoers.d/usbip
install -Dpm0644 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}
install -Dpm0755 usbip-export %{buildroot}%{_bindir}/usbip-export
# For session
install -Dpm0755 usbip-attach %{buildroot}%{_sbindir}/usbip-attach
%post session
if [ -f /etc/pam.d/xrdp-sesman ]; then
grep -q '/usr/sbin/usbip-attach' \
/etc/pam.d/xrdp-sesman || \
echo "session optional pam_exec.so /usr/sbin/usbip-attach" >> \
/etc/pam.d/xrdp-sesman
fi
%preun session
if [ -f /etc/pam.d/xrdp-sesman ]; then
grep -q '/usr/sbin/usbip-attach' \
/etc/pam.d/xrdp-sesman && \
sed -i '/usbip-attach/d' /etc/pam.d/xrdp-sesman ||:
fi
%files terminal
%config(noreplace) %{_sysconfdir}/%{name}
%attr(440,root,root) %config(noreplace) %{_sysconfdir}/sudoers.d/usbip
%{_bindir}/usbip-export
%files session
%{_sbindir}/usbip-attach
%changelog
* Mon Oct 09 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 1.1-1
- Rebuilt for MSVSphere 9.2
* Thu Oct 5 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 1.1-1
- Rebuilt for MSVSPhere 9.2
* Wed Sep 15 2021 Andrey Cherepanov <cas@altlinux.org> 1.1-alt1
- usbip-export: use sudo in non-interactive mode.
* Mon Sep 13 2021 Andrey Cherepanov <cas@altlinux.org> 1.0-alt1
- Initial build for Sisyphus.
Loading…
Cancel
Save