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]

[Patch]: Create Global Privilege


This patch will stop the "CreateFileMapping, Win32 error 5. Terminating."
complaints.

It changes shared_name() to avoid setting the Global\ prefix on file mappings
when the Create Global Object privilege may be required but the user doesn't
have it. 

Note that when running from the console or as a service, the names are
looked up
in the global name space by default (with or without privilege), thus it
doesn't
matter if the prefix is Global\ or "". 
In other words, there is no need to determine if the user is running from 
Terminal Services.

As a side effect, the cygheap must be initialized earlier in the startup
sequence because it is needed for CloseHandle when debugging is enabled
(thus the changes in memory_init and shared_info::initialize).

I don't have access to Terminal Services to test the patch, but Fabrice
Larribe
reports that it works fine on a system where he needed, but couldn't get, the
privilege. 

Pierre

2003-11-25  Pierre Humblet <pierre.humblet@ieee.org>

	* shared.cc (shared_name): Take into account the SE_CREATE_GLOBAL_NAME
	privilege when building the name string.
	(open_shared): Remove the call to OpenFileMapping.
	(shared_info::initialize): Move cygheap initialization to ...	
	(memory_init): ... here. Suppress now useless shared_h variable.
	(user_shared_initialize): Make tu a cygpsid.
	* sec_helper.cc (set_process_privilege): Call LookupPrivilegeValue
	before opening the token.

Attachment: shared.diff
Description: Text document


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