Subject: amanda port & tar question
From: [email-masked] (Enrico Bernardini)

25 May 1998 21:43:19 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
To: [email-masked]

I ported the AMANDA-client software to WinNT using cygnus32.b18.

AMANDA is a backup system that allows the administrator of a LAN to set
up a single master backup server to back up multiple hosts to a single
large capacity tape drive ( http://www.cs.umd.edu/projects/amanda )

AMANDA uses tar to backup FAT and NTFS partitions.

Now the trouble:

I modified the sources of tar-1.12 to enable the Backup Privilege. I could
backup regardless file permissions.  Now, tar can backup the readable
files inside a "locked" directory, and I can see (with Event Viewer)
the Backup Privilege set.

When I "lock" a file, tar can't execute stat() (nor open()) on
it. Event Viewer reports a denied access to the file and the Backup
Privilege NOT set.

There is something I miss?
Please help
Thanks in advance
--
Enrico Bernardini
[email-masked]
--
I include the patch to tar.c

-------------CUT HERE-----------
*** tar.c	Fri Apr 25 22:09:49 1997
--- tar.c.new	Mon May 25 17:36:33 1998
***************
*** 16,21 ****
--- 16,23 ----
     with this program; if not, write to the Free Software Foundation, Inc.,
     59 Place - Suite 330, Boston, MA 02111-1307, USA.  */
  
+ #include <windows.h>
+ #undef ERROR
  #include "system.h"
  
  #include <getopt.h>
*************** Written by John Gilmore and Jay Fenlason
*** 1110,1115 ****
--- 1112,1121 ----
  int
  main (int argc, char *const *argv)
  {
+   HANDLE aToken;
+   TOKEN_PRIVILEGES aTokenPrivileges;
+   BOOL aStatus;
+ 
    program_name = argv[0];
    setlocale (LC_ALL, "");
    bindtextdomain (PACKAGE, LOCALEDIR);
*************** main (int argc, char *const *argv)
*** 1117,1122 ****
--- 1123,1134 ----
  
    exit_status = TAREXIT_SUCCESS;
    filename_terminator = '\n';
+ 
+ aStatus=OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &aToken);
+ aStatus=LookupPrivilegeValue(NULL, SE_BACKUP_NAME, &aTokenPrivileges.Privileges[0].Luid);
+ aStatus=aTokenPrivileges.PrivilegeCount=1;
+ aTokenPrivileges.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED;
+ aStatus=AdjustTokenPrivileges(aToken,FALSE,&aTokenPrivileges, (DWORD)NULL, (PTOKEN_PRIVILEGES)NULL,NULL);
  
    /* Pre-allocate a few structures.  */
  
---------END PATCH----------
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".