summaryrefslogtreecommitdiff
path: root/common/path.c
Commit message (Collapse)AuthorAgeFilesLines
* common: Add path encoding functionsDaiki Ueno2017-02-161-0/+33
| | | | | | | | | This adds p11_path_{encode,decode}(), following the escaping rule described in: https://dbus.freedesktop.org/doc/dbus-specification.html#addresses Although they are merely a wrapper around p11_url_{decode,encode}(), having dedicated functions hides the implementation details.
* common, trust: Avoid integer overflowDaiki Ueno2016-12-061-0/+2
| | | | | | | This fixes issues pointed in: https://bugzilla.redhat.com/show_bug.cgi?id=985445 except for p11-kit/conf.c:read_config_file(), which was rewritten using mmap() and thus length calculation is no longer needed.
* Fix trust command segfaults in expand_homedir() when no matching password ↵Robert Milasan2015-07-311-9/+9
| | | | | | | | | | | | | record was found Hello, it looks like under some conditions, command trust segfaults in expand_homedir() due to no matching password record was found: Signed-off-by: Robert Milasan <rmilasan@suse.com> Signed-off-by: Stef Walter <stefw@redhat.com> * Updated path so message is printed and errno is not overwritten https://bugs.freedesktop.org/show_bug.cgi?id=91506
* Use getpwuid_r() instead of the non-thread-sofe getpwuid()Stef Walter2013-07-181-2/+9
|
* Avoid using the non-thread-safe strerror() functionStef Walter2013-07-181-2/+1
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=985481
* Declare static variables const where it makes senseStef Walter2013-07-181-4/+4
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=985337
* Support expanding $XDG_CONFIG_HOME in user config pathsStef Walter2013-07-181-13/+24
| | | | | | | | | | If ~/.config is specified as a prefix to a configured path, then it is expanded to the $XDG_CONFIG_HOME if that exists Add --with-user-config ./configure option to configure a different user config directory. Interpolate the right directories into documentation.
* Don't load configs from user directory when setuidStef Walter2013-07-181-0/+5
| | | | | | | When running as setuid() or setgid() don't access the user's home directory, or use $HOME environment variables. https://bugzilla.redhat.com/show_bug.cgi?id=985014
* tools: Use $TMPDIR instead of $TEMPStef Walter2013-07-181-44/+0
| | | | | | | | | | | | TMPDIR is a more standard environment variable for locating the temp directory on Unix. In addition since this is only used in tests, remove the code from the generic p11_path_expand() func. In general remove the possibility for forks to put $HOME or $TEMP environment variables in configured paths. This was possible due to code in p11_path_expand() but not something we supported. https://bugzilla.redhat.com/show_bug.cgi?id=985017
* Fixes for some recent win32 regressionsStef Walter2013-07-181-3/+18
|
* path: Add p11_path_canon() functionStef Walter2013-07-031-0/+15
| | | | Cleans up a filename with readable characters.
* path: Add p11_path_prefix() functionStef Walter2013-07-031-0/+17
| | | | | Checks if a wellformed path is identical to or a prefix of another path.
* path: Add p11_path_parent() functionStef Walter2013-06-141-0/+36
| | | | | Gets the parent element of the path, removing the last component. Handles trailing and duplicate path separators correctly.
* path: Fix expanding of paths and testsStef Walter2013-06-141-5/+11
|
* Support /xxx/yyy as an absolute path with Win32Stef Walter2013-05-211-4/+4
| | | | | Because win32 code doesn't just run on windows, wine runs with unix style paths.
* More compatible path munging and handling codeStef Walter2013-04-031-0/+258
Centralize the path handling code, so we can remove unixy assumptions and have a chance of running on Windows. The current goal is to run all the tests on Windows. Includes some code from LRN <lrn1986@gmail.com> https://bugs.freedesktop.org/show_bug.cgi?id=63062