molly-guard

maintainer envolution · 13 votes · scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged The source is a tarball from a Debian package mirror, which is a legitimate and common source for AUR packages; the build process applies patches and compiles the software locally, with no execution of remote code or suspicious payloads, making it low risk despite the non-whitelisted host.

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 95%): The source is a tarball from a Debian package mirror, which is a legitimate and common source for AUR packages; the build process applies patches and compiles the software locally, with no execution of remote code or suspicious payloads, making it low risk despite the non-whitelisted host.

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:18 "https://mirror.unitedcolo.de/debian/pool/main/m/molly-guard/${pkgname}_${pkgver}.tar.xz"

PKGBUILD

1 offending line(s) highlighted
1# Maintainer: envolution
2# Contributor: Christian Heusel <christian@heusel.eu>
3# Contributor: Carsten Feuls <archlinux@carstenfeuls.de>
4# Contributor: Christoph Vigano <mail at cvigano dot de>
5# shellcheck shell=bash disable=SC2034,SC2154
6pkgname='molly-guard'
7pkgver=0.8.5
8pkgrel=1
9pkgdesc="protects machines from accidental shutdowns/reboots (via ssh)"
10arch=('any')
11url="https://packages.debian.org/stable/molly-guard"
12license=('Artistic-2.0')
13depends=('openssh' 'run-parts')
14optdepends=('inetutils: for the FQDN Hostname support')
15install=molly-guard.install
16makedepends=('docbook-xsl')
17source=(
18 "https://mirror.unitedcolo.de/debian/pool/main/m/molly-guard/${pkgname}_${pkgver}.tar.xz"
19 arch-modifications.patch
20 )
21sha512sums=('1e3231930e12f4727acefac737632052dbf018bb574803527ea745daec7723f42fec911b0352da23a87202c8c1a4401d238f304f9849a1e647de9b06ac064150'
22 '7bf489623cbe7d6d59efbe070d40d1ad09d34b19bbf49312a0db4e266c38456a67be07e7bfee5cb392ee6985fd89422ae51e2090f57dd4573d79b93cc1757d31')
23
24prepare() {
25 cd "$srcdir/$pkgname-$pkgver"
26 patch -Np1 -i ../arch-modifications.patch
27
28 make clean
29 sed -i "s&DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl&DB2MAN=/usr/share/xml/docbook/xsl-stylesheets-`pacman -Q docbook-xsl | awk '{ print $2 }' | awk -F"-" '{ print $1 }'`/manpages/docbook.xsl&" Makefile
30 sed -i "s&root.root&root:root&" Makefile
31 # /usr/sbin -> /usr/bin
32 sed -i 's&sbin&bin&g' Makefile
33
34 sed -i 's&HOSTNAME="$(hostname --short)"&HOSTNAME="$(uname -n)"&' run.d/30-query-hostname
35 sed -i 's&egrep&grep -E&' run.d/30-query-hostname
36
37 sed -i 's,\$EXEC "\$CMDARGS",\$CMD "\$CMDARGS",;s,\$EXEC \$CMDARGS,\$CMD \$CMDARGS,' shutdown.in
38}
39
40build() {
41 cd "$pkgname-$pkgver"
42
43 libdir="/usr/lib"
44 bindir="/usr/bin"
45
46 make bindir=$bindir libdir=$libdir
47}
48
49
50package() {
51 cd "$pkgname-$pkgver"
52
53 libdir="/usr/lib"
54 bindir="/usr/bin"
55
56 make DESTDIR="$pkgdir" bindir=$bindir libdir=$libdir install
57
58 # remove blank lines and leading whitespace
59 # couldnt get this to work
60 # https://github.com/docbook/xslt10-stylesheets/issues/123
61 for filename in $(find "$pkgdir"/usr/share/man -type f -name "*.8"); do
62 sed -i '/^$/d' "$filename"
63 sed -i -e 's/^[ \t]*//' "$filename"
64 done
65
66 # replace occurences of pkgdir in scripts
67 for filename in $(find "$pkgdir"/usr -type f); do
68 sed -i "s&$pkgdir&&g" "$filename"
69 done
70
71 install -d "$pkgdir/etc/profile.d" "$pkgdir$libdir/$pkgname"
72 for cmd in halt poweroff reboot shutdown coldreboot; do
73 # wrapper symlink (points to molly-guard script/binary)
74 ln -s "molly-guard" "$pkgdir$libdir/$pkgname/$cmd"
75 # "no-molly-guard" symlink points to the real system command
76 ln -s "/usr/bin/$cmd" "$pkgdir$libdir/$pkgname/$cmd.no-molly-guard"
77 done
78
79 # profile script: set aliases
80 cat >"$pkgdir/etc/profile.d/molly-guard.sh" <<EOF
81# molly-guard: wrap shutdown-related commands
82for cmd in halt poweroff reboot shutdown coldreboot; do
83 alias \$cmd="$libdir/$pkgname/\$cmd"
84done
85EOF
86 rm -rf $pkgdir/usr/bin
87
88}
89# vim:set ts=2 sw=2 et:
90

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