From: enrico AT cli DOT di DOT unipi DOT it (Enrico Bernardini) Subject: amanda port & tar question 25 May 1998 21:43:19 -0700 Message-ID: <199805251604.SAA16513.cygnus.gnu-win32@guenda.cli.di.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit To: gnu-win32 AT cygnus DOT com 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 AT cli DOT di DOT unipi DOT 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 + #undef ERROR #include "system.h" #include *************** 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 AT cygnus DOT com" with one line of text: "help".