Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package jnr-posix for openSUSE:Factory checked in at 2023-04-27 20:01:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/jnr-posix (Old) and /work/SRC/openSUSE:Factory/.jnr-posix.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "jnr-posix" Thu Apr 27 20:01:19 2023 rev:3 rq:1083178 version:3.1.16 Changes: -------- --- /work/SRC/openSUSE:Factory/jnr-posix/jnr-posix.changes 2021-07-10 00:03:05.726771964 +0200 +++ /work/SRC/openSUSE:Factory/.jnr-posix.new.1533/jnr-posix.changes 2023-04-27 20:02:26.254455690 +0200 @@ -1,0 +2,6 @@ +Sun Dec 18 06:36:29 UTC 2022 - Anton Shvetz <shvetz.an...@gmail.com> + +- Update to v3.1.16 + * No changelog provided by upstream + +------------------------------------------------------------------- @@ -4,0 +11 @@ + * No changelog provided by upstream Old: ---- jnr-posix-3.1.7.tar.gz New: ---- jnr-posix-3.1.16.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ jnr-posix.spec ++++++ --- /var/tmp/diff_new_pack.zRQvzD/_old 2023-04-27 20:02:27.186461169 +0200 +++ /var/tmp/diff_new_pack.zRQvzD/_new 2023-04-27 20:02:27.238461475 +0200 @@ -1,7 +1,7 @@ # -# spec file for package jnr-posix +# spec file # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %global cluster jnr Name: %{cluster}-posix -Version: 3.1.7 +Version: 3.1.16 Release: 0 Summary: Java Posix layer License: CPL-1.0 OR GPL-2.0-or-later OR LGPL-2.1-or-later ++++++ jnr-posix-3.1.7.tar.gz -> jnr-posix-3.1.16.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jnr-posix-jnr-posix-3.1.7/pom.xml new/jnr-posix-jnr-posix-3.1.16/pom.xml --- old/jnr-posix-jnr-posix-3.1.7/pom.xml 2021-06-04 21:57:41.000000000 +0200 +++ new/jnr-posix-jnr-posix-3.1.16/pom.xml 2022-11-15 19:29:31.000000000 +0100 @@ -10,7 +10,7 @@ <groupId>com.github.jnr</groupId> <artifactId>jnr-posix</artifactId> <packaging>jar</packaging> - <version>3.1.7</version> + <version>3.1.16</version> <name>jnr-posix</name> <description> Common cross-project/cross-platform POSIX APIs @@ -79,12 +79,12 @@ <dependency> <groupId>com.github.jnr</groupId> <artifactId>jnr-ffi</artifactId> - <version>2.2.4</version> + <version>2.2.13</version> </dependency> <dependency> <groupId>com.github.jnr</groupId> <artifactId>jnr-constants</artifactId> - <version>0.10.2</version> + <version>0.10.4</version> </dependency> </dependencies> @@ -178,7 +178,6 @@ <configuration> <forkCount>2</forkCount> <reuseForks>false</reuseForks> - <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine> <includes> <include>**/*Test.java</include> </includes> @@ -202,7 +201,6 @@ <configuration> <forkCount>2</forkCount> <reuseForks>false</reuseForks> - <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine> </configuration> </plugin> </plugins> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jnr-posix-jnr-posix-3.1.7/src/main/java/jnr/posix/LibC.java new/jnr-posix-jnr-posix-3.1.16/src/main/java/jnr/posix/LibC.java --- old/jnr-posix-jnr-posix-3.1.7/src/main/java/jnr/posix/LibC.java 2021-06-04 21:57:41.000000000 +0200 +++ new/jnr-posix-jnr-posix-3.1.16/src/main/java/jnr/posix/LibC.java 2022-11-15 19:29:31.000000000 +0100 @@ -85,10 +85,14 @@ int dup(int fd); int dup2(int oldFd, int newFd); + @Variadic(fixedCount = 2) int fcntl(int fd, int fnctl, Flock arg); + @Variadic(fixedCount = 2) int fcntl(int fd, int fnctl, Pointer arg); + @Variadic(fixedCount = 2) int fcntl(int fd, int fnctl); - int fcntl(int fd, int fnctl, int arg); + @Variadic(fixedCount = 2) + int fcntl(int fd, int fnctl, @u_int64_t int arg); @Deprecated int fcntl(int fd, int fnctl, int... arg); int access(CharSequence path, int amode); @@ -164,7 +168,8 @@ int flock(int fd, int mode); int unlink(CharSequence path); - int open(CharSequence path, int flags, int perm); + @Variadic(fixedCount = 2) + int open(CharSequence path, int flags, @u_int32_t int perm); int pipe(@Out int[] fds); int truncate(CharSequence path, long length); int ftruncate(int fd, long offset); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jnr-posix-jnr-posix-3.1.7/src/main/java/jnr/posix/MacOSFileStat64Inode.java new/jnr-posix-jnr-posix-3.1.16/src/main/java/jnr/posix/MacOSFileStat64Inode.java --- old/jnr-posix-jnr-posix-3.1.7/src/main/java/jnr/posix/MacOSFileStat64Inode.java 1970-01-01 01:00:00.000000000 +0100 +++ new/jnr-posix-jnr-posix-3.1.16/src/main/java/jnr/posix/MacOSFileStat64Inode.java 2022-11-15 19:29:31.000000000 +0100 @@ -0,0 +1,144 @@ +/***** BEGIN LICENSE BLOCK ***** + * Version: EPL 2.0/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Eclipse Public + * License Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.eclipse.org/legal/cpl-v10.html + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the CPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the CPL, the GPL or the LGPL. + ***** END LICENSE BLOCK *****/ +/** + * $Id: $ + */ + +package jnr.posix; + +import jnr.ffi.StructLayout; + +/** + * An alternate stat layout when running with _DARWIN_FEATURE_64_BIT_INODE, which appears to be the default on M1. + */ +public final class MacOSFileStat64Inode extends BaseFileStat implements NanosecondFileStat { + public static class Layout64Inode extends StructLayout { + + public Layout64Inode(jnr.ffi.Runtime runtime) { + super(runtime); + } + + public final class time_t extends SignedLong { + } + public final Signed32 st_dev = new Signed32(); + public final Signed16 st_mode = new Signed16(); + public final Signed16 st_nlink = new Signed16(); + public final Signed64 st_ino = new Signed64(); + public final Signed32 st_uid = new Signed32(); + public final Signed32 st_gid = new Signed32(); + public final Signed32 st_rdev = new Signed32(); + public final time_t st_atime = new time_t(); + public final SignedLong st_atimensec = new SignedLong(); + public final time_t st_mtime = new time_t(); + public final SignedLong st_mtimensec = new SignedLong(); + public final time_t st_ctime = new time_t(); + public final SignedLong st_ctimensec = new SignedLong(); + public final time_t st_birthtime = new time_t(); + public final SignedLong st_birthtimensec = new SignedLong(); + public final Signed64 st_size = new Signed64(); + public final Signed64 st_blocks = new Signed64(); + public final Signed32 st_blksize = new Signed32(); + public final Signed32 st_flags = new Signed32(); + public final Signed32 st_gen = new Signed32(); + public final Signed32 st_lspare = new Signed32(); + public final Signed64 st_qspare0 = new Signed64(); + public final Signed64 st_qspare1 = new Signed64(); + } + private static final Layout64Inode layout = new Layout64Inode(jnr.ffi.Runtime.getSystemRuntime()); + + public MacOSFileStat64Inode(MacOSPOSIX posix) { + super(posix, layout); + } + + public long atime() { + return layout.st_atime.get(memory); + } + + public long blocks() { + return layout.st_blocks.get(memory); + } + + public long blockSize() { + return layout.st_blksize.get(memory); + } + + public long ctime() { + return layout.st_ctime.get(memory); + } + + public long dev() { + return layout.st_dev.get(memory); + } + + public int gid() { + return layout.st_gid.get(memory); + } + + public long ino() { + return layout.st_ino.get(memory); + } + + public int mode() { + return layout.st_mode.get(memory) & 0xffff; + } + + public long mtime() { + return layout.st_mtime.get(memory); + } + + public int nlink() { + return layout.st_nlink.get(memory); + } + + public long rdev() { + return layout.st_rdev.get(memory); + } + + public long st_size() { + return layout.st_size.get(memory); + } + + public int uid() { + return layout.st_uid.get(memory); + } + + @Override + public long aTimeNanoSecs() { + return layout.st_atimensec.get(memory); + } + + @Override + public long cTimeNanoSecs() { + return layout.st_ctimensec.get(memory); + } + + @Override + public long mTimeNanoSecs() { + return layout.st_mtimensec.get(memory); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jnr-posix-jnr-posix-3.1.7/src/main/java/jnr/posix/MacOSPOSIX.java new/jnr-posix-jnr-posix-3.1.16/src/main/java/jnr/posix/MacOSPOSIX.java --- old/jnr-posix-jnr-posix-3.1.7/src/main/java/jnr/posix/MacOSPOSIX.java 2021-06-04 21:57:41.000000000 +0200 +++ new/jnr-posix-jnr-posix-3.1.16/src/main/java/jnr/posix/MacOSPOSIX.java 2022-11-15 19:29:31.000000000 +0100 @@ -21,6 +21,10 @@ } public FileStat allocateStat() { + if (Platform.getNativePlatform().getCPU() == Platform.CPU.AARCH64) { + return new MacOSFileStat64Inode(this); + } + return new MacOSFileStat(this); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jnr-posix-jnr-posix-3.1.7/src/main/java/jnr/posix/SpawnFileAction.java new/jnr-posix-jnr-posix-3.1.16/src/main/java/jnr/posix/SpawnFileAction.java --- old/jnr-posix-jnr-posix-3.1.7/src/main/java/jnr/posix/SpawnFileAction.java 2021-06-04 21:57:41.000000000 +0200 +++ new/jnr-posix-jnr-posix-3.1.16/src/main/java/jnr/posix/SpawnFileAction.java 2022-11-15 19:29:31.000000000 +0100 @@ -2,6 +2,11 @@ import jnr.ffi.Pointer; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.Charset; +import java.nio.charset.CharsetEncoder; + public abstract class SpawnFileAction { abstract boolean act(POSIX posix, Pointer nativeFileActions); @@ -38,16 +43,44 @@ final String path; final int fd; final int flags, mode; + final ByteBuffer nativePath; public Open(String path, int fd, int flags, int mode) { this.path = path; this.fd = fd; this.flags = flags; this.mode = mode; + this.nativePath = defensiveCopy(path); + } + + private ByteBuffer defensiveCopy(String path) { + /* + This logic allocates a direct ByteBuffer to use for the path in order to work around systems that have not + patched CVE-2014-4043, in which older glibc versions do not make a defensive copy of the file path passed to + posix_spawn_file_actions_addopen. The buffer may be freed by the caller before it can be used in an + eventual posix_spawn call. + + See https://bugzilla.redhat.com/show_bug.cgi?id=1983750 for a RHEL version of this issue. + */ + + // determine encoded byte array length + CharsetEncoder encoder = Charset.defaultCharset().newEncoder(); + int bpc = (int) encoder.maxBytesPerChar(); + int size = (path.length() + 1) * bpc; + + // transcode to native buffer + ByteBuffer nativePath = ByteBuffer.allocateDirect(size); + encoder.encode(CharBuffer.wrap(path), nativePath, true); + nativePath.flip(); + + // null terminate + nativePath.limit(nativePath.limit() + bpc); + + return nativePath; } final boolean act(POSIX posix, Pointer nativeFileActions) { - return ((UnixLibC) posix.libc()).posix_spawn_file_actions_addopen(nativeFileActions, fd, path, flags, mode) == 0; + return ((UnixLibC) posix.libc()).posix_spawn_file_actions_addopen(nativeFileActions, fd, nativePath, flags, mode) == 0; } public String toString() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jnr-posix-jnr-posix-3.1.7/src/main/java/jnr/posix/UnixLibC.java new/jnr-posix-jnr-posix-3.1.16/src/main/java/jnr/posix/UnixLibC.java --- old/jnr-posix-jnr-posix-3.1.7/src/main/java/jnr/posix/UnixLibC.java 2021-06-04 21:57:41.000000000 +0200 +++ new/jnr-posix-jnr-posix-3.1.16/src/main/java/jnr/posix/UnixLibC.java 2022-11-15 19:29:31.000000000 +0100 @@ -1,6 +1,7 @@ package jnr.posix; import jnr.ffi.Pointer; +import jnr.ffi.annotations.Direct; import jnr.ffi.annotations.In; import jnr.ffi.annotations.Out; import jnr.ffi.byref.ByReference; @@ -9,6 +10,8 @@ import jnr.ffi.byref.ShortByReference; import jnr.ffi.types.pid_t; +import java.nio.ByteBuffer; + public interface UnixLibC extends LibC { public int posix_spawn(@Out ByReference pid, @In CharSequence path, @In Pointer fileActions, @In Pointer attr, @In CharSequence[] argv, @In CharSequence[] envp); @@ -19,8 +22,15 @@ public int posix_spawn_file_actions_init(Pointer fileActions); public int posix_spawn_file_actions_destroy(Pointer fileActions); public int posix_spawn_file_actions_addclose(Pointer fileActions, int filedes); + + /** + * @deprecated due to CVE-2014-4043 (https://bugzilla.redhat.com/show_bug.cgi?id=1983750) + */ + @Deprecated public int posix_spawn_file_actions_addopen(Pointer fileActions, int filedes, CharSequence path, int oflag, int mode); + public int posix_spawn_file_actions_addopen(Pointer fileActions, int filedes, @Direct ByteBuffer path, + int oflag, int mode); public int posix_spawn_file_actions_adddup2(Pointer fileActions, int filedes, int newfiledes); public int posix_spawnattr_init(Pointer attr); public int posix_spawnattr_destroy(Pointer attr); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jnr-posix-jnr-posix-3.1.7/src/test/java/jnr/posix/FileTest.java new/jnr-posix-jnr-posix-3.1.16/src/test/java/jnr/posix/FileTest.java --- old/jnr-posix-jnr-posix-3.1.7/src/test/java/jnr/posix/FileTest.java 2021-06-04 21:57:41.000000000 +0200 +++ new/jnr-posix-jnr-posix-3.1.16/src/test/java/jnr/posix/FileTest.java 2022-11-15 19:29:31.000000000 +0100 @@ -380,6 +380,15 @@ result = posix.close(fd); assertEquals(-1, result); + + fd = posix.open("jnr-posix-filetest.txt", OpenFlags.O_CREAT.intValue() | OpenFlags.O_RDWR.intValue(), 0600); + + assertEquals(0600, posix.stat("jnr-posix-filetest.txt").mode() & 0777); + + result = posix.close(fd); + assertEquals(0, result); + + new File("jnr-posix-filetest.txt").delete(); } @Test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jnr-posix-jnr-posix-3.1.7/src/test/java/jnr/posix/windows/WindowsFileTest.java new/jnr-posix-jnr-posix-3.1.16/src/test/java/jnr/posix/windows/WindowsFileTest.java --- old/jnr-posix-jnr-posix-3.1.7/src/test/java/jnr/posix/windows/WindowsFileTest.java 2021-06-04 21:57:41.000000000 +0200 +++ new/jnr-posix-jnr-posix-3.1.16/src/test/java/jnr/posix/windows/WindowsFileTest.java 2022-11-15 19:29:31.000000000 +0100 @@ -2,7 +2,8 @@ import java.io.File; import java.io.IOException; -import java.io.RandomAccessFile; +import java.io.RandomAccessFile; +import java.nio.file.Files; import java.text.NumberFormat; import jnr.posix.DummyPOSIXHandler; import jnr.posix.FileStat; @@ -15,8 +16,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - +import static org.junit.Assert.assertTrue; + public class WindowsFileTest { private static POSIX posix; @@ -52,9 +53,7 @@ // FIXME: This is a broken method since it does not delete any of the generated dirs. private static final String DIR_NAME = "0123456789"; private Pair makeLongPath() throws IOException { - File tmp = File.createTempFile("temp", Long.toHexString(System.nanoTime())); - - if (!(tmp.delete() && tmp.mkdir())) throw new IOException("Could not make a long path"); + File tmp = Files.createTempDirectory("temp" + Long.toHexString(System.nanoTime())).toFile(); StringBuilder buf = new StringBuilder(DIR_NAME); for (int i = 0; i < 30; i++) {