nslink

maintainer severach · 0 votes · scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged The package downloads source code from a plausible project-owned host (pepperl-fuchs.com) for building a kernel driver; this is normal AUR packaging behavior despite the non-whitelisted domain, and no untrusted executables are run.

Triggered rules

LOW AI review downgraded a static finding llm_review

The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-07-25) reviewed the full PKGBUILD and judged it LOW (confidence 90%): The package downloads source code from a plausible project-owned host (pepperl-fuchs.com) for building a kernel driver; this is normal AUR packaging behavior despite the non-whitelisted domain, and no untrusted executables are run.

1 higher static finding superseded - not the current verdict (shown for transparency)
MEDIUM source=() URL on a non-standard host source_untrusted_domain

One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).

  • PKGBUILD:49 "devicemaster-linux-${pkgver}-${_dl}.zip::https://files.pepperl-fuchs.com/webcat/navi/productInfo/18/${_dl}.zip"
  • PKGBUILD:53 'https://downloads.comtrol.com/dev_mstr/rts/utility/linux_firmware_uploader/DM-Firmware-Updater-1.06.tar.gz'

PKGBUILD

2 offending line(s) highlighted
1# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
2
3_opt_DKMS=1 # This can be toggled between installs
4_opt_defaultmode='660' # default: 620
5
6#export KERNELRELEASE="$(basename $(dirname /usr/lib/modules/6.12.*/modules.alias))"
7
8# Todo: Test secure mode
9
10# Todo: python tools should be updated to python3
11# Todo: nslinktool Config Driver needs an up down button to reorder entries
12# Todo: TUI firmware updater.
13# Todo: Firmware updater can't update unit set to DHCP.
14# Todo: Firmware updater errors out on old versions: Expected to connect to bootloader after reboot but found DeviceMaster Boot Version 1.20
15# Todo: Comtrol icons for nslinktool and the firmware updater
16# Todo: nslinktool set the mouse pointer to a spinning circle far too long after startup
17# Todo: rm /dev/ttySI* on rmmod nslink
18# Todo: When characters are held by RTS low, opening ttySI* raises RTS too soon and some characters are lost
19
20# Todo: nslinktool, HUB IP Admin, [Get] with SocketServer, error getting IP info, did not get ip6info reply
21
22# Uninstall cleanup: sudo rm -f /etc/nslink.conf*
23
24# Configure with the NS-Link Manager GUI, Config Driver
25# Ports are /dev/ttySI0 through /dev/ttySI31
26
27set -u
28pkgname='nslink'
29pkgver='8.12'; _dl='1833783f'
30pkgrel='1'
31pkgdesc='tty driver and firmware update for Comtrol DeviceMaster, RTS, LT, PRO, 500, UP, RPSH-SI, RPSH, and Serial port Hub console terminal device server'
32# UP is not explicitly supported by NS-Link, only by the firmware updater.
33_pkgdescshort="Comtrol DeviceMaster ${pkgname} TTY driver"
34arch=('i686' 'x86_64')
35#url='http://www.comtrol.com/'
36url='https://www.pepperl-fuchs.com/global/en/classid_8222.htm'
37license=('GPL')
38depends=('glibc' 'openssl' 'python3' 'sed' 'groff' 'tcl' 'tk' 'util-linux') # python is also needed for the firmware updater
39optdepends=(
40 'gksu: NS-Link Manager GUI'
41)
42backup=('etc/nslink.conf')
43options=('!zipman' '!strip')
44install="${pkgname}-install.sh"
45#_verwatch=('http://downloads.comtrol.com/html/DM_PRO_RTS_SERIALHUB_drivers.htm' '.*/devicemaster-linux-\([0-9\.]\+\)\.tar\.gz' 'l')
46_srcdir="devicemaster-linux-${pkgver}"
47_srcdir_dm='DM-Firmware-Updater-1.06' # http://downloads.comtrol.com/html/DM_PRO_RTS_SERIALHUB_pvdx2.htm
48source=(
49 "devicemaster-linux-${pkgver}-${_dl}.zip::https://files.pepperl-fuchs.com/webcat/navi/productInfo/18/${_dl}.zip"
50 #"ftp://ftp.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-${pkgver}.tar.gz"
51 #"https://downloads.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-${pkgver}.tar.gz"
52 #'ftp://ftp.comtrol.com/dev_mstr/rts/utility/linux_firmware_uploader/DM-Firmware-Updater-1.06.tar.gz'
53 'https://downloads.comtrol.com/dev_mstr/rts/utility/linux_firmware_uploader/DM-Firmware-Updater-1.06.tar.gz'
54 'dmupdate.py.usage.patch'
55 '0002-kernel-5.6-proc_dir_entry-proc_ops.patch'
56 '0003-tty_unregister_driver-void.patch'
57 '0004-kernel-5.12-tty-low_latency.patch'
58 '0005-kernel-5.14-unsigned-tty-flow-tty.patch'
59 '0006-kernel-5.15-alloc_tty_driver-put_tty_driver.patch'
60 '0007-service-priority.patch'
61 '0008-python3-firmware.patch'
62 '0009-python3-nslink.patch'
63 '0010-kernel-6.1-TTY_DRIVER_MAGIC-remove-dead-code.patch'
64 '0011-kernel-6.0-set_termios-const-ktermios.patch'
65 '0012-kernel-6.6-struct-tty_operations-write-size_t.patch'
66 '0013-kernel-6.3-tty_port_operations-int-to-bool.patch'
67 '0014-kernel-6.8-tty_driver.h-send_xchar-to-u8.patch'
68)
69md5sums=('e5d1a3959fb63c2c70bab9da47af3bb4'
70 'e3ffb36acfdd321c919e44d477f0774a'
71 '581cd5f582ed20c7cf85a4df23a9f78a'
72 'dd44ac32eb3632120258cc4727221e15'
73 '23414fe236ef697e39f9bf6c26e482d9'
74 '26cd5af09d89c1b48a33fcbee00ce248'
75 '59e2c6d076c5346807088899bd05df3b'
76 '3cbb73aa4cdd04374744651ae5475b3c'
77 'e5692035f047cdec52658f67954c6f4d'
78 '8c329cf0f9c90cfd07ba86a4027eec48'
79 'e21d8211b2f209ace648340cb5583805'
80 '2774e3aa64717a7613e96fd86f649ea1'
81 '98788ff1378604e9fda43eb6ef9e9e3d'
82 'feb1ccc7522a6ac2b33326c7f648edb2'
83 '1ff77ae8edbcd654c680999eadd4911b'
84 'ed93e16d8cbac647e69a473359991c2d')
85sha256sums=('0d3e75732edda607006f04baa50d8d3c1b44df26e4535de47dffb341da9e99d1'
86 'd21c5eeefdbf08a202a230454f0bf702221686ba3e663eb41852719bb20b75fb'
87 '5a4e2713a8d1fe0eebd94fc843839ce5daa647f9fa7d88f62507e660ae111073'
88 '9fe2680244ce4e5dc933e028a5e7944a912c2980a91cee92509904ede2cf8bea'
89 'de8de0c17c8075bbd792d271a869c5248063bf7126c60c61f37d833ee7f57fb7'
90 '79d86016eb5b2e80fd97350986fcd3c3050f10eb6fbe50f69b7fb454c8c049fa'
91 '13ec641d2371bb5fe4d4e745b95c2722652fc5bdb7ceef5a48882f9977b0c0ca'
92 '4411ef239ab5d8b227f08dc37ee33dc0a21ca9b98f03f39e90ea396d04127bdf'
93 'bfa34783131c52e0bc0645c76469aaf504b13ac16d57b02d5ea9002603fb583e'
94 '1353bc403b56ef0b00f4b87826991812ee24bcc9a0b2612c0027317a7aa86736'
95 'a84e1a9884580917afe55816b4ec9b44ec0f4977144e7f4325647ff58642ecd6'
96 '2b909997f0662ae9a49463be4c1ef2af718882924071e0d74b9c04d9d1198691'
97 '7f181d1542b542989b319caf85621725389d7681cf2d5c3bb57dc774d14f1b76'
98 '5a62d3658d716c8140de65c2ac2e2560ca33f0f2a58212e29df74eadb821b6ce'
99 '4c605df9b08ea2be3b3c94a2dab8554902ff15576a7075c597453306c275e3e2'
100 '4ec33cda5131d1502ad46a26de68f0ae579e050e9ed7a111d7f9285caf972221')
101
102if [ "${_opt_DKMS}" -ne 0 ]; then
103 depends+=('linux' 'dkms' 'linux-headers')
104else
105 makedepends+=('linux-headers')
106fi
107
108prepare() {
109 set -u
110 set -x
111 # Pacman v7.0.0 makepkg won't unpack zip files
112 bsdtar -xf "${source[0]%%::*}"
113 if [ ! -d "${_srcdir}" ]; then
114 find -type 'f' -name "${_srcdir}.tar.gz" -exec bsdtar -xf '{}' ';' -quit
115 fi
116 set +x
117 cd "${_srcdir}"
118
119 # Fix permissions
120 find -type 'f' -perm '/111' -exec chmod 644 '{}' '+'
121 chmod 755 *.sh *.py 'nslinktool'
122
123 # Version check
124 local _ver
125 _ver="$(sed -n -e 's:^#define\sSI_VERSION\s"\([^"]\+\).*$:\1:p' 'version.h')"
126 if [ "${pkgver}" != "${_ver}" ]; then
127 echo "Version mismatch ${pkgver} != ${_ver}"
128 set +u
129 false
130 fi
131 unset _ver
132
133 local _patches=()
134 #_patches+=('0002-kernel-5.6-proc_dir_entry-proc_ops.patch')
135 #_patches+=('0003-tty_unregister_driver-void.patch')
136 #_patches+=('0004-kernel-5.12-tty-low_latency.patch')
137
138 # tty.stopped https://lore.kernel.org/lkml/20210505091928.22010-13-jslaby@suse.cz/
139 # unsigned write_room https://www.spinics.net/lists/linux-serial/msg42297.html
140 # unsigned chars_in_buffer https://www.spinics.net/lists/linux-serial/msg42299.html
141 #_patches+=('0005-kernel-5.14-unsigned-tty-flow-tty.patch')
142
143 # http://lkml.iu.edu/hypermail/linux/kernel/2107.2/08799.html [PATCH 5/8] tty: drop alloc_tty_driver
144 # http://lkml.iu.edu/hypermail/linux/kernel/2107.2/08801.html [PATCH 7/8] tty: drop put_tty_driver
145 #_patches+=('0006-kernel-5.15-alloc_tty_driver-put_tty_driver.patch')
146 _patches+=('0007-service-priority.patch')
147 _patches+=('0009-python3-nslink.patch')
148 #_patches+=('0010-kernel-6.1-TTY_DRIVER_MAGIC-remove-dead-code.patch')
149
150 # https://lore.kernel.org/linux-arm-kernel/20220816115739.10928-9-ilpo.jarvinen@linux.intel.com/T/
151 #_patches+=('0011-kernel-6.0-set_termios-const-ktermios.patch')
152 #_patches+=('0012-kernel-6.6-struct-tty_operations-write-size_t.patch')
153 #_patches+=('0013-kernel-6.3-tty_port_operations-int-to-bool.patch')
154 #_patches+=('0014-kernel-6.8-tty_driver.h-send_xchar-to-u8.patch')
155
156 local _pt _ptf=() _pts=()
157 for _pt in "${_patches[@]}"; do
158 set +u; msg2 "Patch ${_pt}"; set -u
159 if patch -Nup1 --no-backup-if-mismatch -i "${srcdir}/${_pt}"; then
160 _pts+=("${_pt}")
161 else
162 _ptf+=("${_pt}")
163 fi
164 done
165 if [ "${#_ptf[@]}" -gt 0 ]; then
166 if [ "${#_pts[@]}" -gt 0 ]; then
167 printf 'Patch success %s\n' "${_pts[@]}"
168 printf 'Warning: Some old patches may need to be removed even if they are successful\n'
169 fi
170 printf 'Patch failed %s\n' "${_ptf[@]}"
171 set +x
172 false
173 fi
174 #cd '..'; cp -pr "${_srcdir}" 'a'; ln -s "${_srcdir}" 'b'; false
175 #diff -pNaru5 'a' 'b' > "0000-$RANDOM.patch"
176
177 # Make package compatible
178 #cp -p 'install.sh' 'install.sh.Arch' # testmode for diff comparison
179 sed -e '# Fix some paths' \
180 -e 's: /lib/: /usr/lib/:g' \
181 -e 's: /sbin: /usr/bin:g' \
182 -e 's:"/sbin:"/usr/bin:g' \
183 -e 's:/usr/sbin:/usr/bin:g' \
184 -e 's:/usr/local/man:/usr/share/man:g' \
185 -e '# I suspect this folder for systemd is wrong even on RedHat' \
186 -e 's:/etc/systemd/system:/usr/lib/systemd/system:g' \
187 -e '# make package compatible' \
188 -e 's:"/etc/:"${DESTDIR}/etc/:g' \
189 -e 's: /etc/: "${DESTDIR}"/etc/:g' \
190 -e 's:"/usr/:"${DESTDIR}/usr/:g' \
191 -e 's: /usr/: "${DESTDIR}"/usr/:g' \
192 -e '# Disable module management and message' \
193 -e 's:^\s\+echo\s-n\s"Rebuilding:# &:g' \
194 -e 's:^.*depmod -a:# &:g' \
195 -e '# Disable systemd management' \
196 -e 's:^\s\+systemctl:# &:g' \
197 -e '# Get rid of the start messages lest someone believes them' \
198 -e 's:^\s\+if\s\[\s"$WillStart"\s=\syes\s\]:return\n&:g' \
199 -i 'install.sh'
200 test ! -s 'install.sh.Arch' || echo "${}"
201
202 # Fix /var/run
203 sed -e 's:/var/run/:/run/:g' -i 'nslink.service'
204
205 # Switch to python2
206 sed -e '# Why using local on just this one?' \
207 -e '#s:/usr/local/bin/python:/usr/bin/python:g' \
208 -e '#s:/usr/bin/python:&2:g' \
209 -i *.py 'nslinktool'
210
211 # Branding in dmesg
212 sed -e '/^int nrp_init(/,/^}/ s:version %s %s:& Arch Linux:g' -i 'nslink.c'
213 grep -qFe 'Arch Linux' 'nslink.c' || echo "${}"
214
215 # Fix nslinktool. We'll get rid of the tabs while we're here.
216 expand -i 'nslinktool' | sed -e 's:\s\+$::g' > 'nslinktool.orig'
217 sed -e 's:/usr/local/man:/usr/share/man:g' 'nslinktool.orig' > 'nslinktool'
218 rm 'nslinktool.orig'
219
220 # Convert the live config entries to samples. This eliminates
221 # special handling for detecting a blank configuration.
222 sed -e 's:^[^#]:#&:g' -i 'nslink.conf'
223
224 # Fix makefile
225 #cp -p 'Makefile'{,.Arch}
226 sed -e 's:=/lib/modules:=/usr/lib/modules:g' \
227 -e '# Switch SUBDIRS= to M= for Kernel 5.4' \
228 -e 's:SUBDIRS=:M=:g' \
229 -e '# No DKMS instructions say to do this but it works and keeps the MAKE line real simple' \
230 -e 's:$(shell uname -r):$(KERNELRELEASE):g' \
231 -e 's:`uname -r`:$(KERNELRELEASE):g' \
232 -e '#s:$(KVER):$(KERNELRELEASE):g' \
233 -e '# Shift make executable to separate target' \
234 -e 's@^\tmake nslinkd@\nnslink:\n&@g' \
235 -e '1i KERNELRELEASE?=$(shell uname -r)' \
236 -i 'Makefile'
237 test ! -s 'Makefile.Arch'
238
239 # Correct group and chmod for serial
240 sed -e '/getgrnam/ s:"tty":"uucp":g' \
241 -e '# This method results in 666' \
242 -e '#s:\(mode_t mode\) = [0-9]\+\(.*;\)'":\1 = ${_opt_defaultmode}\2:g" \
243 -e "/mknod/ s:mode:0${_opt_defaultmode}:g" \
244 -i 'nslinkd.c'
245
246 # Fix up the firmware downloaders
247 cd "${srcdir}/${_srcdir_dm}"
248
249 # Fix permissions
250 find -type 'f' -perm '/111' -exec chmod 644 '{}' '+'
251 chmod 755 *.py
252
253 sed -e '# Cosmetic cleanup for simpler patch editing, trim space at eol' \
254 -e 's:\s\+$::g' \
255 -e '# Switch to python2' \
256 -e '#s:/usr/bin/python:&2:g' \
257 -i *.py
258
259 #rm -f *.orig; cd '..'; cp -pr 'DM-Firmware-Updater-1.06' 'a'; ln -s 'DM-Firmware-Updater-1.06' 'b'; false
260 #diff -pNaru5 'a' 'b' > '0008-python3-firmware.patch'
261 patch -Nup1 -i "${srcdir}/0008-python3-firmware.patch"
262
263 # Patch usage and help into command line tool
264 #diff -pNau5 dmupdate.py{.orig,} > '../dmupdate.py.usage.patch'
265 patch -Nup0 -i "${srcdir}/dmupdate.py.usage.patch"
266 set +u
267}
268
269build() {
270 set -u
271 cd "${_srcdir}"
272 set +u
273 if ! make -j1 QUIET=0 all nslink; then
274 warning 'a no such file or directory error means you need to reboot to load the updated kernel'
275 false
276 fi
277}
278
279package() {
280 set -u
281 cd "${_srcdir}"
282
283 if [ "${_opt_DKMS}" -eq 0 ]; then
284 # I don't want Linux version info showing on AUR web. After a few months 'linux<0.0.0' makes it look like an out of date package.
285 local _kernelversionsmall="$(uname -r)"
286 _kernelversionsmall="${_kernelversionsmall%%-*}"
287 _kernelversionsmall="${_kernelversionsmall%\.0}" # trim 4.0.0 -> 4.0, 4.1.0 -> 4.1
288 # prevent the mksrcinfo bash emulator from getting these vars!
289 #eval 'conf''licts=("linux>${_kernelversionsmall}" "linux<${_kernelversionsmall}")'
290 eval 'dep''ends+=("linux=${_kernelversionsmall}")'
291 fi
292
293 # This installer expects the system folders to already exist
294 install -dm755 "${pkgdir}"{'/usr/bin','/etc',"/usr/lib/modules/$(uname -r)/misc",'/usr/lib/systemd/system'}
295
296 DESTDIR="${pkgdir}" \
297 INIT='systemd' \
298 sh -e -u 'install.sh' "$(uname -r)" install | \
299 sed -e "s:${pkgdir}::g" # cleaner display
300
301 # Fix paths in the service file
302 sed -e 's:/sbin/:/usr/bin/:g' -i "${pkgdir}/usr/lib/systemd/system/nslink.service"
303
304 # Root only permissions on executables. Easier than hacking UID 0 into them.
305 find "${pkgdir}/usr/bin/" -type 'f' -perm /111 -exec chmod 744 '{}' '+'
306
307 # Preserve an original copy of the config file
308 install -Dpm644 "${pkgdir}/etc/nslink.conf" "${pkgdir}/usr/share/nslink/nslink.conf.orig"
309
310 # Desktop file for NS-Link
311 install -Dm644 <(cat << EOF
312[Desktop Entry]
313Name=Comtrol NS-Link Administration
314GenericName=Device Server Manager
315Comment=DeviceMaster NS-Link for Comtrol Device Servers
316Exec=gksudo -k -u root nslinktool
317Terminal=false
318Type=Application
319#Icon=
320Categories=Application;Utilities;
321MimeType=application/x-executable
322EOF
323 ) "${pkgdir}/usr/share/applications/nslinktool.desktop"
324
325 # DKMS
326 if [ "${_opt_DKMS}" -ne 0 ]; then
327 rm -r "${pkgdir}/usr/lib/modules/"
328 local _dkms="${pkgdir}/usr/src/${pkgname}-${pkgver}"
329 #install -d "${_dkms}"
330
331 install -Dm644 <(cat << EOF
332# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
333# https://aur.archlinux.org/
334
335PACKAGE_NAME="${pkgname}"
336PACKAGE_VERSION="${pkgver}"
337AUTOINSTALL="yes"
338
339BUILT_MODULE_NAME[0]="nslink"
340BUILT_MODULE_LOCATION[0]=""
341# Using all processors doesn't compile this tiny module any faster.
342MAKE[0]="make -j1 all QUIET=1"
343CLEAN[0]="make -j1 clean"
344# Placing the DKMS generated module in a different location than the standard install prevents conflicts when PKGBUILD _opt_DKMS is toggled
345DEST_MODULE_LOCATION[0]="/kernel/drivers/misc"
346EOF
347 ) "${_dkms}/dkms.conf"
348 install -Dpm644 'nslink.h' 'nslink_int.h' 'version.h' 'nslink.c' 'Makefile' -t "${_dkms}"
349 #make -C "${_dkms}" clean
350 fi
351
352 # Install firmware updaters
353 cd "${srcdir}/${_srcdir_dm}"
354 install -Dpm755 *.py -t "${pkgdir}/usr/bin/"
355 install -Dpm644 'README.txt' -t "${pkgdir}/usr/share/nslink/"
356
357 # Desktop file for GUI firmware updater
358 install -Dm644 <(cat << EOF
359[Desktop Entry]
360Name=Comtrol Update Firmware
361GenericName=Device Server Manager
362Comment=Manage Firmware on Comtrol Device Servers
363Exec=DM-Firmware-Updater.py
364Terminal=false
365Type=Application
366#Icon=
367Categories=Application;Utilities;
368MimeType=application/x-executable
369EOF
370 ) "${pkgdir}/usr/share/applications/DM-Firmware-Updater.py.desktop"
371 set +u
372}
373
374set +u
375

Scan history

Scanned at (UTC)SeverityRules
2026-08-03 00:08:14 LOW 2
2026-08-02 00:16:08 LOW 2
2026-08-01 00:11:18 LOW 2
2026-07-31 00:14:10 LOW 2
2026-07-30 00:17:23 LOW 2
2026-07-29 00:25:53 LOW 2
2026-07-28 00:07:28 LOW 2
2026-07-27 00:24:32 LOW 2
2026-07-26 00:07:32 LOW 2
2026-07-25 00:13:44 LOW 2
2026-07-24 00:02:28 LOW 2
2026-07-23 00:14:47 LOW 2
2026-07-22 00:29:32 LOW 2
2026-07-21 00:24:15 LOW 2
2026-07-20 00:19:49 LOW 2
2026-07-19 00:17:08 LOW 2
2026-07-18 00:14:48 LOW 2
2026-07-17 00:06:16 LOW 2
2026-07-16 00:05:41 LOW 2
2026-07-15 00:09:25 LOW 2

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion