Lines Matching refs:pathname
606 static int restorecon_sb(const char *pathname, const struct stat *sb, in restorecon_sb() argument
614 const char *lookup_path = pathname; in restorecon_sb()
616 if (!strncmp(pathname, DATA_APP_EL1, sizeof(DATA_APP_EL1) - 1) || in restorecon_sb()
617 !strncmp(pathname, DATA_APP_EL2, sizeof(DATA_APP_EL2) - 1) || in restorecon_sb()
618 !strncmp(pathname, DATA_APP_EL3, sizeof(DATA_APP_EL3) - 1) || in restorecon_sb()
619 !strncmp(pathname, DATA_APP_EL4, sizeof(DATA_APP_EL4) - 1) || in restorecon_sb()
620 !strncmp(pathname, DATA_ACCOUNTS_ACCOUNT_0, sizeof(DATA_ACCOUNTS_ACCOUNT_0) - 1)) { in restorecon_sb()
666 rc = filespec_add(sb->st_ino, newcon, pathname, flags); in restorecon_sb()
670 "filespec_add error: %s\n", pathname); in restorecon_sb()
684 pathname, newcon); in restorecon_sb()
686 if (lgetfilecon_raw(pathname, &curcon) < 0) { in restorecon_sb()
699 pathname, curcon); in restorecon_sb()
719 if (lsetfilecon(pathname, newcon) < 0) in restorecon_sb()
728 pathname, curcon, newcon); in restorecon_sb()
734 pathname, curcon, newcon); in restorecon_sb()
737 pathname, newcon); in restorecon_sb()
750 pathname); in restorecon_sb()
765 static bool check_context_match_for_dir(const char *pathname, in check_context_match_for_dir() argument
780 status = selabel_get_digests_all_partial_matches(fc_sehandle, pathname, in check_context_match_for_dir()
795 (*new_node)->path = strdup(pathname); in check_context_match_for_dir()
866 char *pathname = NULL, *pathdnamer = NULL, *pathdname, *pathbname; in selinux_restorecon() local
901 pathname = realpath(pathname_orig, NULL); in selinux_restorecon()
902 if (!pathname) { in selinux_restorecon()
920 error = asprintf(&pathname, "/%s", pathbname); in selinux_restorecon()
922 error = asprintf(&pathname, "%s/%s", in selinux_restorecon()
931 pathname = strdup(pathname_orig); in selinux_restorecon()
932 if (!pathname) in selinux_restorecon()
936 paths[0] = pathname; in selinux_restorecon()
938 if (lstat(pathname, &sb) < 0) { in selinux_restorecon()
941 free(pathname); in selinux_restorecon()
946 pathname); in selinux_restorecon()
957 if (check_excluded(pathname)) { in selinux_restorecon()
962 error = restorecon_sb(pathname, &sb, &flags); in selinux_restorecon()
968 if (!S_ISLNK(sb.st_mode) && statfs(pathname, &sfsb) < 0) { in selinux_restorecon()
971 pathname); in selinux_restorecon()
1118 fprintf(stdout, "\r%s 100.0%%\n", pathname); in selinux_restorecon()
1130 free(pathname); in selinux_restorecon()
1259 int selinux_restorecon_xattr(const char *pathname, unsigned int xattr_flags, in selinux_restorecon_xattr() argument
1284 if (lstat(pathname, &sb) < 0) { in selinux_restorecon_xattr()
1290 pathname); in selinux_restorecon_xattr()
1295 if (statfs(pathname, &sfsb) == 0) { in selinux_restorecon_xattr()
1301 if (check_excluded(pathname)) in selinux_restorecon_xattr()
1304 rc = add_xattr_entry(pathname, delete_nonmatch, delete_all); in selinux_restorecon_xattr()
1314 paths[0] = (char *)pathname; in selinux_restorecon_xattr()