Lines Matching refs:path

40 #include "path-util.h"
47 int unlink_noerrno(const char *path) {
51 r = unlink(path);
58 int rmdir_parents(const char *path, const char *stop) {
62 assert(path);
65 l = strlen(path);
68 while (l > 0 && path[l-1] == '/')
75 while (l > 0 && path[l-1] != '/')
79 while (l > 0 && path[l-1] == '/')
85 t = strndup(path, l);
248 int readlink_and_make_absolute_root(const char *root, const char *path, char **ret) {
253 full = prefix_roota(root, path);
258 t = file_in_same_dir(path, target);
268 int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid) {
269 assert(path);
276 if (chmod(path, mode) < 0)
280 if (chown(path, uid, gid) < 0)
315 int fd_warn_permissions(const char *path, int fd) {
322 log_warning("Configuration file %s is marked executable. Please remove executable permission bits. Proceeding anyway.", path);
325 log_warning("Configuration file %s is marked world-writable. Please remove world writability permission bits. Proceeding anyway.", path);
328 log_warning("Configuration file %s is marked world-inaccessible. This has no effect as configuration data is accessible via APIs without restrictions. Proceeding anyway.", path);
333 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode) {
337 assert(path);
340 mkdir_parents(path, 0755);
342 fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY,
373 int touch(const char *path) {
374 return touch_file(path, false, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID);
421 int mknod_atomic(const char *path, mode_t mode, dev_t dev) {
425 assert(path);
427 r = tempfn_random(path, NULL, &t);
434 if (rename(t, path) < 0) {
442 int mkfifo_atomic(const char *path, mode_t mode) {
446 assert(path);
448 r = tempfn_random(path, NULL, &t);
455 if (rename(t, path) < 0) {
463 int get_files_in_directory(const char *path, char ***list) {
468 assert(path);
474 d = opendir(path);