Amanda-Users

Re: Amanda Server on Cygwin amdump not working :-S

2006-08-21 09:53:16
Subject: Re: Amanda Server on Cygwin amdump not working :-S
From: Jon LaBadie <jon AT jgcomp DOT com>
To: amanda-users AT amanda DOT org
Date: Mon, 21 Aug 2006 09:40:39 -0400
On Mon, Aug 21, 2006 at 11:23:13AM +0200, David Sánchez Martín wrote:
>  
> >On 2006-08-21 09:48, David Sánchez Martín wrote:
> >> $ /usr/local/sbin/amcheck  DailySet1
> >> Amanda Tape Server Host Check
> >> -----------------------------
> >> WARNING: program /usr/local/libexec/planner: not setuid-root
> >> WARNING: program /usr/local/libexec/dumper: not setuid-root
> >> WARNING: program /usr/local/sbin/amcheck: not setuid-root
> >
> >I doubt it works when not setuid-root
> >Strange this is a just a warning instead of an error...
> >
> >Did you do "make install" as root?
> >(If that makes sense in a cygwin environment :-) )
> 
> 
> I created an windows user called root for this.
> 
> The programs on cygwin shell seem correctly setuid to root (the user i've
> created).
> 
> Maybe is a permissions problem but i tried to change owner to SYSTEM
> (Windows best equivalent to God... err ... root, i mean :-)
> 
> With no visible difference (I tried SYSTEM, Administrator and root, all of
> which are in Administrators group)

It has been years since I've touched cygwin so these are just thoughts.

IIRC the closest thing to root was SYSTEM.
Like unix' root, system has a fixed uid and gid.
But it is not zero as in unix, instead I ISTR "18" for both.
You have to create your "root" user to have this value
and it "should" be mentioned in the amanda cygwin docs.

The other thing I question is whether changes to the amanda code
for cygwin has ever been extended to include the server pieces.
The primary developer of those changes ?Doug Kingston?, was only
intent on getting an amanda cygwin client, not a server.  I do
not recall seeing any reports of an amanda cygwin server.

Some of the necessary changes could include the test for "root".
If the code doesn't test for root by name, but instead by uid,
then the numerical test is often something like:

   if ( getuid() != 0 ) error

and as unix's root has a uid of 0, this can be simplified to:

   if ( getuid() )      error

Both would fail if root == SYSTEM, ie uid 18.

This is typical of changes needed for amanda cygwin clients
and may not have been extended to the server code as that
was not Doug's purpose.

BTW have you tried accessing your tape drive with other
amanda and/or cygwin commands?  Can you tar directly to and
from your tapedrive without amanda?  Can amtape and amlabel
access your drive and changer script?

-- 
Jon H. LaBadie                  jon AT jgcomp DOT com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)