On Wed, May 20, 2015 at 3:43 AM, Yclept Nemo <[email protected]> wrote:
> * This is either related to or identical and fixed by the following > bug-report (2015-02-24): > * https://sourceware.org/bugzilla/show_bug.cgi?id=17523 > Confirmed, it's the same bug. This is fixed in upstream glibc by the following commit, and will hopefully be part of glibc 2.22: 65f6f938cd562a614a68e15d0581a34b177ec29d Author: Eric Rannaud <[email protected]> Date: Tue Feb 24 13:12:26 2015 +0530 linux: open and openat ignore 'mode' with O_TMPFILE in flags Details: ran the following script against two glibc versions, with/without the above commit: $ cat test.sh #!/usr/bin/env bash exe_prefix="/path/to/.../glibc/test.open" glibc_pre="/path/to/.../glibc/glibc.pre/glibc.build" glibc_post="/path/to/.../glibc/glibc.post/glibc.build" test_glibc() { local builddir="$1" local exe="$2" local cpp="${2}.cpp" # Clean rm -f "$exe" # Status printf "Testing against: \"%s\"\n" "$builddir" # Build g++ \ -Wl,-rpath=${builddir}:\ "${builddir}":\ "${builddir}"/math:\ "${builddir}"/elf:\ "${builddir}"/dlfcn:\ "${builddir}"/nss:\ "${builddir}"/nis:\ "${builddir}"/rt:\ "${builddir}"/resolv:\ "${builddir}"/crypt:\ "${builddir}"/nptl \ -Wl,--dynamic-linker=${builddir}/elf/ld-linux.so.2 \ -o "$exe" "$cpp" # Run ( cd "$builddir" GCONV_PATH="${builddir}"/iconvdata \ LOCPATH="${builddir}"/localedata \ LC_ALL=C \ "${builddir}"/elf/ld-linux.so.2 --library-path \ "${builddir}":\ "${builddir}"/math:\ "${builddir}"/elf:\ "${builddir}"/dlfcn:\ "${builddir}"/nss:\ "${builddir}"/nis:\ "${builddir}"/rt:\ "${builddir}"/resolv:\ "${builddir}"/crypt:\ "${builddir}"/nptl \ "$exe" if (($?)); then printf "Result: fail\n" else printf "Result: pass\n" fi ) } test_glibc "$glibc_pre" "$exe_prefix" printf "\n" test_glibc "$glibc_post" "$exe_prefix" $ cat test.open.cpp #define _FILE_OFFSET_BITS 64 #include <fcntl.h> #include <limits.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <stdio.h> bool test_open(){ struct stat statbuf; int fd; int mode_target = 0764; int mode_actual; if ((fd = open(".", O_TMPFILE|O_WRONLY, mode_target)) < 0) { printf("open() failed\n"); return false; } if (fstat(fd, &statbuf) < 0) { printf("fstat() failed\n"); return false; } if (close(fd) < 0) { printf("close() failed\n"); return false; } mode_actual = statbuf.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO); printf("Resulting mode: %o\n", mode_actual); if (mode_actual != mode_target) return false; else return true; } int main(){ return !test_open(); }
_______________________________________________ mpd-devel mailing list [email protected] http://mailman.blarg.de/listinfo/mpd-devel
