This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch]: Create Global Privilege


At 10:26 AM 12/2/2003 +0100, Corinna Vinschen wrote:
>On Mon, Dec 01, 2003 at 10:55:46PM -0500, Pierre A. Humblet wrote:
>> Also, the utmp/wtmp functions use mutexes to insure safe access.
>> That creates two problems, particularly on servers:
>> - When users have private copies of Cygwin with different mounts,
>>   there can be several utmp/wtmp files. Having a global mutex isn't
>>   helpful.
>> - If the utmp/wtmp files are unique, a user may not be have the
>>   privilege to create a global mutex, so that no mutual protection
>>   is achieved.
>> Both problems could be solved very simply by using file locking.
>> Should I do that some day?
>
>Sure, go ahead.

Hmm, the patch below might be a useful preliminary.

Also, on WinME specifying a length of 0 (changed to 0xFFFFFFFF) doesn't 
seem to work when the starting offset is greater than 1.
No time to fully investigate. 
Perhaps start + length must be <= 0x100000000 ???

Pierre

2003-12-03  Pierre Humblet <pierre.humblet@ieee.org>

	* fhandler_disk_file.cc (fhandler_disk_file::lock): Interchange
	values of off_low and off_high.


Index: fhandler_disk_file.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_disk_file.cc,v
retrieving revision 1.71
diff -u -p -r1.71 fhandler_disk_file.cc
--- fhandler_disk_file.cc       1 Dec 2003 17:26:28 -0000       1.71
+++ fhandler_disk_file.cc       3 Dec 2003 03:44:19 -0000
@@ -536,8 +536,8 @@ fhandler_disk_file::lock (int cmd, struc
 
   DWORD off_high, off_low, len_high, len_low;
 
-  off_high = (DWORD)(win32_start & 0xffffffff);
-  off_low = (DWORD)(win32_start >> 32);
+  off_low = (DWORD)(win32_start & 0xffffffff);
+  off_high = (DWORD)(win32_start >> 32);
   if (win32_len == 0)
     {
       /* Special case if len == 0 for POSIX means lock to the end of


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]