- Jul 11, 2018
-
-
Colin Walters authored
glibc added it upstream: https://sourceware.org/git/?p=glibc.git;a=commit;h=d6da5cb6a8e0e8a9ce92b7d951a254cf325248d7 But we need the right header. Ref: https://github.com/flatpak/flatpak/issues/1890
-
- Feb 19, 2018
-
-
Aurelien Jarno authored
glibc 2.27 added support for memfd_create. Unfortunately flatpak-builder, or rather the included libglnx library, also has such a function to wrap the corresponding syscall. It correctly tries to detect it in the configure script to disabled the wrapper in case glibc provides it. However it doesn't work due to a missing include. Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890722
-
- Nov 02, 2017
-
-
Will Thompson authored
Without this, including glnx-missing-syscall.h raises this warning: ../ext/libglnx/glnx-missing-syscall.h:121:6: warning: "HAVE_DECL_COPY_FILE_RANGE" is not defined [-Wundef] #if !HAVE_DECL_COPY_FILE_RANGE ^~~~~~~~~~~~~~~~~~~~~~~~~
-
- Oct 01, 2017
-
-
Colin Walters authored
Planning to use memfd_create() in flatpak and rpm-ostree, which both use bubblewrap, and want to pass read-only data via file descriptor to the container. Passing via `O_TMPFILE` requires `O_RDWR` (read and write), and passing via a pipe would require buffering. The systemd `missing.h` has grown enormously; I only cherry-picked the bits for memfd.
-
- Oct 05, 2016
-
-
Colin Walters authored
See https://mail.gnome.org/archives/ostree-list/2016-October/msg00003.html Basically https://github.com/wrpseudo/pseudo doesn't implement newer APIs like renameat2() and O_TMPFILE, so on the host side (as potentially opposed to the target system) we want to be able to disable them.
-
- Aug 03, 2016
-
-
Colin Walters authored
Some systems have bugs with it, so let's allow downstreams to easily disable it. https://bugzilla.gnome.org/show_bug.cgi?id=769453 https://github.com/ostreedev/ostree/issues/421
-
- Jul 01, 2016
-
-
Colin Walters authored
We had a bug previously where we failed to clean up a temporary file in an error path. This is a classic case where the new `O_TMPFILE` API in Linux is nicer. To implement this, as usual we start with some original bits from systemd. But in this case I ended up having to heavily modify it because systemd doesn't support "link into place and overwrite". They don't actually use their tempfile code much at all in fact - as far as I can tell, just in the coredump code. Whereas in many apps, ostree included, a very common use case is atomically updating an existing file, which is `glnx_file_replace_contents_at()`, including subtleties like doing an `fdatasync()` if the file already existed. Implementing this then is slightly weird since we need to link() the file into place, then rename() after. It's still better though because if we e.g. hit `ENOSPC` halfway through, we'll clean up the file automatically. We still do keep the mode where we error out if the file exists. Finally, the ostree core though does have a more unusual case where we want to ignore EEXIST (allow concurrent object writers), so add support for that now. Note: One really confusing bug I had here was that `O_TMPFILE` ignores the provided mode, and this caused ostree to write refs that weren't world readable. Rework things so we always call `fchmod()`, but as a consequence we're no longer honoring umask in the default case. I doubt anyone will care, and if they do we should probably fix ostree to consistently use a mode inherited from the repo or something.
-