acquiring wrong home directory

View: New views
7 Messages — Rating Filter:   Alert me  

acquiring wrong home directory

by Thomas Wolff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The user's home directory seems to be enquired by calling getpwnam or getpwent.
This is a bug, cvs should rather use the value of $HOME.
While the values are usually identical, if they are not, this is deliberately so.
Also, on cygwin systems, it is not unlikely that the values are different and
the /etc/passwd listed home directory may not even exist.

Thomas Wolff


_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs

Re: acquiring wrong home directory

by Larry Jones-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

towo@... writes:
>
> The user's home directory seems to be enquired by calling getpwnam or
> getpwent.
>
> This is a bug, cvs should rather use the value of $HOME.

CVS *does* use the value of $HOME (if set) in preference to the value
from the passwd file.  You need to specify a scenario that's causing you
to think otherwise and let us know exactly what version(s) of CVS you're
using and on what platform(s).
--
Larry Jones

My brain is trying to kill me. -- Calvin


_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs

Re: acquiring wrong home directory

by Thomas Wolff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Larry Jones schrieb:

> towo@... writes:
>  
>> The user's home directory seems to be enquired by calling getpwnam or
>> getpwent.
>>
>> This is a bug, cvs should rather use the value of $HOME.
>>    
>
> CVS *does* use the value of $HOME (if set) in preference to the value
> from the passwd file.  You need to specify a scenario that's causing you
> to think otherwise and let us know exactly what version(s) of CVS you're
> using and on what platform(s).
>  
Hi, thanks for your response. Here is some diagnostic log:

$ uname -a
CYGWIN_NT-5.1 TOWOLEO 1.7.0(0.214/5/3) 2009-10-03 14:33 i686 Cygwin

towo@TOWOLEO ~
$ cvs --version

Concurrent Versions System (CVS) 1.12.13 (client/server)

Copyright (C) 2005 Free Software Foundation, Inc.

Senior active maintainers include Larry Jones, Derek R. Price,
and Mark D. Baushke.  Please see the AUTHORS and README files from the CVS
distribution kit for a complete list of contributors and copyrights.

CVS may be copied only under the terms of the GNU General Public License,
a copy of which can be found with the CVS distribution kit.

Specify the --help option for further information about CVS

towo@TOWOLEO ~
$ echo $HOME
/cygdrive/d/Texte/towo

towo@TOWOLEO ~
$ cvs login
Logging in to :pserver:anoncvs@...:2401/cvs/src
CVS password:
cvs login: CVS password file /home/towo/.cvspass does not exist -
creating a new file

towo@TOWOLEO ~
$

Note that $HOME is not /home/towo

Kind regards,
Thomas
_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs

Re: acquiring wrong home directory

by Larry Jones-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

towo@... writes:

>  
> Hi, thanks for your response. Here is some diagnostic log:
>
> $ uname -a
> CYGWIN_NT-5.1 TOWOLEO 1.7.0(0.214/5/3) 2009-10-03 14:33 i686 Cygwin
>
> towo@TOWOLEO ~
> $ cvs --version
>
> Concurrent Versions System (CVS) 1.12.13 (client/server)
[...]

>
> towo@TOWOLEO ~
> $ echo $HOME
> /cygdrive/d/Texte/towo
>
> towo@TOWOLEO ~
> $ cvs login
> Logging in to :pserver:anoncvs@...:2401/cvs/src
> CVS password:
> cvs login: CVS password file /home/towo/.cvspass does not exist -
> creating a new file

It seems to be something specific to cygwin -- that works fine on other
Unix and Unix-like systems.  You'll need to find someone with more
intimate knowledge of cygwin and the cygwin port of CVS to figure out
what's going on.  For this specific issue, you can set $CVS_PASSFILE to
work around the problem.
--
Larry Jones

I'm crying because out there he's gone, but he's not gone inside me. -- Calvin


_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs

Re: acquiring wrong home directory

by Thomas Wolff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Larry Jones wrote:

> towo@... writes:
>  
>>  
>> Hi, thanks for your response. Here is some diagnostic log:
>>
>> $ uname -a
>> CYGWIN_NT-5.1 TOWOLEO 1.7.0(0.214/5/3) 2009-10-03 14:33 i686 Cygwin
>>
>> towo@TOWOLEO ~
>> $ cvs --version
>>
>> Concurrent Versions System (CVS) 1.12.13 (client/server)
>>    
> [...]
>  
>> towo@TOWOLEO ~
>> $ echo $HOME
>> /cygdrive/d/Texte/towo
>>
>> towo@TOWOLEO ~
>> $ cvs login
>> Logging in to :pserver:anoncvs@...:2401/cvs/src
>> CVS password:
>> cvs login: CVS password file /home/towo/.cvspass does not exist -
>> creating a new file
>>    
>
> It seems to be something specific to cygwin -- that works fine on other
> Unix and Unix-like systems.  You'll need to find someone with more
> intimate knowledge of cygwin and the cygwin port of CVS to figure out
> what's going on.  For this specific issue, you can set $CVS_PASSFILE to
> work around the problem.
>  
Hi, a tried to check this a little bit.
A quick grep for "getpw" as well as for "HOME" through the sources
reveals something different;
in src/sanity.sh, it says explicitly:
          # CVS looks at the home dir from getpwuid, not HOME (is that
correct
          # behavior?), so this is hard to test and we won't try.
No, this is not correct behaviour.
In a few Changelogs, it seems this has been touched multiple times.
In src/filesubr.c, function get_homedir, using $HOME depends on the flag
!server_active -
while I didn't dig into this deeper and don't know when exactly this
flag is set, it does not look proper and I suspect this to be the cause
of the problem
Kind regards,
Thomas
_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs

Re: acquiring wrong home directory

by Larry Jones-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thomas Wolff writes:

> From towo@...  Thu Oct 29 06:37:08 2009
> Received: by ypnefprocess.pl
> Received: from ugs.com (uscimhub002.ugs.com [146.122.22.36])
> by thor.ugs.com (8.11.6/8.10.1) with ESMTP id n9TAb7j08825
> for <scjones@...>; Thu, 29 Oct 2009 06:37:07 -0400 (EDT)
> Received: from uscimhub001.net.plm.eds.com (161.134.128.165) by
>  USCIMHUB002.net.plm.eds.com (146.122.22.36) with Microsoft SMTP Server (TLS)
>  id 8.1.393.1; Thu, 29 Oct 2009 06:37:07 -0400
> Received: from uscimedg001.net.plm.eds.com (161.134.128.163) by
>  uscimhub001.net.plm.eds.com (161.134.128.165) with Microsoft SMTP Server
>  (TLS) id 8.1.393.1; Thu, 29 Oct 2009 06:37:06 -0400
> Received: from hermes2.automation.siemens.com (141.73.46.66) by
>  uscimedg001.net.plm.eds.com (161.134.128.163) with Microsoft SMTP Server id
>  8.1.393.1; Thu, 29 Oct 2009 06:37:06 -0400
> Received: from dragon1.automation.siemens.com (dragon1.automation.siemens.com
>  [195.27.237.96]) by hermes2.automation.siemens.com (Postfix) with ESMTP id
>  861B525C880 for <lawrence.jones@...>; Thu, 29 Oct 2009 11:37:05 +0100
>  (CET)
> Received: from localhost (localhost [127.0.0.1]) by Virus-Spam-Check (Postfix)
>  with ESMTP id 2D6F0F81E9 for <lawrence.jones@...>; Thu, 29 Oct 2009
>  11:37:05 +0100 (CET)
> Received: from hephaistos.siemens.com (hephaistos.siemens.com [217.194.34.77])
> by dragon1.automation.siemens.com (Postfix) with ESMTP id 0A0B7F81D7 for
>  <lawrence.jones@...>; Thu, 29 Oct 2009 11:37:05 +0100 (CET)
> Received: from localhost (localhost.localdomain [127.0.0.1]) by
>  hephaistos.siemens.com (Postfix) with ESMTP id CBFB5E1804E for
>  <lawrence.jones@...>; Thu, 29 Oct 2009 11:37:05 +0100 (CET)
> Received: from hephaistos.siemens.com ([127.0.0.1]) by localhost
>  (hephaistos.erlm.siemens.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
>  id nim2TeFhZLyL for <lawrence.jones@...>; Thu, 29 Oct 2009 11:37:05
>  +0100 (CET)
> Received: from 93.183.12.32 (helo=hephaistos.siemens.com) by localhost with
>  ESMTP (envelope-from <towo@...>) for <lawrence.jones@...>;
>  Thu, 29 Oct 2009 11:37:03 +0100
> Received: from demumfd001.nsn-inter.net (demumfd001.nsn-inter.net
>  [93.183.12.32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
> (No client certificate requested) by hephaistos.siemens.com (Postfix) with
>  ESMTP for <lawrence.jones@...>; Thu, 29 Oct 2009 11:37:01 +0100 (CET)
> Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by
>  demumfd001.nsn-inter.net (8.12.11.20060308/8.12.11) with ESMTP id
>  n9TAabMo025101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256
>  verify=FAIL); Thu, 29 Oct 2009 11:36:38 +0100
> Received: from [10.149.155.84] ([10.149.155.84]) by
>  demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id
>  n9TAaZOE009237 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256
>  verify=NO); Thu, 29 Oct 2009 11:36:36 +0100
> Message-ID: <4AE97033.5030505@...>
> Date: Thu, 29 Oct 2009 11:36:35 +0100
> From: Thomas Wolff <towo@...>
> User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
> MIME-Version: 1.0
> To: Larry Jones <lawrence.jones@...>
> CC: <towo@...>, <bug-cvs@...>
> Subject: Re: acquiring wrong home directory
> References: <200910281655.n9SGtOO14046@...>
> In-Reply-To: <200910281655.n9SGtOO14046@...>
> Content-Type: multipart/alternative;
> boundary="------------060401090907000507010102"
> X-purgate-ID: 149900::1256812624-00000A2E-D05D84F2/0-0/0-0
> X-purgate-type: clean
> X-purgate-size: 4338
> X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
> X-purgate: clean
> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.16.4
>
> --------------060401090907000507010102
> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
> content-transfer-encoding: -SUGGEST
>
> Larry Jones wrote:
> > towo@... writes:
> >  
> >>  
> >> Hi, thanks for your response. Here is some diagnostic log:
> >>
> >> $ uname -a
> >> CYGWIN_NT-5.1 TOWOLEO 1.7.0(0.214/5/3) 2009-10-03 14:33 i686 Cygwin
> >>
> >> towo@TOWOLEO ~
> >> $ cvs --version
> >>
> >> Concurrent Versions System (CVS) 1.12.13 (client/server)
> >>    
> > [...]
> >  
> >> towo@TOWOLEO ~
> >> $ echo $HOME
> >> /cygdrive/d/Texte/towo
> >>
> >> towo@TOWOLEO ~
> >> $ cvs login
> >> Logging in to :pserver:anoncvs@...:2401/cvs/src
> >> CVS password:
> >> cvs login: CVS password file /home/towo/.cvspass does not exist -
> >> creating a new file
> >>    
> >
> > It seems to be something specific to cygwin -- that works fine on other
> > Unix and Unix-like systems.  You'll need to find someone with more
> > intimate knowledge of cygwin and the cygwin port of CVS to figure out
> > what's going on.  For this specific issue, you can set $CVS_PASSFILE to
> > work around the problem.
> >  
> Hi, a tried to check this a little bit.
> A quick grep for "getpw" as well as for "HOME" through the sources
> reveals something different;
> in src/sanity.sh, it says explicitly:
>           # CVS looks at the home dir from getpwuid, not HOME (is that
> correct
>           # behavior?), so this is hard to test and we won't try.
> No, this is not correct behaviour.
> In a few Changelogs, it seems this has been touched multiple times.
> In src/filesubr.c, function get_homedir, using $HOME depends on the flag
> !server_active -
> while I didn't dig into this deeper and don't know when exactly this
> flag is set, it does not look proper and I suspect this to be the cause
> of the problem
> Kind regards,
> Thomas
>
> --------------060401090907000507010102
> Content-Type: text/html; charset="ISO-8859-1"
> content-transfer-encoding: -SUGGEST
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
>   <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
> </head>
> <body bgcolor="#ffcc66" text="#000000">
> Larry Jones wrote:
> <blockquote cite="mid:200910281655.n9SGtOO14046@..."
>  type="cite">
>   <pre wrap=""><a class="moz-txt-link-abbreviated" href="mailto:towo@...">towo@...</a> writes:
>   </pre>
>   <blockquote type="cite">
>     <pre wrap="">  
> Hi, thanks for your response. Here is some diagnostic log:
>
> $ uname -a
> CYGWIN_NT-5.1 TOWOLEO 1.7.0(0.214/5/3) 2009-10-03 14:33 i686 Cygwin
>
> towo@TOWOLEO ~
> $ cvs --version
>
> Concurrent Versions System (CVS) 1.12.13 (client/server)
>     </pre>
>   </blockquote>
>   <pre wrap=""><!---->[...]
>   </pre>
>   <blockquote type="cite">
>     <pre wrap="">towo@TOWOLEO ~
> $ echo $HOME
> /cygdrive/d/Texte/towo
>
> towo@TOWOLEO ~
> $ cvs login
> Logging in to :pserver:anoncvs@...:2401/cvs/src
> CVS password:
> cvs login: CVS password file /home/towo/.cvspass does not exist -
> creating a new file
>     </pre>
>   </blockquote>
>   <pre wrap=""><!---->
> It seems to be something specific to cygwin -- that works fine on other
> Unix and Unix-like systems.  You'll need to find someone with more
> intimate knowledge of cygwin and the cygwin port of CVS to figure out
> what's going on.  For this specific issue, you can set $CVS_PASSFILE to
> work around the problem.
>   </pre>
> </blockquote>
> Hi, a tried to check this a little bit.<br>
> A quick grep for "getpw" as well as for "HOME" through the sources
> reveals something different;<br>
> in src/sanity.sh, it says explicitly:<br>
>           # CVS looks at the home dir from getpwuid, not HOME (is that
> correct<br>
>           # behavior?), so this is hard to test and we won't try.<br>
> No, this is not correct behaviour.<br>
> In a few Changelogs, it seems this has been touched multiple times.<br>
> In src/filesubr.c, function get_homedir, using $HOME depends on the
> flag !server_active -<br>
> while I didn't dig into this deeper and don't know when exactly this
> flag is set, it does not look proper and I suspect this to be the cause
> of the problem<br>
> Kind regards,<br>
> Thomas<br>
> </body>
> </html>
>
> --------------060401090907000507010102--
>



_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs

Re: acquiring wrong home directory

by Larry Jones-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thomas Wolff writes:
>
> in src/sanity.sh, it says explicitly:
>           # CVS looks at the home dir from getpwuid, not HOME (is that correct
>           # behavior?), so this is hard to test and we won't try.

Don't trust comments in the sanity check, use the source, Luke!

> In src/filesubr.c, function get_homedir, using $HOME depends on the flag
> !server_active -
> while I didn't dig into this deeper and don't know when exactly this
> flag is set, it does not look proper and I suspect this to be the cause
> of the problem

That flag is only set when CVS is running as a server (e.g., pserver).
In that case, the very idea of a "home" directory is pretty nebulous.
Like I said, it works fine on other Unix and Unix-like systems:

        bash-2.02$ export HOME=/tmp/foo
        bash-2.02$ cvs login
        Logging in to :pserver:scjones@thor:2401/public/CVS
        CVS password:
        cvs login: warning: failed to open /tmp/foo/.cvspass for reading: No such file or directory
        cvs [login aborted]: could not open /tmp/foo/.cvspass for writing: No such file or directory

It seems that cygwin is somehow special-casing getenv("HOME") rather
than just returning the value set in the environment like one would
expect.
--
Larry Jones

I take it there's no qualifying exam to be a Dad. -- Calvin


_______________________________________________
Bug-cvs mailing list
Bug-cvs@...
http://lists.nongnu.org/mailman/listinfo/bug-cvs