This is the mail archive of the cygwin-developers@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: 1.5.12


At 09:09 PM 10/23/2004 -0400, Pierre A. Humblet wrote:
>At 10:51 AM 10/8/2004 -0400, Jason Tishler wrote:
>>On Wed, Oct 06, 2004 at 05:07:49PM -0400, Christopher Faylor wrote:
>>> Anything else?
>>
>>Unfortunately, yes.  I've just begun to track down the following Cygwin
>>problem:
>>
>>    If a user tries to connect to proftpd when not logged in to Windows,
>>    then the proftpd login fails because chdir() to the user's home
>>    directory fails.  If they are already logged in to Windows, then the
>>    proftpd login succeeds.

I have checked in fixes for some problems, see earlier message in thread.
The last step is to guarantee access to the registry to read the system
mount/cygdrive. That can easily be done by adding 4 lines of code:

@@ -1802,11 +1802,13 @@ mount_info::from_registry ()
   read_mounts (r);
 
   /* Then read mounts from system-wide mount table. */
+  cygheap->user.deimpersonate ();
   reg_key r1 (HKEY_LOCAL_MACHINE, KEY_READ, "SOFTWARE",
              CYGWIN_INFO_CYGNUS_REGISTRY_NAME, CYGWIN_REGNAME,
              CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME,
              NULL);
   read_mounts (r1);
+  cygheap->user.reimpersonate ();
 }

and ditto for the cygdrive. It works just fine and the risk is zero.

The only problem is that this is called early in the initialization
sequence, before uinfo_init has been called to initialize the tokens
in cygheap->user to INVALID_HANDLE_VALUE, indicating that they do
not exist. This causes an innocuous error and printf's.

Question: Are there any objections to using NULL instead to indicate
that the tokens do not exist? That does not require any initialization.
Other solutions are possible but they are more complicated.

Pierre 


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