NetBSD Problem Report #45289

From www@NetBSD.org  Wed Aug 24 11:54:15 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 0618963BED9
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 24 Aug 2011 11:54:15 +0000 (UTC)
Message-Id: <20110824115414.384E263BAC3@www.NetBSD.org>
Date: Wed, 24 Aug 2011 11:54:14 +0000 (UTC)
From: tlusty@vse.cz
Reply-To: tlusty@vse.cz
To: gnats-bugs@NetBSD.org
Subject: Using pkg_add command from pkgsrc on Solaris 10 zones
X-Send-Pr-Version: www-1.0

>Number:         45289
>Category:       pkg
>Synopsis:       Using pkg_add command from pkgsrc on Solaris 10 zones
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    agc
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 24 11:55:00 +0000 2011
>Closed-Date:    
>Last-Modified:  Sat Mar 17 12:52:19 +0000 2012
>Originator:     Zdenek Tlusty
>Release:        
>Organization:
University of Economics, Prague
>Environment:
SunOS host 5.10 Generic_144488-17 sun4v sparc SUNW,SPARC-Enterprise-T5120
>Description:
In default Solaris zones configuration are directories /lib, /platform, /usr and /sbin are inherited from global (master) zone. Non-global zones have only read-only access into these directories.
Typical instalation directory of pkgsrc is /usr/pkg or something in /usr.
There is posibility to mount another filesystem in /usr/pkg directory of non-global zone. This /usr/pkg directory is read-write.
Using current pkg_add command the mkdir_p () tries to make even the existing /usr/pkg directory. This operation failed with "Read-only filesystem" error and pkg_add fails.
The pkg_add should not try to create existing directories. The handling of EEXIST error is not enough in this case.
>How-To-Repeat:
Make /usr read-only and into directory /usr/pkg mount read-write filesystem. Try to install some packages with pkgdir /usr/pkg

>Fix:
The pkg_add should test in some way the existence of directory before try to create it.
Below is some dirty patch of pkgsrc/pkgtools/pkg_install/files/add/perform.c file. With this patch the pkg_add works fine in default Solaris zones configuration:

--- perform.c?rev=1.99  2010-12-12 14:18:38.000000000 +0100
+++ perform.c   2011-08-19 15:40:06.000000000 +0200
@@ -59,7 +59,9 @@
 #include "lib.h"
 #include "add.h"
 #include "version.h"
+#include <dirent.h>

+DIR *dir_pointer;
 struct pkg_meta {
        char *meta_contents;
        char *meta_comment;
@@ -175,11 +177,14 @@
         * Handle the easy case of direct success or
         * pre-existing directory first.
         */
-       if (mkdir(path, 0777) == 0 || errno == EEXIST)
-               return 0;
-       if (errno != ENOENT)
-               return -1;
-
+       dir_pointer = opendir (path);
+       if (dir_pointer == NULL) {
+           if (mkdir(path, 0777) == 0 || errno == EEXIST)
+                   return 0;
+           if (errno != ENOENT)
+                   return -1;
+       }
+       (void) closedir (dir_pointer);
        cur_end = p = xstrdup(path);

        for (;;) {
@@ -202,10 +207,14 @@
                 * ENOENT can only happen if something else races us,
                 * in which case we should better give up.
                 */
-               if (mkdir(p, 0777) == -1 && errno != EEXIST) {
-                       free(p);
-                       return -1;
+               dir_pointer = opendir (p);
+               if (dir_pointer == NULL) {
+                   if (mkdir(p, 0777) == -1 && errno != EEXIST) {
+                           free(p);
+                           return -1;
+                   }
                }
+               (void) closedir (dir_pointer);
                if (done)
                        break;
                *cur_end = '/';

>Release-Note:

>Audit-Trail:
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10 zones
Date: Wed, 24 Aug 2011 16:34:24 +0200

 On Wed, Aug 24, 2011 at 11:55:00AM +0000, tlusty@vse.cz wrote:
 > The pkg_add should not try to create existing directories. The handling
 > of EEXIST error is not enough in this case.

 Just to make sure:

 mkdir /usr/pkg

 fails with EROFS on Solaris if /usr/pkg already exists and the
 filesystem it is on is read-only? If yes, please fill a bug with Solaris
 first as this is a serious POSIX compliance issue.

 Joerg

From: Zdenek Tlusty <tlusty@vse.cz>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org,
	pkg-manager@netbsd.org,
	pkgsrc-bugs@netbsd.org,
	tlusty@vse.cz
Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10 zones
Date: Wed, 24 Aug 2011 17:04:33 +0200

 Yes,
 bash-4.2# mkdir /usr/pkg
 mkdir: Failed to make directory "/usr/pkg"; Read-only file system
 bash-4.2# mkdir /usr/pkg/bin
 mkdir: Failed to make directory "/usr/pkg/bin"; File exists

 Are there something like "error code reporting precedence" - so the EEXIST
 error has the precedence before EROFS in POSIX?

 BR,

 Zdenek

 Joerg Sonnenberger <joerg@britannica.bec.de> napsal dne 24.08.2011
 16:35:02:

 > The following reply was made to PR pkg/45289; it has been noted by GNATS.
 >
 > From: Joerg Sonnenberger <joerg@britannica.bec.de>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10
 zones
 > Date: Wed, 24 Aug 2011 16:34:24 +0200
 >
 >  On Wed, Aug 24, 2011 at 11:55:00AM +0000, tlusty@vse.cz wrote:
 >  > The pkg_add should not try to create existing directories. The
 handling
 >  > of EEXIST error is not enough in this case.
 >
 >  Just to make sure:
 >
 >  mkdir /usr/pkg
 >
 >  fails with EROFS on Solaris if /usr/pkg already exists and the
 >  filesystem it is on is read-only? If yes, please fill a bug with Solaris
 >  first as this is a serious POSIX compliance issue.
 >
 >  Joerg
 >

From: Zdenek Tlusty <tlusty@vse.cz>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org,
	pkg-manager@netbsd.org,
	pkgsrc-bugs@netbsd.org
Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10 zones
Date: Wed, 24 Aug 2011 23:09:06 +0200

 Hello Joerg,

 the command mkdir /usr/pkg should fail with two errors - EEXIST and EROFS.
 Regarding of POSIX XSH Section 2.3 Error Numbers
 (http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html)
  there is no precedence if more than one error occurs:

 "If more than one error occurs in processing a function call, any one of
 the possible errors may be returned, as the order of detection is
 undefined."

 The EROFS is correct error and this behaviour is POSIX compliant.

 Please, correct me if I am wrong.

 Best Regards,

 Zdenek

 Joerg Sonnenberger <joerg@britannica.bec.de> napsal dne 24.08.2011
 16:35:02:

 > The following reply was made to PR pkg/45289; it has been noted by GNATS.
 >
 > From: Joerg Sonnenberger <joerg@britannica.bec.de>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10
 zones
 > Date: Wed, 24 Aug 2011 16:34:24 +0200
 >
 >  On Wed, Aug 24, 2011 at 11:55:00AM +0000, tlusty@vse.cz wrote:
 >  > The pkg_add should not try to create existing directories. The
 handling
 >  > of EEXIST error is not enough in this case.
 >
 >  Just to make sure:
 >
 >  mkdir /usr/pkg
 >
 >  fails with EROFS on Solaris if /usr/pkg already exists and the
 >  filesystem it is on is read-only? If yes, please fill a bug with Solaris
 >  first as this is a serious POSIX compliance issue.
 >
 >  Joerg
 >

From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10 zones
Date: Fri, 26 Aug 2011 10:18:56 +0200

 On Wed, Aug 24, 2011 at 11:55:00AM +0000, tlusty@vse.cz wrote:
 > --- perform.c?rev=1.99  2010-12-12 14:18:38.000000000 +0100
 > +++ perform.c   2011-08-19 15:40:06.000000000 +0200
 > @@ -59,7 +59,9 @@
 >  #include "lib.h"
 >  #include "add.h"
 >  #include "version.h"
 > +#include <dirent.h>
 > 
 > +DIR *dir_pointer;
 >  struct pkg_meta {
 >         char *meta_contents;
 >         char *meta_comment;
 > @@ -175,11 +177,14 @@
 >          * Handle the easy case of direct success or
 >          * pre-existing directory first.
 >          */
 > -       if (mkdir(path, 0777) == 0 || errno == EEXIST)
 > -               return 0;
 > -       if (errno != ENOENT)
 > -               return -1;
 > -
 > +       dir_pointer = opendir (path);
 > +       if (dir_pointer == NULL) {
 > +           if (mkdir(path, 0777) == 0 || errno == EEXIST)
 > +                   return 0;
 > +           if (errno != ENOENT)
 > +                   return -1;
 > +       }
 > +       (void) closedir (dir_pointer);
 >         cur_end = p = xstrdup(path);
 > 
 >         for (;;) {

 I think you should only call closedir if dir_pointer is != NULL, i.e.
 move it in the if statement.
  Thomas

From: Zdenek Tlusty <tlusty@vse.cz>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org,
	pkg-manager@netbsd.org,
	pkgsrc-bugs@netbsd.org
Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10 zones
Date: Fri, 26 Aug 2011 10:26:16 +0200

 Thanks for the hint. Below is updated diff.

 BR,

 Zdenek


 --- perform.c?rev=1.99  2010-12-12 14:18:38.000000000 +0100
 +++ perform.c   2011-08-26 10:23:51.000000000 +0200
 @@ -59,7 +59,9 @@
  #include "lib.h"
  #include "add.h"
  #include "version.h"
 +#include <dirent.h>

 +DIR *dir_pointer;
  struct pkg_meta {
         char *meta_contents;
         char *meta_comment;
 @@ -175,11 +177,16 @@
          * Handle the easy case of direct success or
          * pre-existing directory first.
          */
 -       if (mkdir(path, 0777) == 0 || errno == EEXIST)
 -               return 0;
 -       if (errno != ENOENT)
 -               return -1;
 -
 +       dir_pointer = opendir (path);
 +       if (dir_pointer == NULL) {
 +           if (mkdir(path, 0777) == 0 || errno == EEXIST)
 +                   return 0;
 +           if (errno != ENOENT)
 +                   return -1;
 +       }
 +       else {
 +           (void) closedir (dir_pointer);
 +       }
         cur_end = p = xstrdup(path);

         for (;;) {
 @@ -202,9 +209,15 @@
                  * ENOENT can only happen if something else races us,
                  * in which case we should better give up.
                  */
 -               if (mkdir(p, 0777) == -1 && errno != EEXIST) {
 -                       free(p);
 -                       return -1;
 +               dir_pointer = opendir (p);
 +               if (dir_pointer == NULL) {
 +                   if (mkdir(p, 0777) == -1 && errno != EEXIST) {
 +                           free(p);
 +                           return -1;
 +                   }
 +               }
 +               else {
 +                   (void) closedir (dir_pointer);
                 }
                 if (done)
                         break;


 Thomas Klausner <wiz@NetBSD.org> napsal dne 26.08.2011 10:20:06:

 >  I think you should only call closedir if dir_pointer is != NULL, i.e.
 >  move it in the if statement.
 >   Thomas

Responsible-Changed-From-To: pkg-manager->agc
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Fri, 26 Aug 2011 08:41:43 +0000
Responsible-Changed-Why:
Over to maintainer.


From: Zdenek Tlusty <tlusty@vse.cz>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10 zones
Date: Mon, 9 Jan 2012 22:44:39 +0100

 Toto je zpráva s více částmi ve formátu MIME. 
 --=_alternative 00776EAAC1257980_=
 Content-Type: text/plain; charset="US-ASCII"

 Hello,

 will be my patch accepted or will be the bug resolved by any other way?

 BR,

 Zdenek

 Zdenek Tlusty <tlusty@vse.cz> napsal dne 26.08.2011 10:30:04:

 > Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10 
 zones
 > Date: Fri, 26 Aug 2011 10:26:16 +0200
 > 
 >  Thanks for the hint. Below is updated diff.
 > 
 >  BR,
 > 
 >  Zdenek
 > 
 > 
 >  --- perform.c?rev=1.99  2010-12-12 14:18:38.000000000 +0100
 >  +++ perform.c   2011-08-26 10:23:51.000000000 +0200
 >  @@ -59,7 +59,9 @@
 >   #include "lib.h"
 >   #include "add.h"
 >   #include "version.h"
 >  +#include <dirent.h>
 > 
 >  +DIR *dir_pointer;
 >   struct pkg_meta {
 >          char *meta_contents;
 >          char *meta_comment;
 >  @@ -175,11 +177,16 @@
 >           * Handle the easy case of direct success or
 >           * pre-existing directory first.
 >           */
 >  -       if (mkdir(path, 0777) == 0 || errno == EEXIST)
 >  -               return 0;
 >  -       if (errno != ENOENT)
 >  -               return -1;
 >  -
 >  +       dir_pointer = opendir (path);
 >  +       if (dir_pointer == NULL) {
 >  +           if (mkdir(path, 0777) == 0 || errno == EEXIST)
 >  +                   return 0;
 >  +           if (errno != ENOENT)
 >  +                   return -1;
 >  +       }
 >  +       else {
 >  +           (void) closedir (dir_pointer);
 >  +       }
 >          cur_end = p = xstrdup(path);
 > 
 >          for (;;) {
 >  @@ -202,9 +209,15 @@
 >                   * ENOENT can only happen if something else races us,
 >                   * in which case we should better give up.
 >                   */
 >  -               if (mkdir(p, 0777) == -1 && errno != EEXIST) {
 >  -                       free(p);
 >  -                       return -1;
 >  +               dir_pointer = opendir (p);
 >  +               if (dir_pointer == NULL) {
 >  +                   if (mkdir(p, 0777) == -1 && errno != EEXIST) {
 >  +                           free(p);
 >  +                           return -1;
 >  +                   }
 >  +               }
 >  +               else {
 >  +                   (void) closedir (dir_pointer);
 >                  }
 >                  if (done)
 >                          break;

 --=_alternative 00776EAAC1257980_=
 Content-Type: text/html; charset="US-ASCII"

 <font size=2 face="sans-serif">Hello,</font>
 <br>
 <br><font size=2 face="sans-serif">will be my patch accepted or will be
 the bug resolved by any other way?</font>
 <br>
 <br><font size=2 face="sans-serif">BR,</font>
 <br>
 <br><font size=2 face="sans-serif">Zdenek</font>
 <br>
 <br><font size=2>Zdenek Tlusty &lt;tlusty@vse.cz&gt; napsal dne 26.08.2011
 10:30:04:<br>
 <br>
 &gt; Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris
 10 zones<br>
 &gt; Date: Fri, 26 Aug 2011 10:26:16 +0200<br>
 &gt; <br>
 &gt; &nbsp;Thanks for the hint. Below is updated diff.<br>
 &gt; &nbsp;<br>
 &gt; &nbsp;BR,<br>
 &gt; &nbsp;<br>
 &gt; &nbsp;Zdenek<br>
 &gt; &nbsp;<br>
 &gt; &nbsp;<br>
 &gt; &nbsp;--- perform.c?rev=1.99 &nbsp;2010-12-12 14:18:38.000000000 +0100<br>
 &gt; &nbsp;+++ perform.c &nbsp; 2011-08-26 10:23:51.000000000 +0200<br>
 &gt; &nbsp;@@ -59,7 +59,9 @@<br>
 &gt; &nbsp; #include &quot;lib.h&quot;<br>
 &gt; &nbsp; #include &quot;add.h&quot;<br>
 &gt; &nbsp; #include &quot;version.h&quot;<br>
 &gt; &nbsp;+#include &lt;dirent.h&gt;<br>
 &gt; &nbsp;<br>
 &gt; &nbsp;+DIR *dir_pointer;<br>
 &gt; &nbsp; struct pkg_meta {<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;char *meta_contents;<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;char *meta_comment;<br>
 &gt; &nbsp;@@ -175,11 +177,16 @@<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * Handle the easy case of direct
 success or<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * pre-existing directory first.<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; if (mkdir(path, 0777) == 0 || errno ==
 EEXIST)<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0;<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; if (errno != ENOENT)<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return -1;<br>
 &gt; &nbsp;-<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; dir_pointer = opendir (path);<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; if (dir_pointer == NULL) {<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (mkdir(path, 0777) ==
 0 || errno == EEXIST)<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 return 0;<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (errno != ENOENT)<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 return -1;<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; }<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; else {<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (void) closedir (dir_pointer);<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; }<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cur_end = p = xstrdup(path);<br>
 &gt; &nbsp;<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for (;;) {<br>
 &gt; &nbsp;@@ -202,9 +209,15 @@<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * ENOENT
 can only happen if something else races us,<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * in
 which case we should better give up.<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (mkdir(p,
 0777) == -1 &amp;&amp; errno != EEXIST) {<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; free(p);<br>
 &gt; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; return -1;<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dir_pointer
 = opendir (p);<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (dir_pointer
 == NULL) {<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 if (mkdir(p, 0777) == -1 &amp;&amp; errno != EEXIST) {<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp; free(p);<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp; return -1;<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 }<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else {<br>
 &gt; &nbsp;+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 (void) closedir (dir_pointer);<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (done)<br>
 &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp;break;<br>
 </font>
 --=_alternative 00776EAAC1257980_=--

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/45289: Using pkg_add command from pkgsrc on Solaris 10 zones
Date: Sun, 22 Jan 2012 18:11:33 +0000

 On Mon, Jan 09, 2012 at 09:45:02PM +0000, Zdenek Tlusty wrote:
  >  Hello,
  >  
  >  will be my patch accepted or will be the bug resolved by any other way?
  >  
  >  BR,
  >  
  >  Zdenek

 It looks more or less ok to me (although I'd probably check for the
 dir existing with stat(), not opendir()) but it really wants an
 official thumbs-up or thumbs-down from the package maintainer.

 -- 
 David A. Holland
 dholland@netbsd.org

From: "Joerg Sonnenberger" <joerg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45289 CVS commit: pkgsrc/pkgtools/pkg_install/files
Date: Sat, 28 Jan 2012 12:33:05 +0000

 Module Name:	pkgsrc
 Committed By:	joerg
 Date:		Sat Jan 28 12:33:05 UTC 2012

 Modified Files:
 	pkgsrc/pkgtools/pkg_install/files/add: perform.c
 	pkgsrc/pkgtools/pkg_install/files/lib: opattern.c version.h

 Log Message:
 pkg_install-20120128:
 - Explicitly stat(2) if mkdir failed. errno detection doesn't work e.g.
 on Solaris (PR 45289)
 - Provide a stable order for package names that only differe in the base
 name, not the version number.


 To generate a diff of this commit:
 cvs rdiff -u -r1.100 -r1.101 pkgsrc/pkgtools/pkg_install/files/add/perform.c
 cvs rdiff -u -r1.5 -r1.6 pkgsrc/pkgtools/pkg_install/files/lib/opattern.c
 cvs rdiff -u -r1.162 -r1.163 pkgsrc/pkgtools/pkg_install/files/lib/version.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 17 Mar 2012 12:52:19 +0000
State-Changed-Why:
Stuff was committed; does it work for you now?


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.