summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* glnx-dirfd: Add a rewinddir() wrapperwip/smcv/rewinddirSimon McVittie2021-04-222-0/+19
| | | | | | | | This is useful in the same situations rewinddir() is. My use-case right now is to remove some of the files from a directory, then go back through the directory removing symlinks that pointed to those files. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'pr/glnx-no-chown' into 'master'Colin Walters2021-02-092-3/+7
|\ | | | | | | | | glnx_file_copy_at: Add GLNX_FILE_COPY_NOCHOWN See merge request GNOME/libglnx!22
| * glnx_file_copy_at: Add GLNX_FILE_COPY_NOCHOWNJonathan Lebon2021-02-092-3/+7
|/ | | | | | | | | | In some contexts, we may want to copy a root-owned file but we're not running as root so we can't `fchown` it. (The case I'm interested in is actually a bit more obscure than this: running in a supermin VM as root, and wanting to copy a file we created onto a 9p mount where we don't have perms to `fchown`). Add a `GLNX_FILE_COPY_NOCHOWN` to handle this case.
* macros: Fix casting for C++ compatibilityColin Walters2020-12-061-1/+1
| | | | Prep for more work on porting rpm-ostree to use cxx-rs.
* glnx_strjoina: Cast to result for C++ compatibilityColin Walters2020-11-221-1/+1
| | | | Prep for using C++ in rpm-ostree (temporarily).
* fdio: Fix compilation via C++Colin Walters2020-11-221-2/+2
| | | | | I may use https://cxx.rs/ in rpm-ostree, which means we need our dependencies' headers to build in C++ mode.
* Merge branch 'replace-increasing-mtime' into 'master'Alexander Larsson2020-11-032-9/+37
|\ | | | | | | | | Add GLNX_FILE_REPLACE_INCREASING_MTIME See merge request GNOME/libglnx!21
| * Add GLNX_FILE_REPLACE_INCREASING_MTIMEreplace-increasing-mtimeAlexander Larsson2020-11-032-9/+37
|/ | | | | | | | | | | | | | This make replaced files have a strictly increasing st_mtime. The main usecase I have for this is to ensure the summary file mtime increases because the flatpak tests are failing due to the python httpd used in the tests rely on st_mtime for the http If-Modified-Since header. For the tests this breaks all the time since we're just doing a lot of summary updates. However, I can see this accidentally happening in the wild too, so i think its proper to always ensure the new summary is "newer", even though it means it will be timestamped slightly in the future. In practice this will not happen regularly, and the times it *does* happen we really do need it.
* Merge branch 'tmpfile-dir' into 'master'Colin Walters2020-10-021-3/+6
|\ | | | | | | | | glnx-fdio: try $TMPDIR if /var/tmp doesn't exist See merge request GNOME/libglnx!20
| * glnx-fdio: use $TMPDIR if setRebecca Turner2020-10-011-33/+6
| | | | | | | | As suggested by Colin Walters.
| * glnx-fdio: try $TMPDIR if /var/tmp doesn't existRebecca Turner2020-09-231-3/+33
|/ | | | | | | | | | | | | | | | | | `glnx_open_anonymous_tmpfile` attempts to create an fd in `/var/tmp` regardless of the value of `$TMPDIR`. This is _usually_ okay, but can fail in some contexts, such as in the [NixOS][1] build environment, which doesn't have `/var` mapped at all. To avoid failing in this case, if the inner call to `glnx_open_anonymous_tmpfile_full` fails, we retrieve the value of `$TMPDIR` and try calling `glnx_open_anonymous_tmpfile_full` again with that directory instead. In the fast path (i.e. where `/var/tmp` exists), functionality is unchanged. [1]: https://nixos.org/
* Merge branch 'err-prefix-xattr' into 'master'Colin Walters2020-09-101-7/+7
|\ | | | | | | | | xattrs: Add better error prefixing See merge request GNOME/libglnx!19
| * xattrs: Add better error prefixingColin Walters2020-09-101-7/+7
|/ | | | | | | Related to https://github.com/coreos/coreos-assembler/issues/1703 This should help debug things like this in the future.
* Merge branch 'fix-wrpseudo-grammar' into 'master'Colin Walters2020-06-161-2/+2
|\ | | | | | | | | libglnx.m4: Fix grammar in help string See merge request GNOME/libglnx!17
| * libglnx.m4: Fix grammar in help stringMatthew Leeds2020-06-111-2/+2
| |
* | Merge branch 'pr/cfr-nfs' into 'master'Colin Walters2020-06-161-1/+1
|\ \ | |/ |/| | | | | glnx-fdio: handle EOPNOTSUPP for copy_file_range See merge request GNOME/libglnx!18
| * glnx-fdio: handle EOPNOTSUPP for copy_file_rangeJonathan Lebon2020-06-161-1/+1
|/ | | | | | | | | | | | | | | | When using `copy_file_range` to target a source and dest on the same NFS mount on some older kernel versions, it's possible that we can get `EOPNOTSUPP` e.g. if the NFS server doesn't support server-side copy. We hit this in the FCOS release pipeline where we run `ostree pull-local` to pull content between two repos on the same mount from inside an OpenShift cluster on top of RHEL7. Nowadays, it seems like the kernel itself falls back to a more generic version of `copy_file_range()` at least. Though to be compatible with older kernels, let's add `EOPNOTSUPP` to the list of errors we interpret as "cfr possibly available, but can't be done for this specific operation".
* Merge branch 'wip/smcv/const-struct-stat' into 'master'Simon McVittie2020-06-092-2/+2
|\ | | | | | | | | fdio: Be const-correct for struct stat See merge request GNOME/libglnx!16
| * fdio: Be const-correct for struct statSimon McVittie2020-06-032-2/+2
|/ | | | | | | | We don't modify this struct (if non-NULL), so it can be const. In particular, this is helpful if calling glnx_file_copy_at() from nftw() to implement the equivalent of `cp -a --reflink=auto`. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'readme-libgsystem' into 'master'Simon McVittie2020-06-031-1/+1
|\ | | | | | | | | README: update link to libgsystem See merge request GNOME/libglnx!15
| * README: update link to libgsystemreadme-libgsystemWill Thompson2019-12-021-1/+1
| | | | | | | | I was curious.
* | Merge branch 'auto-temp-dir-leak' into 'master'Simon McVittie2020-03-151-0/+8
|\ \ | | | | | | | | | | | | _GLNX_TEST_SCOPED_TEMP_DIR: Fix memory and fd leak See merge request GNOME/libglnx!14
| * | _GLNX_TEST_SCOPED_TEMP_DIR: Fix memory and fd leakSimon McVittie2019-11-111-0/+8
| |/ | | | | | | | | | | | | | | This doesn't really matter, since it only happens when our process is about to exit anyway, but it makes it easier to use AddressSanitizer and similar tools. Signed-off-by: Simon McVittie <smcv@collabora.com>
* | Merge branch 'auto-temp-dir-unused' into 'master'Simon McVittie2020-03-151-1/+1
|\ \ | |/ |/| | | | | _GLNX_TEST_SCOPED_TEMP_DIR: Mark variable as G_GNUC_UNUSED See merge request GNOME/libglnx!13
| * _GLNX_TEST_SCOPED_TEMP_DIR: Mark variable as G_GNUC_UNUSEDSimon McVittie2019-11-111-1/+1
|/ | | | | | | Otherwise, clang diagnoses it as unused. It is - deliberately - only allocated and cleaned up, with no other use. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'older-glibs' into 'master'Simon McVittie2019-11-114-0/+45
|\ | | | | | | | | Build successfully on GLib 2.32 See merge request GNOME/libglnx!7
| * Make tests cope with older GLibSimon McVittie2019-11-112-0/+16
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
| * backport-autocleanups: Hide autocleanups for types we don't haveSimon McVittie2019-11-111-0/+8
| | | | | | | | | | | | | | | | | | If you're building on a really old GLib, you might not have GTask, GSubprocess or g_markup_parse_context_unref(), among others. This gets libglnx compiling (and apparently working) on GLib versions as old as 2.32. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * backports: Add a backport of g_clear_pointer()Simon McVittie2019-11-112-0/+21
|/ | | | | | | This will be necessary if targeting GLib versions older than 2.34, such as GLib 2.32 in Ubuntu 12.04 and the Steam Runtime. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'testlib-automake' into 'master'Colin Walters2019-11-041-5/+7
|\ | | | | | | | | build-sys: Add libglnx-testlib.c to Automake See merge request GNOME/libglnx!12
| * build-sys: Add libglnx-testlib.c to AutomakeColin Walters2019-11-041-5/+7
|/ | | | It was introduced in a previous commit but only added to `meson.build`.
* Merge branch 'reopen-rdonly' into 'master'Colin Walters2019-11-042-2/+44
|\ | | | | | | | | fdio: Add glnx_tmpfile_reopen_rdonly() See merge request GNOME/libglnx!11
| * fdio: Add glnx_tmpfile_reopen_rdonly()Colin Walters2019-11-042-2/+44
|/ | | | For fs-verity.
* Merge branch 'meson-older-compilers' into 'master'Colin Walters2019-10-117-0/+236
|\ | | | | | | | | Add Meson build system and Gitlab-CI See merge request GNOME/libglnx!8
| * CI: Target a Fedora stable releaseSimon McVittie2019-05-131-1/+1
| | | | | | | | | | | | As suggested by @jlebon on libglnx!8. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * Make the Meson build work on older compilersSimon McVittie2019-05-101-0/+2
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
| * meson: Define HAVE_DECL_FOO to 0 if foo isn't declaredSimon McVittie2019-05-101-3/+2
| | | | | | | | | | | | | | This matches what Autotools would do, and what our header is expecting. It silences -Wundef. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * Add GitLab CIWill Thompson2019-05-021-0/+22
| | | | | | | | | | This only uses Meson because it's not straightforward to do a standalone build with the Autotools goop.
| * Run the fdio test in its own temporary directorySimon McVittie2019-05-024-1/+86
| | | | | | | | | | | | | | The temporary directory will be deleted on success, but will remain intact on failure. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * Document using this as a Meson subprojectWill Thompson2019-05-021-0/+26
| |
| * Add meson.build filesWill Thompson2019-03-282-0/+102
| |
* | Merge branch 'anonymous-tmpfile-dir' into 'master'Colin Walters2019-10-112-6/+30
|\ \ | | | | | | | | | | | | Add glnx_open_anonymous_tmpfile_full() allowing you to specify the directory See merge request GNOME/libglnx!10
| * | Add glnx_open_anonymous_tmpfile_full() allowing you to specify the directoryAlexander Larsson2019-10-092-6/+30
|/ / | | | | | | | | | | | | | | | | This is useful if you need the file to be on a particular filesystem. In particular, flatpak wants this to make tempfiles on /tmp for things we need to write during flatpak run, such as the libseccomp output fd. We've had "flatpak run" stop working in low disk situations without this, so its nice to be able to fix it.
* | Merge branch 'us-temp-failure-retry' into 'master'Colin Walters2019-09-171-0/+10
|\ \ | | | | | | | | | | | | macros: Add TEMP_FAILURE_RETRY for musl See merge request GNOME/libglnx!9
| * | macros: Add TEMP_FAILURE_RETRY for muslAlex Kiernan2019-09-091-0/+10
|/ / | | | | | | | | | | | | | | TEMP_FAILURE_RETRY is glibc specific, add a definition for musl. See https://github.com/ostreedev/ostree/issues/731 Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
* | Merge branch 'uchar' into 'master'Jonathan Lebon2019-05-131-1/+0
|\ \ | |/ |/| | | | | missing: Remove unused <uchar.h> See merge request GNOME/libglnx!6
| * missing: Remove unused <uchar.h>Simon McVittie2019-05-021-1/+0
|/ | | | | | | This doesn't exist on some very old platforms. In the original file in systemd, it was here for char32_t and char16_t, which we don't use. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'shutil-rm-rf-errprefix' into 'master'Colin Walters2018-12-071-16/+24
|\ | | | | | | | | shutil: Prefix error with path in rm_rf() See merge request GNOME/libglnx!4
| * shutil: Prefix error with path in rm_rf()Colin Walters2018-12-071-16/+24
|/ | | | | | | | First, let's ensure the filename is prefixed consistently. Second, add the entrypoint as a prefix when recursing. This is best practice to help debugging. Motivated by https://discussion.fedoraproject.org/t/boot-partition-of-silverblue-is-without-space/771/9
* README: Update ContributingColin Walters2018-11-301-5/+3
|