Skip to content
Snippets Groups Projects
Commit de1ecd81 authored by Christian Hesse's avatar Christian Hesse :stuck_out_tongue_winking_eye:
Browse files

run with dedicated user

parent 8e63b5a3
No related branches found
Tags 0.7.1-5
No related merge requests found
......@@ -3,44 +3,58 @@
pkgname=atftp
pkgver=0.7.1
pkgrel=4
pkgrel=5
pkgdesc='Client/server implementation of the TFTP protocol that implements RFCs 1350, 2090, 2347, 2348, and 2349'
arch=(x86_64)
arch=('x86_64')
url='http://sourceforge.net/projects/atftp/'
license=(GPL)
depends=(pcre readline)
backup=(etc/conf.d/atftpd)
license=('GPL')
depends=('pcre' 'readline')
backup=('etc/conf.d/atftpd')
source=("https://downloads.sf.net/sourceforge/atftp/atftp-$pkgver.tar.gz"
'atftp-0.7-cflags.patch'
'atftpd.service'
'atftpd.conf')
'atftpd.conf'
'sysusers.conf'
'tmpfiles.conf')
sha256sums=('ae4c6f09cadb8d2150c3ce32d88f19036a54e8211f22d723e97864bb5e18f92d'
'56a9bdf1c4f9452db041fce1bc4c994e84ce44c6093ef48588f8d8bc93adaf24'
'c7f115241777155265cae9760bbadd7299e49630e5be69d0d1d349e2bd4062bf'
'b9942e43206ddd4337454d6ed27a97976c0b84b6218b09a1a6549eec6b3023e6')
'74a030f0fb48e97470d59d767039e44d28cbd6c4722621207684220210b8fa65'
'0b28125099ffdd6869c6fbcb3167e93ccd71a0c6e465b1b62c7dedf9f628dd4e'
'e56f601bcdf0d64bf98813cd4a1be323541e33921c7d4f350168f62b56e66d11'
'2096272445c736ba05529af628cc2d46d0236c8f1ecbd50bb1db6dc6c4a972c5')
prepare() {
cd atftp-$pkgver
# Respect our CFLAGS; needed below for building with -std=gnu89
patch -Np1 -i ../atftp-0.7-cflags.patch
autoreconf -vi
}
build() {
cd atftp-$pkgver
CFLAGS+=' -std=gnu89'
./configure --prefix=/usr --mandir=/usr/share/man --sbindir=/usr/bin \
--enable-libreadline --disable-libwrap
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--sbindir=/usr/bin \
--enable-libreadline \
--disable-libwrap
make
}
package() {
cd atftp-$pkgver
make DESTDIR="$pkgdir" install
install -Dm644 ../atftpd.service "$pkgdir"/usr/lib/systemd/system/atftpd.service
install -Dm644 ../atftpd.conf "$pkgdir"/etc/conf.d/atftpd
install -dm775 --group=nobody "$pkgdir"/srv/atftp
install -D -m0644 ../atftpd.service "$pkgdir"/usr/lib/systemd/system/atftpd.service
install -D -m0644 ../atftpd.conf "$pkgdir"/etc/conf.d/atftpd
install -D -m0644 ../sysusers.conf "$pkgdir"/usr/lib/sysusers.d/atftp.conf
install -D -m0644 ../tmpfiles.conf "$pkgdir"/usr/lib/tmpfiles.d/atftp.conf
# remove in.tftpd link as it conflicts with extra/tftp-hpa
rm "${pkgdir}/usr/share/man/man8/in.tftpd.8"
......
# Parameters to be passed to ATFTPD
ATFTPD_ARGS="--no-multicast --maxthread 20 --verbose=6 --group nobody /srv/atftp"
ATFTPD_ARGS="--no-multicast --maxthread 20 --verbose=6 /srv/atftp"
......@@ -4,7 +4,9 @@ After=network.target
[Service]
EnvironmentFile=/etc/conf.d/atftpd
ExecStart=/usr/bin/atftpd --daemon --no-fork $ATFTPD_ARGS
ExecStart=/usr/bin/atftpd --user=atftp.atftp --daemon --no-fork $ATFTPD_ARGS
User=atftp
AmbientCapabilities=CAP_NET_BIND_SERVICE
ProtectSystem=full
ProtectHome=on
PrivateDevices=on
......
u atftp - "Advanced tftp daemon" /srv/atftp
d /srv/atftp 0755 atftp atftp -
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment