Lines Matching refs:path
40 const char *path, unsigned lineno)
46 rc = myinvalidcon(path, lineno, *ctx);
48 rc = mycanoncon(path, lineno, ctx);
55 path, lineno, *ctx);
58 "%s: has invalid context %s\n", path, *ctx);
126 static int default_canoncon(const char *path, unsigned lineno, char **context)
133 myprintf("%s: line %u has invalid context %s\n", path,
136 myprintf("%s: invalid context %s\n", path, *context);
350 int matchpathcon_init_prefix(const char *path, const char *subset)
361 options[SELABEL_OPT_PATH].value = path;
368 int matchpathcon_init(const char *path)
370 return matchpathcon_init_prefix(path, NULL);
379 * We do not want to resolve a symlink to a real path if it is the final
381 * determine a real path component of the first portion. We then have to
382 * copy the last part back on to get the final real path. Wheww.
438 static int matchpathcon_internal(const char *path, mode_t mode, char ** con)
446 if (!realpath_not_final(path, stackpath))
447 path = stackpath;
449 p = realpath(path, stackpath);
451 path = p;
455 selabel_lookup_raw(hnd, con, path, mode) :
456 selabel_lookup(hnd, con, path, mode);
459 int matchpathcon(const char *path, mode_t mode, char ** con) {
460 return matchpathcon_internal(path, mode, con);
501 int selinux_file_context_verify(const char *path, mode_t mode)
510 if (!realpath_not_final(path, stackpath))
511 path = stackpath;
513 p = realpath(path, stackpath);
515 path = p;
518 rc = lgetfilecon_raw(path, &con);
529 if (selabel_lookup_raw(hnd, &fcontext, path, mode) != 0) {
549 int selinux_lsetfilecon_default(const char *path)
554 if (lstat(path, &st) != 0)
562 if (selabel_lookup_raw(hnd, &scontext, path, st.st_mode)) {
566 rc = lsetfilecon_raw(path, scontext);