Bug 10017

Summary: amanda spec file defines a postinst script which does some curious things
Product: [Retired] Red Hat Linux Reporter: Seth Vidal <skvidal>
Component: amandaAssignee: Tim Powers <timp>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: marc_soft
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-03-20 14:11:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Seth Vidal 2000-03-06 21:32:09 UTC
The spec script in the amanda configuration for rawhide powertools does the
following in the postinst section.
# make sure there is an .amandahosts file, allow localhost by default
if [ ! -f ~operator/.amandahosts ]; then
  echo "localhost operator" > ~operator/.amandahosts
	echo "localhost.localdomain operator" > ~operator/.amandahosts
fi
# make sure user operator has an .amandahosts file
touch ~operator/.amandahosts
chown operator.disk ~operator/.amandahosts
chmod 660 ~operator/.amandahosts


This breaks if you have ~operator on an nfs mount (as many, I'm sure, do)

b/c most will have root_squash turned on for the client systems then root
does not have access to write over the ~operator homedir.
so you're out of luck there.

It really should be turned off in general.
Messing with config files (and .amandahosts is a config file) should be off
limits.

Comment 1 Marc MERLIN 2000-03-07 19:46:59 UTC
I'm answering your bug since I provided the bulk of the spec file RH is using
for amanda.
For your specific issue, here's what I told Red Hat:
/root should not be NFS mounted, it should be a local directory on the root
partition (if NFS is hosed, root can't log in (hang))

The reason why I have amanda "mess with the config file" is that amanda will
fail with a non helpful error message if it can't stat ~operator/.amandahosts
(which happens easily if ~root is 700). Here's the Email I sent to RH for more
details:
---
The real  problem is that  this whole operator  mess is really  broken (i.e.
operator having a UID different from root, but sharing root's directory). If
operator  can't read  ~operator/.amandahosts, amanda  will fail  with a  non
helpful error  message ("clientname  access denied"  instead of  "can't stat
authority file", or something like that)

There are two problems with using operator.disk for amanda:
1) operator doesn't have its own home directory, thus it may not even be
   able to stat files in it home directory
2) .amandahosts is a configuration file, so it should be in /etc

I  didn't want  to have  the RPM  patch the  home directory  of operator  in
/etc/passwd as it's  a user that comes  by default with any  RH install, and
people may copy default password files around

I really  wanted to do  #2, and  create a backup  user and group,  just like
debian, and  have an  /etc/amanda directory in  which the  .amandahosts file
would  be. However, I  didn't  do this  because it  would  have been  rather
different from the original amanda package that I was trying to supersede.
All that said, this is probably the right fix (maybe with some upgrade magic
to copy  ~operator/.amandahosts to ~amanda).
---

The current amanda package may not be great, but at least it works (which wasn't
true of the previous version). Tim said he would look into improving the package
for powertools 7.0 (i.e the next version)