brother-mfc-j885dw
maintainer doorknob60
· 0 votes
· scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged
The package downloads Brother printer driver source and binaries from official Brother download servers for building and packaging; these are legitimate firmware/driver files, not executable payloads, and the sources, while on a non-whitelisted host, are from the vendor's official domain, making this a standard AUR driver package with no evidence of malice.
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 package downloads Brother printer driver source and binaries from official Brother download servers for building and packaging; these are legitimate firmware/driver files, not executable payloads, and the sources, while on a non-whitelisted host, are from the vendor's official domain, making this a standard AUR driver package with no evidence of malice.
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:45
"http://download.brother.com/welcome/dlf102040/${_brotherlnd}lpr-${pkgver}-${pkgrel}.i386.rpm"
PKGBUILD
1 offending line(s) highlighted
1
# Submitter of this package: doorknob60 gmail com
2
# Maintainer of original package I copied from: Chris Severance aur.severach aATt spamgourmet dott com
3
# Contributor: libernux dutchman55 gmx com
4
# Category: system
5
6
# The cups binary is 64 bit. Until Brother releases source for the 32 bit lpr
7
# binary blobs, 64 bit users must enable multilib.
8
9
# This has not been tested with non cups lprng.
10
11
# NOTE 1: Remember to add user to lp group using
12
# gpasswd -a USER lp
13
# NOTE 2: Remember to logout after adding groups
14
# NOTE 3: Set each printer default Media Size to Letter with
15
# lpadmin -p BR7360 -o media=Letter
16
17
set -u
18
_brotheru='MFC-J885DW'
19
_brotherl="${_brotheru,,}" # mfc-0000dw
20
_brotherlnd="${_brotherl//-/}" # mfc0000dw
21
_brotherund="${_brotheru//-/}" # MFC0000DW
22
pkgname="brother-${_brotherl}"
23
pkgver='1.0.0'
24
pkgrel='0'
25
pkgdesc="LPR and CUPS driver for the Brother ${_brotheru} printer"
26
arch=('i686' 'x86_64')
27
url='http://solutions.brother.com/linux/en_us/'
28
license=('custom:Brother Industries')
29
depends=('cups' 'ghostscript' 'psutils' 'a2ps' 'sed' 'grep')
30
depends_x86_64=('lib32-glibc')
31
# We look at the scripts and find these programs from which we decide on the depends above.
32
# gs: lpr rendering
33
# pdf2ps: cups rendering
34
# a2ps: rendering ascii text files
35
# (not) pstops: pdf resizing
36
# psnup: printing n-up pages
37
# sed grep awk
38
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670055
39
# Printing a text file fails when Liberation is the only TrueType font available
40
optdepends=('ttf-dejavu: printing text files from lpr')
41
#install="${pkgname}.install"
42
# The cups wrapper uses the lpr driver.
43
_brsource="${_brotherlnd}_cupswrapper_GPL_source_${pkgver}-${pkgrel}"
44
source=(
45
"http://download.brother.com/welcome/dlf102040/${_brotherlnd}lpr-${pkgver}-${pkgrel}.i386.rpm"
46
"http://download.brother.com/welcome/dlf102041/${_brotherlnd}cupswrapper-${pkgver}-${pkgrel}.i386.rpm"
47
"http://download.brother.com/welcome/dlf102045/${_brsource}.tar.gz"
48
'cupswrapper-license.txt'
49
'lpr-license.txt'
50
)
51
52
md5sums=('14ee478073961eb9582d8e4fb07fccb0'
53
'ad58372f6486a6d04e8ea45f671cdc43'
54
'1df10ea677d1f1fcdc6745fbd9e6325e'
55
'97ad0cffd216059e9d1d3121899d8646'
56
'5e87a3dc0f3e3438c088eda0f3565f0d')
57
58
59
build() {
60
set -u
61
# Do not Install in '/usr/local'. Does not apply to all Brother models.
62
# This may modify binary blobs which only
63
# works when the old and new strings are exactly the same length.
64
if [ -d "${srcdir}/usr/local/Brother" ]; then
65
install -dm755 "${srcdir}/usr/share"
66
mv "${srcdir}/usr/local/Brother/" "${srcdir}/usr/share/brother"
67
rm -rf "${srcdir}/usr/local"
68
sed -i -e 's:/usr/local/Brother:/usr/share/brother:g' $(grep -lr '/usr/local/Brother' ./)
69
fi
70
71
# setup cups-directories
72
install -dm755 "${srcdir}/usr/lib/cups/filter"
73
install -dm755 "${srcdir}/usr/share/cups/model"
74
#install -dm755 "${srcdir}/usr/share/ppd" # For cups we don't need the ppd file here.
75
76
# Get the dirs and the name of the wrapper. Either in /opt or /usr.
77
# This is set up to adapt or crash. Unlike false, ${} shows the line number.
78
cd "${srcdir}/opt" 2>/dev/null || cd "${srcdir}/usr"
79
local _rcfile="$(find "`pwd`" -type f -ipath "*inf/br${_brotherund}rc")"
80
test -f "${_rcfile}" || echo "${}"
81
local _bindir="$(find "`pwd`" -type d -name 'cupswrapper')"
82
test -d "${_bindir}" || echo "${}" # die if blank or invalid before we rm something we don't want to
83
rm -f "${_bindir}"/* # We download the cups driver only to throw it all away. All I want is the dir name without hunting for it in the installer.
84
local _basedir="${srcdir}/${_brsource}"
85
test -d "${_basedir}" || echo "${}"
86
cd "${_basedir}/cupswrapper" 2>/dev/null || cd "${_basedir}/scripts" 2>/dev/null || cd "${_basedir}"
87
local _wrapdir="$(pwd)"
88
cd "${_wrapdir}"
89
local _wrapper_source="$(echo cupswrapper${_brotherund}*)"
90
if ! test -f "${_wrapper_source}"; then
91
_wrapper_source="$(echo cupswrapper*)"
92
test -f "${_wrapper_source}" || echo "${}"
93
fi
94
cd "${_basedir}"/brcups*
95
local _makedir="$(pwd)"
96
if cd "${_basedir}/PPD" 2>/dev/null || cd "${_basedir}/ppd" 2>/dev/null; then
97
local _ppddir="$(pwd)"
98
fi
99
100
# Source is available for the cups binary, not the lpr binaries so we can't
101
# get away from multilib. Any usage of /opt is hardcoded into some binaries
102
# for which we can't find an equal length replacement so we can't easily get
103
# rid of that either.
104
cd "${_makedir}"
105
if [ -s 'Makefile' ]; then
106
make -s
107
cp -p 'brcupsconfpt1' "${_bindir}"
108
else
109
# Not sure why it's called brcupsconfig3 some places and brcupsconfig4 in others.
110
# The version in their binary matches the version in the source so it looks good to me.
111
# gcc options are pulled from other Brother makefiles.
112
gcc -pipe -Wall -W -O2 -s -o "${_bindir}/brcupsconfig3" "brcupsconfig.c"
113
fi
114
115
cd "${_bindir}"
116
if [ ! -z "${_ppddir:-}" ]; then
117
# Use the ppd supplied in the source
118
cp -p "${_ppddir}"/*.ppd "${_bindir}/"
119
chmod 644 "${_bindir}"/*.ppd
120
fi
121
122
# Some Brother installers create files here
123
mkdir -p "${srcdir}/var/tmp"
124
125
# Fix any sbin reference in the lpr driver. The cups driver uses bin.
126
#sed -i -e 's:/sbin/:/bin/:g' $(find "${srcdir}/usr" -type f -name "psconvert2")
127
128
# Fix page shifted off center that affects some printers
129
# Letter prints off center shifted down and right with PaperType=A4
130
# I can only test printing A4 on Letter paper. A4 appears to print correctly with PaperType=Letter
131
sed -i -e 's:^\(PaperType\)=.\+$:\1=Letter:g' "${_rcfile}"
132
133
# Modify the installer so we can finish the install here in PKGBUILD.
134
cp -p "${_wrapdir}/${_wrapper_source}" "${_bindir}/"
135
#cp -p "${_wrapper_source}" "${_wrapper_source}.Arch" # debug: diff compare with Total Commander
136
sed -i -e '# Install to _srcdir. Some folders may not apply to this model.' \
137
-e 's:/usr:${_srcdir}&:g' \
138
-e 's:/opt:${_srcdir}&:g' \
139
-e 's:/var:${_srcdir}&:g' \
140
-e "# Stop the Install script after the files are generated. cups doesn't require a reload to see the printer driver." \
141
-e 's:^if \[ -e /etc/init:exit 0 #Arch Linux Compatible\n&:g' \
142
"${_wrapper_source}"
143
grep -lq "#Arch Linux Compatible" "${_wrapper_source}" || echo "${}"
144
test -f "${_wrapper_source}.Arch" && echo "${}" # Halt for debugging
145
# Generate PPD and wrapper. Use sh -x to debug
146
# Possible bug: copying to /usr/share/ppd is disabled.
147
export _srcdir="${srcdir}"
148
sh -e "${_wrapper_source}" -i
149
unset _srcdir
150
151
rm -rf "${srcdir}/var"
152
153
# Remove srcdir from the generated wrapper file.
154
# No paths in the generated ppd.
155
sed -i -e '# Remove the ${_srcdir} variety' \
156
-e 's:${_srcdir}::' \
157
-e '# Remove the /home/... variety' \
158
-e "s:${srcdir}::" "${srcdir}/usr/lib/cups/filter/"*lpdwrapper*
159
160
# We did everything in the installer so we can get rid of it.
161
rm -f "${_wrapper_source}"
162
set +u
163
}
164
165
package() {
166
set -u
167
local _dir
168
# /var/spool is not used anywhere in this package. Maybe it's needed for non cups lprng.
169
for _dir in usr opt; do # var
170
if [ -d "${srcdir}/${_dir}" ]; then
171
cp -pR "${srcdir}/${_dir}" "${pkgdir}"
172
fi
173
done
174
175
# /etc/printcap is managed by cups. This eliminates any need for a printcap helper.
176
rm -f "`find "${pkgdir}" -type f -name 'setupPrintcap*'`"
177
178
# Ensure we got a ppd and a filter for CUPS
179
test "$(find "${pkgdir}/usr/share/cups/model" -type f -name '*.ppd')"
180
test "$(find "${pkgdir}/usr/lib/cups/filter/" -type f)"
181
182
# Ensure there are no forbidden paths
183
grep -alqr "/sbin" "${pkgdir}" && echo "${}"
184
grep -alqr "/usr/tmp" "${pkgdir}" && echo "${}"
185
186
install -Dm644 'cupswrapper-license.txt' "${pkgdir}/usr/share/licenses/${pkgname}/cupswrapper-licence.txt"
187
install -Dm644 'lpr-license.txt' "${pkgdir}/usr/share/licenses/${pkgname}/lpr-licence.txt"
188
set +u
189
}
190
set +u
191
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 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 |