summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Release 2015.1v2015.1Colin Walters2015-01-081-1/+1
|
* fileutils: Consistently use O_CLOEXECColin Walters2015-01-071-3/+3
| | | | For the standard thread+fork safety reasons.
* libgsystem: Add gs_fd_get_all_xattrsColin Walters2015-01-072-5/+97
| | | | | This is a file-descriptor variant which is useful for reading from directories and regular files (it can't work on symlinks).
* Release 2014.3v2014.3Colin Walters2014-12-181-1/+1
|
* Port internal users to new gs_set_error_from_errno()Colin Walters2014-12-173-76/+38
| | | | This is kind of long overdue...
* gsystem-errors.h: Add gs_set_error_from_errno()Colin Walters2014-12-174-0/+115
| | | | This is a long overdue move of this function to public API.
* localalloc: Add gs_fd_close cleanupColin Walters2014-12-172-0/+21
| | | | | Now that we're encouraging use of openat(), fds are a lot more prevalent.
* shutil: Change rm_rf() to use new GSDirFdIterator, and add *at variantColin Walters2014-12-172-73/+66
| | | | | This noticeably cleans up the rm_rf() code. And also it now becomes easy add a gs_shutil_rm_rf_at() variant.
* fileutil: Add new API to iterate over a directory with *at system callsColin Walters2014-12-172-0/+116
| | | | | | | | | | | Using the GFileEnumerator doesn't allow using the *at system calls such as unlinkat() very easily. These system calls are both more performant (no need to traverse paths repeatedly) and more secure (assuming an attacker has write access to an intervening path). Currently, this exposes the Unix "struct dirent*" which means it's not available to introspection, but a future API addition could add a binding to create a GFileInfo*.
* fsutils: Add two small APIs for opendirat()Colin Walters2014-12-172-0/+54
| | | | | | | | We already had gs_file_open_dir_fd, but it didn't support O_NOFOLLOW, which is quite useful. Also add a raw function wrapping the core bits we need to opendir(), also taking a follow boolean.
* tests: Add a localalloc testColin Walters2014-12-172-0/+44
|
* localalloc: Define a #define for gs_unref_keyfileColin Walters2014-12-171-1/+8
| | | | This got missed before.
* localalloc: Clean up header fileColin Walters2014-12-171-15/+14
| | | | Associate each cleanup with its #define, it's just obviously saner.
* tests: Add more shutil testsColin Walters2014-12-171-0/+125
|
* tap-test: Run each test in a clean temporary directoryColin Walters2014-12-171-2/+10
| | | | This matches the https://wiki.gnome.org/GnomeGoals/InstalledTests spec.
* Import test infrastructure from json-glib, add a test caseColin Walters2014-12-179-2/+913
|
* Fix typoGiuseppe Scrivano2014-11-201-1/+1
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* subprocess: Fix a potential GCancellable leakPhilip Withnall2014-10-271-0/+1
|
* doap category coreOlav Vitters2014-07-301-0/+1
|
* fileutil: avoid using PATH_MAXAndreas Henriksson2014-07-151-3/+8
| | | | | Use the dynamically allocated buffer returned by realpath instead of using PATH_MAX which is not defined on platforms like Hurd.
* localalloc: add gs_free_slistThomas Haller2014-07-151-0/+10
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* localalloc: add gs_free_listThomas Haller2014-07-151-0/+7
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* local-alloc: Define cleanup functions for GKeyFile and GListColin Walters2014-06-041-0/+2
| | | | See https://github.com/hughsie/libhif/pull/2
* fileutil: Add API to retrieve xattrs relative to a directory fdColin Walters2014-04-292-28/+57
| | | | | This is the only safe way to get xattrs for a symlink relative to a dirfd.
* Release 2014.2v2014.2Colin Walters2014-04-011-1/+1
|
* fileutil: Consistently prefix errno with system callColin Walters2014-04-011-31/+25
| | | | For file operations, it's relevant.
* fileutils: error-prefix both xattr code pathsColin Walters2014-03-071-1/+2
| | | | | | | We had a g_prefix_error() for the lsetxattr() path, but not fsetxattr(). Add one for the latter, and change the former to not use the pathname because we always go through /proc/self/fd so it won't be useful to show.
* fileutils: Add gs_file_open_dir_fd_at()Colin Walters2014-02-272-0/+34
| | | | | This will be used in the OSTree checkout code, where we want to mkdir() and then open it.
* fileutil: Add API to set xattrs of a filename relative to a dir fdColin Walters2014-02-262-19/+49
| | | | This is a Linux-specific way to work around the missing lsetxattrat().
* shutil: Ignore EPERM/ENOTSUP errors while copying xattrs by defaultColin Walters2014-02-111-2/+16
| | | | | Unprivileged users won't be able to copy e.g. security.selinux; let's ignore this by default, the same way coreutils does.
* packaging: Ensure we require libsystemd-journalColin Walters2014-02-091-1/+2
|
* Fix systemd journal detectionColin Walters2014-02-081-1/+4
|
* Rework to be an installed libraryv2014.1Colin Walters2014-02-0626-22/+351
| | | | See https://mail.gnome.org/archives/desktop-devel-list/2014-February/msg00028.html
* Include gsystem-glib-compat.h for compatibility with GLib 2.32Jiří Klimeš2014-01-161-0/+1
| | | | | | Needed for g_clear_pointer(). Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
* COPYING: Update to latest FSF with current addressColin Walters2014-01-161-10/+9
| | | | Hooray for rpmlint.
* console: Print a newline when starting a status line the first timeColin Walters2014-01-151-1/+1
| | | | This ensures we're not overwriting any earlier output.
* fileutil: Squash some unused-variable etc. warnings without CONFIG_XATTRColin Walters2014-01-031-29/+47
| | | | | A bit tricky; we have to move the implementation into an internal helper.
* README: Note where to report bugsColin Walters2013-12-081-0/+3
|
* Only use fdatasync() on LinuxRyan Lortie2013-12-081-4/+10
| | | | | | This function is not universally available, and since we don't have our own autoconf script to check for it, just assume that we have it iff we're on Linux.
* Import xattr code from OSTree, use it to make gs_shutil_cp_a() copy xattrsColin Walters2013-11-283-90/+425
| | | | | | | | | | | | | | | | | | | | | For SELinux, it's crucial that we actually copy the "security.selinux" xattr which provides the security context. the "cp_a" name kind of strongly implies that we do what coreutils "cp -a" does, and this patch moves us a lot closer to what it says on the tin. Concretely, we now match directory modes (and ownership), and we copy all xattrs for directories. We're not (yet) copying xattrs for files, but sadly this is a GLib bug. This patch will allow OSTree to simply use gs_shutil_cp_a() for merging configuration. Still TODO: * Timestamps https://bugzilla.gnome.org/show_bug.cgi?id=711058
* GSSubprocess: remove unnecessary NULL check (trivial)Thomas Haller2013-11-061-2/+1
| | | | | | | | | | | This fixes a warning found during Coverity scan. Error: REVERSE_INULL (CWE-476): [#def5] libgsystem/gsystem-subprocess.c:949: deref_ptr_in_call: Dereferencing pointer "context". libgsystem/gsystem-subprocess-context.c:330:3: deref_parm: Directly dereferencing parameter "self". libgsystem/gsystem-subprocess.c:960: check_after_deref: Null-checking "context" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Signed-off-by: Thomas Haller <thaller@redhat.com>
* shutil: Make gs_shutil_cp_a copy ownership as wellSjoerd Simons2013-11-031-1/+11
| | | | | | | | Like cp -a gs_shutil_cp_a should really copy all directory metadata. This adds support for at least copying the ownership metadata (user/group). https://bugzilla.gnome.org/show_bug.cgi?id=711057
* file-utils: fix wrong condition in open_nointr (open returns -1 on error)Thomas Haller2013-10-311-1/+1
| | | | | | This error was found by running Coverity. Signed-off-by: Thomas Haller <thaller@redhat.com>
* file-utils: Don't leaking fd on error path in gs_file_create()Thomas Haller2013-10-311-0/+1
| | | | | | This error was found by running Coverity. Signed-off-by: Thomas Haller <thaller@redhat.com>
* file-utils: gs_file_open_in_tmpdir_at did never retryThomas Haller2013-10-311-1/+2
| | | | | | | | | | In case of creating an existing file name, gs_file_open_in_tmpdir_at did not retry and failed to create the temporary file (while signalling success). This error was found by running Coverity. Signed-off-by: Thomas Haller <thaller@redhat.com>
* localalloc: Declare the cleanup functions inline in the headerChristian Persch2013-10-232-96/+26
| | | | | This enables gcc with -Wuninitialized to warn if the cleanup function is used on an uninitialised variable.
* Fix signed/unsigned comparision warningsChristian Persch2013-10-213-5/+5
|
* localalloc: Add gs_free_errorChristian Persch2013-10-212-0/+14
|
* Fix introspection warningsJasper St. Pierre2013-10-092-4/+4
|
* file-utils: Rename a functionJasper St. Pierre2013-10-092-7/+7
| | | | The proper prefix is gsystem_, not gs_