This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
amanda port & tar question
- To: gnu-win32 at cygnus dot com
- Subject: amanda port & tar question
- From: Enrico Bernardini <enrico at cli dot di dot unipi dot it>
- Date: Mon, 25 May 1998 18:04:49 +0200 (MET DST)
- Organization: Centro di Calcolo - Dipartimento di Informatica di Pisa - Italy
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
enrico@cli.di.unipi.it
--
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
"gnu-win32-request@cygnus.com" with one line of text: "help".