Amanda-Users

Re: directory permissions cause tar to segfault?

2004-06-15 13:28:38
Subject: Re: directory permissions cause tar to segfault?
From: Marc Langlois <marc AT keyseismic DOT com>
To: Eric Sproul <esproul AT ntelos DOT net>
Date: Tue, 15 Jun 2004 11:22:34 -0600
Hi Eric,

I had a similar problem with several versions of gtar (1.13, 1.13.25 and
1.14) on Solaris 8. By running the gtar command used by amanda
interactively with the -v flag, I found that gtar was SEGV-ing on a
specific user directory. When I added that directory to the amanda
exclude file, gtar worked fine, and the amanda backup succeeded.

This didn't really solve the problem, but it gives me some comfort that
it was caused by gtar, and not amanda. I suppose running a debug version
of gtar could shed some light on what is causing the SEGV.

HTH,
Marc. 

   
On Fri, 2004-06-11 at 11:01, Eric Sproul wrote:
> On Fri, 2004-06-11 at 10:44, Jon LaBadie wrote:
> > Well, I feel it shouldn't segfault under any conditions.
> 
> Hi Jon,
> I completely agree.
> 
> > 
> > Just two considerations, is "/bin/tar" the one amanda uses?
> 
> Yes.  I copied the command directly from the sendsize debug, but I was
> confused because it mentions both /bin/tar and /usr/lib/amanda/runtar:
> 
> sendsize[29880]: time 0.500: getting size via gnutar for md0 level 0
> sendsize[29880]: time 0.501: spawning /usr/lib/amanda/runtar in pipeline
> sendsize[29880]: argument list: /bin/tar (... rest of the options)
> 
> I found that when I tested from the command line I needed to leave out
> "/bin/tar".  See below.
> 
> > And I'm pretty sure that when run by amanda, tar is setuid root.
> > It does most things as the amanda-user, then invokes tar with
> > a setuid program called "runtar".  You might check that perms
> > on runtar are unchanged.
> 
> This host uses the Debian package, amanda-client_2.4.4p2-1.  The runtar
> binary looks correct.  I installed this version of amanda-client on
> 2/25, so a mod-date of 2/15 is reasonable, as we are tracking
> Debian-sid.
> 
> # ls -l /usr/lib/amanda/runtar
> -rwsr-xr--    1 root     backup       4716 Feb 15 21:44 /usr/lib/amanda/runtar
> 
> I tried as user "backup" running the estimate command using runtar
> instead, and still got a segfault.
> 
> backup@<HOST>:~$ /usr/lib/amanda/runtar --create --file /dev/null \
>  --directory /usr --one-file-system --listed-incremental \
>  /var/lib/amanda/gnutar-lists/dhcp02md0_1.new --sparse \
>  --ignore-failed-read --totals --exclude-from \
>  /tmp/amanda/sendsize.md0.20040609041435000.exclude .
> Segmentation fault
> 
> But... it didn't mention the directory permissions this time, as runtar
> is suid-root (which you noted).  The segfault seems to be coming from
> somewhere else then.  I guess I'll have to dig deeper into what is
> actually being backed up.  Maybe one of my files is causing this.
> 
> Thanks,
> Eric