delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/05/09:57:57

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 5 Jun 2003 16:01:46 +0200 (CEST)
From: Pavel Tsekov <ptsekov AT gmx DOT net>
X-X-Sender: ptsekov AT moria DOT atlanticsky DOT com
To: cygwin AT cygwin DOT com
Subject: RE: mc segfaults
In-Reply-To: <Pine.GSO.4.44.0306050907130.25752-100000@slinky.cs.nyu.edu>
Message-ID: <Pine.LNX.4.44.0306051545130.2381-100000@moria.atlanticsky.com>
MIME-Version: 1.0

On Thu, 5 Jun 2003, Igor Pechtchanski wrote:

[snip]

> > >, etc. Do the files
> > >/etc/passwd and /etc/group exist on your system ?
> >
> > Yes, but /etc/passwd is somewhat strange, in that my user
> > id (i.e. what is returned by 'id -u') does not match the
> > respective entry in /etc/passwd:
> >
> > $ id -u
> > 56297
> >
> > $ grep -c 56297 /etc/passwd
> > 0
> >
> > There *is* an entry in /etc/passwd corresponding to my
> > Windows account, but it has user id 121833.
> >
> > Ronald
> 
> Okay, Ronald, you're suffering from the UID wrapping problem.  Cygwin UIDs
> are currently 16 bit, so any number higher than 65535 will get wrapped
> (and did).  You can change your UID to any unique number smaller than
> 65535 (56297 should do as well as any other).  I don't know that that's
> the cause of your mc problem, but it's something to fix nonetheless.
> 
> If it turns out to fix your problem, it's a bug in 'mc', IMO.

See this code:

     current_user_uid = getuid ();
     pwd = getpwuid (current_user_uid);
     g_return_if_fail (pwd != NULL);

It may be regarded as a bug too - but the fact that an assertion is shown
means that the author of the code decided that it is the right thing to 
do i.e. it is not a programmering bug. Obiviosly the auhtor thought for 
a while and decided that having UID for which a corresponding passwd 
struct cannot be retrieved is not a normal situation.

I cannot judge if he was right or not without further inspecting the code -
this particular situation maybe can be avoided by removing the offending
call because there is this comment at its start:

 /* This function initialize global GTree with the gids of groups,
    to which user belongs. Tree also store corresponding string 
    with the name of the group.
    FIXME: Do we need this names at all? If not, we can simplify
    initialization by eliminating g_strdup's.
 */

I have investigate to draw a conclusion though. But then there may be 
other places where getpwuid() is called the same way - this means a lot of
work have to be put into finding the places and dealing with each one.
I don't think that I need to do all this now when 64 bit Cygwin is
to be released.

Anyway if you see a clean solution to this problem, one that won't 
impact the functionality of the program, I'll be happy to follow any 
advice you can give and release an update.

Pavel


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019