delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/04/13/05:24:40

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-developers-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
Message-ID: <38F59ED4.B02E9392@vinschen.de>
Date: Thu, 13 Apr 2000 12:17:56 +0200
From: Corinna Vinschen <corinna AT vinschen DOT de>
Reply-To: cygwin-developers AT sourceware DOT cygnus DOT com
X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.14 i686)
X-Accept-Language: de, en
MIME-Version: 1.0
To: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: More setup changes
References: <20000413012229 DOT A11346 AT cygnus DOT com>

Chris Faylor wrote:
> 
> I have modified setup to always try to set the write bit on the files that
> it extracts.  To do this, I had to monitor tar's output so I took the
> opportunity to build a list of files on the fly rather than reading this
> from a file.
> [...]
> Corinna, I would be interested in hearing if this version of setup
> works better for you.

Unpacking now works ok, but I have found another problem.
If you try to create the root directory to be the same as the
directory in which setup resides, tar is unable to start gzip
and the unpacking fails completely. I have used strace to find
the reason. It's due to an error in newlib/libc/posix/execvp.c.
In any case a slash is appended to the path before appending
the file name of the executable. This isn't correct if the
path is '/'.

We could fix this by either patching winsup/cinstall/setup.c:

==== ZICK ====
--- setup.c     2000/04/13 06:05:56     1.11
+++ setup.c     2000/04/13 09:02:08
@@ -302,9 +302,9 @@ recurse_dirs (const char *dir, FILE *log
 void
 setpath (const char *element)
 {
-  char *buffer = xmalloc (strlen (element) + 7);
+  char *buffer = xmalloc (strlen (element) + 9);
 
-  sprintf (buffer, "PATH=%s", element);
+  sprintf (buffer, "PATH=%s;.", element);
   putenv (buffer);
 
   xfree (buffer);
==== ZACK ====

or by patching newlib/posix/execvp.c which would be the
better solution, IMHO:

==== SCHNIPP ====
--- execvp.c    2000/02/17 19:39:47     1.1.1.1
+++ execvp.c    2000/04/13 10:10:53
@@ -73,7 +73,7 @@ _DEFUN (execvp, (file, argv),
     {
       strccpy (buf, path, PATH_DELIM);
       /* An empty entry means the current directory.  */
-      if (*buf != 0)
+      if (*buf != 0 && buf[strlen(buf) - 1] != '/')
        strcat (buf, "/");
       strcat (buf, file);
       if (execv (buf, argv) == -1 && errno != ENOENT)
==== SCHNAPP ====

Don't know, why but there are still readonly files remaining
after unpacking. As aforementioned no problem while
unpacking but that is not what you've intended, right?

Corinna

- Raw text -


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