delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/08/09/09:16:07

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <911C684A29ACD311921800508B7293BA010A8BB1@cnmail>
From: Mark Bradshaw <bradshaw AT staff DOT crosswalk DOT com>
To: "'Corinna Vinschen'" <cygwin AT cygwin DOT com>
Subject: RE: OpenSSH patches dealing with incorrect pathing
Date: Thu, 9 Aug 2001 09:15:35 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

------_=_NextPart_000_01C120D5.5FFA5A10
Content-Type: text/plain;
	charset="iso-8859-1"

Oops.  Darn that line wrap.  Looked okay on my 21 inch monitor!  <GRIN>  New
diff's attached.

Yeah, I'm on the openssh dev list, but I wanted you to look the patches over
first for a couple of reasons.  
1)  It's always better to have a second set of eyeballs on the problem (and
patch), and what better set than yours.  I'm not aware of anyone who has
done more to get OpenSSH on Windows than you (willing to be corrected here).

2)  The OpenSSH people are used to seeing patches come from you, so I
figured it would go down easier if you sent it.  
3)  You fix things faster than they do.  I wanted to make sure you were
aware of the problem.

If you'd rather I just right to the OpenSSH dev list let me know, and I'll
quit bothering you.

Mark

> -----Original Message-----
> From: Corinna Vinschen [mailto:cygwin AT cygwin DOT com]
> Sent: Thursday, August 09, 2001 4:59 AM
> To: Mark Bradshaw
> Cc: cygwin
> Subject: Re: OpenSSH patches dealing with incorrect pathing
> 
> 
> On Wed, Aug 08, 2001 at 06:46:53PM -0400, Mark Bradshaw wrote:
> > [...]
> > As far as I can tell only ssh.c and tildexpand.c need to be 
> patched.  Ssh.c
> > is patched where it tries to create the .ssh directory, and 
> tildexpand.c is
> > patched where it expands the user's home directory (incorrectly).
> > 
> > Mark
> 
> Thanks for these patches. Unfortunately they aren't ok since you seem
> to have them pasted(?) into your mail so the patches are broken at...
> 
> > ================================================
> > diff for ssh.c
> > 
> > --- /usr/src/openssh-2.9p2-3/ssh.c	Tue Apr 17 14:14:35 2001
> > +++ ssh-new.c	Wed Aug  8 18:36:18 2001
> > @@ -680,7 +680,7 @@ main(int ac, char **av)
> >  	 * Now that we are back to our own permissions, create ~/.ssh
> >  	 * directory if it doesn\'t already exist.
> >  	 */
> > -	snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir,
> > _PATH_SSH_USER_DIR);
> > +	snprintf(buf, sizeof buf, "%.100s%s%.100s", pw->pw_dir,
> > strcmp(pw->pw_dir, "/") ? "/" : "", _PATH_SSH_USER_DIR);
> 
> ...that point and at...
> 
> >  	if (stat(buf, &st) < 0)
> >  		if (mkdir(buf, 0700) < 0)
> >  			error("Could not create directory 
> '%.200s'.", buf);
> > 
> > =================================================
> > diff for tildexpand.c
> > 
> > --- /usr/src/openssh-2.9p2-3/tildexpand.c	Thu Feb  8 21:11:25 2001
> > +++ tildexpand-new.c	Wed Aug  8 18:37:45 2001
> > @@ -67,6 +67,6 @@ tilde_expand_filename(const char *filena
> >  	if (len > MAXPATHLEN)
> >  		fatal("Home directory too long (%d > %d", len-1,
> > MAXPATHLEN-1);
> >  	expanded = xmalloc(len);
> > -	snprintf(expanded, len, "%s/%s", pw->pw_dir, cp + 1);
> > +	snprintf(expanded, len, "%s%s%s", pw->pw_dir, strcmp(pw->pw_dir,
> > "/") ? "/" : "", cp + 1);
>   
> ...that point. Please send both patches together in one single 
> attached file so that they immediately apply using `patch'.
> I will forward them to the OpenSSH developers list then.
> 
> BTW, aren't you subscribed to the openssh-unix-dev mailing list?
> I'm under the impression it could be of interest for you.
> 
> Corinna
> 
> -- 
> Corinna Vinschen                  Please, send mails 
> regarding Cygwin to
> Cygwin Developer                                
> mailto:cygwin AT cygwin DOT com
> Red Hat, Inc.
> 


------_=_NextPart_000_01C120D5.5FFA5A10
Content-Type: text/plain;
	name="diffs.txt"
Content-Disposition: attachment;
	filename="diffs.txt"

--- /usr/src/openssh-2.9p2-3/ssh.c	Tue Apr 17 14:14:35 2001
+++ ssh-new.c	Wed Aug  8 18:36:18 2001
@@ -680,7 +680,7 @@ main(int ac, char **av)
 	 * Now that we are back to our own permissions, create ~/.ssh
 	 * directory if it doesn\'t already exist.
 	 */
-	snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir, _PATH_SSH_USER_DIR);
+	snprintf(buf, sizeof buf, "%.100s%s%.100s", pw->pw_dir, strcmp(pw->pw_dir, "/") ? "/" : "", _PATH_SSH_USER_DIR);
 	if (stat(buf, &st) < 0)
 		if (mkdir(buf, 0700) < 0)
 			error("Could not create directory '%.200s'.", buf);

--- /usr/src/openssh-2.9p2-3/tildexpand.c	Thu Feb  8 21:11:25 2001
+++ tildexpand-new.c	Wed Aug  8 18:37:45 2001
@@ -67,6 +67,6 @@ tilde_expand_filename(const char *filena
 	if (len > MAXPATHLEN)
 		fatal("Home directory too long (%d > %d", len-1, MAXPATHLEN-1);
 	expanded = xmalloc(len);
-	snprintf(expanded, len, "%s/%s", pw->pw_dir, cp + 1);
+	snprintf(expanded, len, "%s%s%s", pw->pw_dir, strcmp(pw->pw_dir, "/") ? "/" : "", cp + 1);
 	return expanded;
 }

------_=_NextPart_000_01C120D5.5FFA5A10
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
------_=_NextPart_000_01C120D5.5FFA5A10--

- Raw text -


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