amanda-3.4.1.ebuild 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools perl-module user systemd
  5. DESCRIPTION="The Advanced Maryland Automatic Network Disk Archiver"
  6. HOMEPAGE="http://www.amanda.org/"
  7. SRC_URI="mirror://sourceforge/amanda/${P}.tar.gz"
  8. LICENSE="HPND BSD BSD-2 GPL-2+ GPL-3+"
  9. SLOT="0"
  10. IUSE="curl gnuplot ipv6 kerberos minimal nls readline s3 samba systemd xfs"
  11. KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
  12. RDEPEND="sys-libs/readline:=
  13. virtual/awk
  14. app-arch/tar
  15. dev-lang/perl:=
  16. app-arch/dump
  17. net-misc/openssh
  18. >=dev-libs/glib-2.26.0
  19. dev-perl/JSON
  20. dev-perl/Encode-Locale
  21. nls? ( virtual/libintl )
  22. s3? ( >=net-misc/curl-7.10.0 )
  23. !s3? ( curl? ( >=net-misc/curl-7.10.0 ) )
  24. samba? ( net-fs/samba:= )
  25. kerberos? ( app-crypt/mit-krb5 )
  26. xfs? ( sys-fs/xfsdump )
  27. !minimal? (
  28. dev-perl/XML-Simple
  29. virtual/mailx
  30. app-arch/mt-st:=
  31. sys-block/mtx
  32. gnuplot? ( sci-visualization/gnuplot )
  33. app-crypt/aespipe
  34. app-crypt/gnupg
  35. )"
  36. DEPEND="${RDEPEND}
  37. virtual/pkgconfig
  38. nls? ( sys-devel/gettext )
  39. >=app-text/docbook-xsl-stylesheets-1.72.0
  40. app-text/docbook-xml-dtd
  41. dev-libs/libxslt
  42. dev-lang/swig
  43. "
  44. MYFILESDIR="${T}/files"
  45. ENVDIR="/etc/env.d"
  46. ENVDFILE="97amanda"
  47. TMPENVFILE="${T}/${ENVDFILE}"
  48. # This is a complete list of Amanda settings that the ebuild takes from the
  49. # build environment. This allows users to alter the behavior of the package as
  50. # upstream intended, but keeping with Gentoo style. We store a copy of them in
  51. # /etc/env.d/97amanda during the install, so that they are preserved for future
  52. # installed. This variable name must not start with AMANDA_, as we do not want
  53. # it captured into the env file.
  54. ENV_SETTINGS_AMANDA="
  55. AMANDA_GROUP_GID AMANDA_GROUP_NAME
  56. AMANDA_USER_NAME AMANDA_USER_UID AMANDA_USER_SH AMANDA_USER_HOMEDIR AMANDA_USER_GROUPS
  57. AMANDA_SERVER AMANDA_SERVER_TAPE AMANDA_SERVER_TAPE_DEVICE AMANDA_SERVER_INDEX
  58. AMANDA_TAR_LISTDIR AMANDA_TAR
  59. AMANDA_PORTS_UDP AMANDA_PORTS_TCP AMANDA_PORTS_BOTH AMANDA_PORTS
  60. AMANDA_CONFIG_NAME AMANDA_TMPDIR"
  61. amanda_variable_setup() {
  62. # Setting vars
  63. local currentamanda
  64. # Grab the current settings
  65. currentamanda="$(set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' | xargs)"
  66. # First we set the defaults
  67. [[ -z "${AMANDA_GROUP_GID}" ]] && AMANDA_GROUP_GID=87
  68. [[ -z "${AMANDA_GROUP_NAME}" ]] && AMANDA_GROUP_NAME=amanda
  69. [[ -z "${AMANDA_USER_NAME}" ]] && AMANDA_USER_NAME=amanda
  70. [[ -z "${AMANDA_USER_UID}" ]] && AMANDA_USER_UID=87
  71. [[ -z "${AMANDA_USER_SH}" ]] && AMANDA_USER_SH=/bin/bash
  72. [[ -z "${AMANDA_USER_HOMEDIR}" ]] && AMANDA_USER_HOMEDIR=/var/spool/amanda
  73. [[ -z "${AMANDA_USER_GROUPS}" ]] && AMANDA_USER_GROUPS="${AMANDA_GROUP_NAME}"
  74. # This installs Amanda, with the server. However, it could be a client,
  75. # just specify an alternate server name in AMANDA_SERVER.
  76. [[ -z "${AMANDA_SERVER}" ]] && AMANDA_SERVER="${HOSTNAME}"
  77. [[ -z "${AMANDA_SERVER_TAPE}" ]] && AMANDA_SERVER_TAPE="${AMANDA_SERVER}"
  78. [[ -z "${AMANDA_SERVER_TAPE_DEVICE}" ]] && AMANDA_SERVER_TAPE_DEVICE="/dev/nst0"
  79. [[ -z "${AMANDA_SERVER_INDEX}" ]] && AMANDA_SERVER_INDEX="${AMANDA_SERVER}"
  80. [[ -z "${AMANDA_TAR_LISTDIR}" ]] && AMANDA_TAR_LISTDIR=${AMANDA_USER_HOMEDIR}/tar-lists
  81. [[ -z "${AMANDA_CONFIG_NAME}" ]] && AMANDA_CONFIG_NAME=DailySet1
  82. [[ -z "${AMANDA_TMPDIR}" ]] && AMANDA_TMPDIR=/var/tmp/amanda
  83. [[ -z "${AMANDA_DBGDIR}" ]] && AMANDA_DBGDIR="$AMANDA_TMPDIR"
  84. # These are left empty by default
  85. [[ -z "${AMANDA_PORTS_UDP}" ]] && AMANDA_PORTS_UDP=
  86. [[ -z "${AMANDA_PORTS_TCP}" ]] && AMANDA_PORTS_TCP=
  87. [[ -z "${AMANDA_PORTS_BOTH}" ]] && AMANDA_PORTS_BOTH=
  88. [[ -z "${AMANDA_PORTS}" ]] && AMANDA_PORTS=
  89. # What tar to use
  90. [[ -z "${AMANDA_TAR}" ]] && AMANDA_TAR=/bin/tar
  91. # Now pull in the old stuff
  92. if [[ -f "${EROOT}${ENVDIR}/${ENVDFILE}" ]]; then
  93. # We don't just source it as we don't want everything in there.
  94. eval $(egrep "^AMANDA_" "${EROOT}${ENVDIR}/${ENVDFILE}" | grep -v '^AMANDA_ENV_SETTINGS')
  95. fi
  96. # Re-apply the new settings if any
  97. [ -n "${currentamanda}" ] && eval $(echo "${currentamanda}")
  98. }
  99. pkg_setup() {
  100. amanda_variable_setup
  101. # If USE=minimal, give out a warning, if AMANDA_SERVER is not set to
  102. # another host than HOSTNAME.
  103. if use minimal && [ "${AMANDA_SERVER}" = "${HOSTNAME}" ] ; then
  104. elog "You are installing a client-only version of Amanda."
  105. elog "You should set the variable \$AMANDA_SERVER to point at your"
  106. elog "Amanda-tape-server, otherwise you will have to specify its name"
  107. elog "when using amrecover on the client."
  108. elog "For example: Use something like"
  109. elog "AMANDA_SERVER=\"myserver\" emerge amanda"
  110. elog
  111. fi
  112. enewgroup "${AMANDA_GROUP_NAME}" "${AMANDA_GROUP_GID}"
  113. enewuser "${AMANDA_USER_NAME}" "${AMANDA_USER_UID}" "${AMANDA_USER_SH}" "${AMANDA_USER_HOMEDIR}" "${AMANDA_USER_GROUPS}"
  114. }
  115. src_unpack() {
  116. # we do not want the perl src_unpack
  117. default_src_unpack
  118. }
  119. src_prepare() {
  120. # gentoo bug #331111
  121. sed -i '/^check-local: check-perl$/d' "${S}"/config/automake/scripts.am || die
  122. sed -i '/^check-local:/s,syntax-check,,g' "${S}"/perl/Makefile.am || die
  123. # bug with glibc-2.16.0
  124. sed -i -e '/gets is a security/d' "${S}"/gnulib/stdio.in.h || die
  125. eautoreconf
  126. # places for us to work in
  127. mkdir -p "${MYFILESDIR}" || die
  128. # Now we store the settings we just created
  129. set | egrep "^AMANDA_" | grep -v '^AMANDA_ENV_SETTINGS' > "${TMPENVFILE}" || die
  130. # Prepare our custom files
  131. einfo "Building custom configuration files"
  132. local i # our iterator
  133. local sedexpr # var for sed expr
  134. sedexpr=''
  135. for i in ${ENV_SETTINGS_AMANDA} ; do
  136. local val
  137. eval "val=\"\${${i}}\""
  138. sedexpr="${sedexpr}s|__${i}__|${val}|g;"
  139. done
  140. # now apply the sed expr
  141. for i in "${FILESDIR}"/amanda-* ; do
  142. sed -re "${sedexpr}" <"${i}" >"${MYFILESDIR}/`basename ${i}`" || die
  143. done
  144. if use minimal; then
  145. cat "${MYFILESDIR}"/amanda-amandahosts-server.5.1_p3-r1 > "${T}"/amandahosts || die
  146. else
  147. sed -i -e 's:^\(my $amandahomedir\)=.*:\1 = $localstatedir;:' \
  148. server-src/am{addclient,serverconfig}.pl || die
  149. cat "${MYFILESDIR}"/amanda-amandahosts-client-2.5.1_p3-r1 > "${T}"/amandahosts || die
  150. fi
  151. eapply "${FILESDIR}"/${P}-slots.patch || die
  152. eapply "${FILESDIR}"/${P}-labelstr.patch || die
  153. eapply_user
  154. }
  155. src_configure() {
  156. # fix bug #36316
  157. addpredict /var/cache/samba/gencache.tdb
  158. # fix bug #376169
  159. addpredict /run/blkid
  160. addpredict /etc/blkid.tab
  161. [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
  162. source "${TMPENVFILE}"
  163. local myconf
  164. einfo "Using ${AMANDA_SERVER_TAPE} for tape server."
  165. myconf="${myconf} --with-tape-server=${AMANDA_SERVER_TAPE}"
  166. einfo "Using ${AMANDA_SERVER_TAPE_DEVICE} for tape server."
  167. myconf="${myconf} --with-tape-device=${AMANDA_SERVER_TAPE_DEVICE}"
  168. einfo "Using ${AMANDA_SERVER_INDEX} for index server."
  169. myconf="${myconf} --with-index-server=${AMANDA_SERVER_INDEX}"
  170. einfo "Using ${AMANDA_USER_NAME} for amanda user."
  171. myconf="${myconf} --with-user=${AMANDA_USER_NAME}"
  172. einfo "Using ${AMANDA_GROUP_NAME} for amanda group."
  173. myconf="${myconf} --with-group=${AMANDA_GROUP_NAME}"
  174. einfo "Using ${AMANDA_TAR} as Tar implementation."
  175. myconf="${myconf} --with-gnutar=${AMANDA_TAR}"
  176. einfo "Using ${AMANDA_TAR_LISTDIR} as tar listdir."
  177. myconf="${myconf} --with-gnutar-listdir=${AMANDA_TAR_LISTDIR}"
  178. einfo "Using ${AMANDA_CONFIG_NAME} as default config name."
  179. myconf="${myconf} --with-config=${AMANDA_CONFIG_NAME}"
  180. einfo "Using ${AMANDA_TMPDIR} as Amanda temporary directory."
  181. myconf="${myconf} --with-tmpdir=${AMANDA_TMPDIR}"
  182. if [ -n "${AMANDA_PORTS_UDP}" ] && [ -n "${AMANDA_PORTS_TCP}" ] && [ -z "${AMANDA_PORTS_BOTH}" ] ; then
  183. eerror "If you want _both_ UDP and TCP ports, please use only the"
  184. eerror "AMANDA_PORTS environment variable for identical ports, or set"
  185. eerror "AMANDA_PORTS_BOTH."
  186. die "Bad port setup!"
  187. fi
  188. if [ -n "${AMANDA_PORTS_UDP}" ]; then
  189. einfo "Using UDP ports ${AMANDA_PORTS_UDP/,/-}"
  190. myconf="${myconf} --with-udpportrange=${AMANDA_PORTS_UDP}"
  191. fi
  192. if [ -n "${AMANDA_PORTS_TCP}" ]; then
  193. einfo "Using TCP ports ${AMANDA_PORTS_TCP/,/-}"
  194. myconf="${myconf} --with-tcpportrange=${AMANDA_PORTS_TCP}"
  195. fi
  196. if [ -n "${AMANDA_PORTS}" ]; then
  197. einfo "Using ports ${AMANDA_PORTS/,/-}"
  198. myconf="${myconf} --with-portrange=${AMANDA_PORTS}"
  199. fi
  200. # Extras
  201. # Speed option
  202. myconf="${myconf} --with-buffered-dump"
  203. # "debugging" in the configuration is NOT debug in the conventional sense.
  204. # It is actually just useful output in the application, and should remain
  205. # enabled. There are some cases of breakage with MTX tape changers as of
  206. # 2.5.1p2 that it exposes when turned off as well.
  207. myconf="${myconf} --with-debugging"
  208. # Where to put our files
  209. myconf="${myconf} --localstatedir=${AMANDA_USER_HOMEDIR}"
  210. # Samba support
  211. myconf="${myconf} $(use_with samba smbclient /usr/bin/smbclient)"
  212. # Support for BSD, SSH, BSDUDP, BSDTCP security methods all compiled in by
  213. # default
  214. myconf="${myconf} --with-bsd-security"
  215. myconf="${myconf} --with-ssh-security"
  216. myconf="${myconf} --with-bsdudp-security"
  217. myconf="${myconf} --with-bsdtcp-security"
  218. # kerberos-security mechanism version 5
  219. myconf="${myconf} $(use_with kerberos krb5-security)"
  220. # Amazon S3 support
  221. myconf="${myconf} `use_enable s3 s3-device`"
  222. # libcurl is required for S3 but otherwise optional
  223. if ! use s3; then
  224. myconf="${myconf} $(use_with curl libcurl)"
  225. fi
  226. # Client only, as requested in bug #127725
  227. if use minimal ; then
  228. myconf="${myconf} --without-server"
  229. else
  230. # amplot
  231. myconf="${myconf} $(use_with gnuplot)"
  232. fi
  233. # IPv6 fun.
  234. myconf="${myconf} `use_with ipv6`"
  235. # This is to prevent the IPv6-is-working test
  236. # As the test fails on binpkg build hosts with no IPv6.
  237. use ipv6 && export amanda_cv_working_ipv6=yes
  238. # I18N
  239. myconf="${myconf} `use_enable nls`"
  240. # Bug #296634: Perl location
  241. perl_set_version
  242. myconf="${myconf} --with-amperldir=${VENDOR_LIB}"
  243. # Bug 296633: --disable-syntax-checks
  244. # Some tests are not safe for production systems
  245. myconf="${myconf} --disable-syntax-checks"
  246. # build manpages
  247. myconf="${myconf} --enable-manpage-build"
  248. # bug #483120
  249. tc-export AR
  250. econf \
  251. $(use_with readline) \
  252. ${myconf}
  253. }
  254. src_compile() {
  255. # Again, do not want the perl-module src_compile
  256. default_src_compile
  257. }
  258. src_install() {
  259. [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
  260. source ${TMPENVFILE}
  261. einfo "Doing stock install"
  262. emake DESTDIR="${D}" install || die
  263. # Build the envdir file
  264. # Don't forget this..
  265. einfo "Building environment file"
  266. (
  267. echo "# These settings are what was present in the environment when this"
  268. echo "# Amanda was compiled. Changing anything below this comment will"
  269. echo "# have no effect on your application, but it merely exists to"
  270. echo "# preserve them for your next emerge of Amanda"
  271. cat "${TMPENVFILE}" | sed "s,=\$,='',g"
  272. ) >> "${MYFILESDIR}/${ENVDFILE}"
  273. # Env.d
  274. einfo "Installing environment config file"
  275. doenvd "${MYFILESDIR}/${ENVDFILE}"
  276. # Lock down next section (up until docs).
  277. insopts -m0640
  278. # Installing Amanda Xinetd Services Definition
  279. einfo "Installing xinetd service file"
  280. insinto /etc/xinetd.d
  281. if use minimal ; then
  282. newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-client amanda
  283. else
  284. newins "${MYFILESDIR}"/amanda-xinetd-2.6.1_p1-server amanda
  285. fi
  286. if ! use minimal; then
  287. einfo "Installing Sample Daily Cron Job for Amanda"
  288. insinto /etc/cron.daily
  289. newins "${MYFILESDIR}/amanda-cron" amanda
  290. fi
  291. einfo "Installing systemd service and socket files for Amanda"
  292. systemd_dounit "${FILESDIR}"/amanda.socket || die
  293. systemd_newunit "${FILESDIR}"/amanda.service 'amanda@.service' || die
  294. insinto /etc/amanda
  295. einfo "Installing .amandahosts File for ${AMANDA_USER_NAME} user"
  296. doins "${T}/amandahosts"
  297. fperms 600 /etc/amanda/amandahosts
  298. dosym /etc/amanda/amandahosts "${AMANDA_USER_HOMEDIR}/.amandahosts"
  299. insinto "${AMANDA_USER_HOMEDIR}"
  300. einfo "Installing .profile for ${AMANDA_USER_NAME} user"
  301. newins "${MYFILESDIR}/amanda-profile" .profile
  302. insinto /etc/amanda
  303. doins "${S}/example/amanda-client.conf"
  304. if ! use minimal ; then
  305. insinto "/etc/amanda/${AMANDA_CONFIG_NAME}"
  306. doins "${S}/example/amanda.conf"
  307. doins "${S}/example/disklist"
  308. keepdir "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}/index"
  309. fi
  310. keepdir "${AMANDA_TAR_LISTDIR}"
  311. keepdir "${AMANDA_USER_HOMEDIR}/amanda"
  312. keepdir "${AMANDA_TMPDIR}/dumps"
  313. # Just make sure it exists for XFS to work...
  314. use xfs && keepdir /var/xfsdump/inventory
  315. local i
  316. for i in "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
  317. "${AMANDA_TMPDIR}" /etc/amanda; do
  318. einfo "Securing directory (${i})"
  319. fowners -R ${AMANDA_USER_NAME}:${AMANDA_GROUP_NAME} ${i}
  320. done
  321. # Do NOT use -R
  322. fperms 0700 \
  323. "${AMANDA_USER_HOMEDIR}" "${AMANDA_TAR_LISTDIR}" \
  324. "${AMANDA_TMPDIR}" "${AMANDA_TMPDIR}/dumps" \
  325. "${AMANDA_USER_HOMEDIR}/amanda" \
  326. /etc/amanda
  327. if ! use minimal ; then
  328. fperms 0700 \
  329. "${AMANDA_USER_HOMEDIR}/${AMANDA_CONFIG_NAME}" \
  330. /etc/amanda/${AMANDA_CONFIG_NAME}
  331. fi
  332. einfo "Setting setuid permissions"
  333. amanda_permissions_fix "${D}"
  334. # Relax permissions again
  335. insopts -m0644
  336. # docs
  337. einfo "Installing documentation"
  338. dodoc AUTHORS ChangeLog DEVELOPING NEWS README ReleaseNotes UPGRADING
  339. # our inetd sample
  340. einfo "Installing standard inetd sample"
  341. newdoc "${MYFILESDIR}/amanda-inetd.amanda.sample-2.6.0_p2-r2" amanda-inetd.amanda.sample
  342. # Amanda example configs
  343. einfo "Installing example configurations"
  344. rm "${D}"/usr/share/amanda/{COPYRIGHT,ChangeLog,NEWS,ReleaseNotes}
  345. mv "${D}/usr/share/amanda/example" "${D}/usr/share/doc/${PF}/"
  346. docinto example1
  347. newdoc "${FILESDIR}/example_amanda.conf" amanda.conf
  348. newdoc "${FILESDIR}/example_disklist-2.5.1_p3-r1" disklist
  349. newdoc "${FILESDIR}/example_global.conf" global.conf
  350. einfo "Cleaning up dud .la files"
  351. perl_set_version
  352. find "${D}"/"${VENDOR_LIB}" -name '*.la' -print0 |xargs -0 rm -f
  353. }
  354. pkg_postinst() {
  355. [ ! -f "${TMPENVFILE}" -a "$MERGE_TYPE" == "binary" ] && \
  356. TMPENVFILE="${ROOT}${ENVDIR}/${ENVDFILE}"
  357. [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE}) should exist!"
  358. source "${TMPENVFILE}"
  359. # Migration of amandates from /etc to $localstatedir/amanda
  360. if [ -f "${ROOT}/etc/amandates" -a \
  361. ! -f "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates" ]; then
  362. einfo "Migrating amandates from /etc/ to ${AMANDA_USER_HOMEDIR}/amanda"
  363. einfo "A backup is also placed at /etc/amandates.orig"
  364. cp -dp "${ROOT}/etc/amandates" "${ROOT}/etc/amandates.orig"
  365. mkdir -p "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/"
  366. cp -dp "${ROOT}/etc/amandates" "${ROOT}/${AMANDA_USER_HOMEDIR}/amanda/amandates"
  367. fi
  368. if [ -f "${ROOT}/etc/amandates" ]; then
  369. einfo "If you have migrated safely, please delete /etc/amandates"
  370. fi
  371. einfo "Checking setuid permissions"
  372. amanda_permissions_fix "${ROOT}"
  373. elog "You should configure Amanda in /etc/amanda now."
  374. elog
  375. elog "If you use xinetd, Don't forget to check /etc/xinetd.d/amanda"
  376. elog "and restart xinetd afterwards!"
  377. elog
  378. elog "Otherwise, please look at /usr/share/doc/${PF}/inetd.amanda.sample"
  379. elog "as an example of how to configure your inetd."
  380. elog
  381. elog "systemd-users: enable and start amanda.socket or the relevant services"
  382. elog "regarding what auth method you use."
  383. elog
  384. elog "NOTICE: If you need raw access to partitions you need to add the"
  385. elog "amanda user to the 'disk' group."
  386. elog
  387. elog "NOTICE: If you have a tape changer, you need to add the amanda user"
  388. elog "to the 'tape' group."
  389. elog
  390. elog "If you use localhost in your disklist your restores may break."
  391. elog "You should replace it with the actual hostname!"
  392. elog "Please also see the syntax changes to amandahosts."
  393. elog "The only exception is when you use the authentication method 'local'."
  394. elog
  395. elog "Please note that this package no longer explicitly depends on"
  396. elog "virtual/inetd, as it supports modes where an inetd is not needed"
  397. elog "(see bug #506028 for details)."
  398. }
  399. # We have had reports of amanda file permissions getting screwed up.
  400. # Losing setuid, becoming too lax etc.
  401. # ONLY root and users in the amanda group should be able to run these binaries!
  402. amanda_permissions_fix() {
  403. local root="$1"
  404. [ -z "${root}" ] && die "Failed to pass root argument to amanda_permissions_fix!"
  405. local le="/usr/libexec/amanda"
  406. for i in /usr/sbin/amcheck "${le}"/calcsize "${le}"/killpgrp \
  407. "${le}"/rundump "${le}"/runtar "${le}"/dumper \
  408. "${le}"/planner ; do
  409. chown root:${AMANDA_GROUP_NAME} "${root}"/${i}
  410. chmod u=srwx,g=rx,o= "${root}"/${i}
  411. done
  412. }