pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: pkgsrc/pkgtools/pkg_install/files/add



Please revert this immediately. We are gearing up for 2024Q4, changes like this should at least be discussed on tech-pkg@ in the first instance, and definitely require approval as per the rules already posted.

This will 100% break the build on at least illumos, given the lack of O_DIRECTORY.

* On 2024-12-07 at 13:20 GMT, Martin Husemann wrote:

Module Name:    pkgsrc
Committed By:   martin
Date:           Sat Dec  7 13:20:14 UTC 2024

Modified Files:
        pkgsrc/pkgtools/pkg_install/files/add: perform.c

Log Message:
PR 58809: save and restore current working directory when installing
libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 pkgsrc/pkgtools/pkg_install/files/add/perform.c

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


Modified files:

Index: pkgsrc/pkgtools/pkg_install/files/add/perform.c
diff -u pkgsrc/pkgtools/pkg_install/files/add/perform.c:1.126 pkgsrc/pkgtools/pkg_install/files/add/perform.c:1.127
--- pkgsrc/pkgtools/pkg_install/files/add/perform.c:1.126       Fri Nov  1 11:26:46 2024
+++ pkgsrc/pkgtools/pkg_install/files/add/perform.c     Sat Dec  7 13:20:14 2024
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.126 2024/11/01 11:26:46 riastradh Exp $  */
+/*     $NetBSD: perform.c,v 1.127 2024/12/07 13:20:14 martin Exp $     */
#if HAVE_CONFIG_H
#include "config.h"
#endif
@@ -6,7 +6,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: perform.c,v 1.126 2024/11/01 11:26:46 riastradh Exp $");
+__RCSID("$NetBSD: perform.c,v 1.127 2024/12/07 13:20:14 martin Exp $");

/*-
 * Copyright (c) 2003 Grant Beattie <grant%NetBSD.org@localhost>
@@ -693,6 +693,7 @@ extract_files(struct pkg_task *pkg)
        plist_t *p;
        const char *last_file;
        char *fullpath;
+       int workdir;

        if (Fake)
                return 0;
@@ -707,6 +708,12 @@ extract_files(struct pkg_task *pkg)
                return -1;
        }

+       workdir = open(".", O_RDONLY|O_CLOEXEC|O_DIRECTORY);
+       if (workdir == -1) {
+               warn("Can't open current working directory");
+               return -1;
+       }
+
        if (chdir(pkg->install_prefix) == -1) {
                warn("Can't change into prefix: %s", pkg->install_prefix);
                return -1;
@@ -833,6 +840,9 @@ out:
                pkgdb_close();
        archive_write_free(writer);

+       fchdir(workdir);
+       close(workdir);
+
        return r;
}




--
Jonathan Perkin   -   mnx.io   -   pkgsrc.smartos.org
Open Source Complete Cloud   www.tritondatacenter.com



Home | Main Index | Thread Index | Old Index