summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* docs: Fix GISCAN warningsSjoerd Simons2015-11-203-3/+3
| | | | | | | | Fix GISCAN by synchronizing the variable names in the .h files with that in the .c and documentation comments and fix the documentation comments to match the naming in the function implementation. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
* shutil: Fall back to a copy if link() returns EPERM tooColin Walters2015-05-251-1/+1
| | | | | | | | There are a few reasons we could get EPERM such as /proc/sys/fs/protected_hardlinks being enabled. This was showing up using rpm-ostree with Bodhi; we haven't fully debugged it, but suspect this patch will fix it.
* console: Further clarify escape codesMatthew Barnes2015-04-151-1/+5
| | | | Found the flippin' manual.
* console: Link to wikipedia pageColin Walters2015-04-151-0/+1
|
* fileutils: Use new libglnx shutil mkdir-p APIColin Walters2015-04-071-3/+7
| | | | Mostly for testing coverage.
* fileutils: Switch to libglnx xattr codeColin Walters2015-02-151-317/+12
|
* Start using libglnxColin Walters2015-02-151-146/+5
| | | | | We can pull in libglnx here, and have this module become a GFile * wrapper plus legacy code.
* fileutils: Add missing dirent includeColin Walters2015-01-211-0/+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).
* 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-173-0/+113
| | | | This is a long overdue move of this function to public API.
* localalloc: Add gs_fd_close cleanupColin Walters2014-12-171-0/+19
| | | | | 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.
* 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.
* 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
|
* 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.
* 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.
* Rework to be an installed libraryv2014.1Colin Walters2014-02-0618-0/+5146
See https://mail.gnome.org/archives/desktop-devel-list/2014-February/msg00028.html