Lines Matching refs:pathname
597 static int restorecon_sb(const char *pathname, const struct stat *sb, in restorecon_sb() argument
605 const char *lookup_path = pathname; in restorecon_sb()
650 rc = filespec_add(sb->st_ino, newcon, pathname); in restorecon_sb()
654 "filespec_add error: %s\n", pathname); in restorecon_sb()
668 pathname, newcon); in restorecon_sb()
670 if (lgetfilecon_raw(pathname, &curcon) < 0) { in restorecon_sb()
683 pathname, curcon); in restorecon_sb()
703 if (lsetfilecon(pathname, newcon) < 0) in restorecon_sb()
712 pathname, curcon, newcon); in restorecon_sb()
718 pathname, curcon, newcon); in restorecon_sb()
721 pathname, newcon); in restorecon_sb()
734 pathname, strerror(errno)); in restorecon_sb()
788 char *pathname = NULL, *pathdnamer = NULL, *pathdname, *pathbname; in selinux_restorecon() local
820 pathname = realpath(pathname_orig, NULL); in selinux_restorecon()
821 if (!pathname) { in selinux_restorecon()
839 error = asprintf(&pathname, "/%s", pathbname); in selinux_restorecon()
841 error = asprintf(&pathname, "%s/%s", in selinux_restorecon()
850 pathname = strdup(pathname_orig); in selinux_restorecon()
851 if (!pathname) in selinux_restorecon()
855 paths[0] = pathname; in selinux_restorecon()
856 issys = (!strcmp(pathname, SYS_PATH) || in selinux_restorecon()
857 !strncmp(pathname, SYS_PREFIX, in selinux_restorecon()
860 if (lstat(pathname, &sb) < 0) { in selinux_restorecon()
864 free(pathname); in selinux_restorecon()
869 pathname, strerror(errno)); in selinux_restorecon()
880 if (check_excluded(pathname)) { in selinux_restorecon()
885 error = restorecon_sb(pathname, &sb, &flags); in selinux_restorecon()
894 if (setrestoreconlast && statfs(pathname, &sfsb) == 0) { in selinux_restorecon()
900 size = getxattr(pathname, RESTORECON_LAST, xattr_value, in selinux_restorecon()
908 pathname); in selinux_restorecon()
1000 error = setxattr(pathname, RESTORECON_LAST, fc_digest, in selinux_restorecon()
1004 "Updated digest for: %s\n", pathname); in selinux_restorecon()
1009 fprintf(stdout, "\r%s 100.0%%\n", pathname); in selinux_restorecon()
1021 free(pathname); in selinux_restorecon()
1138 int selinux_restorecon_xattr(const char *pathname, unsigned int xattr_flags, in selinux_restorecon_xattr() argument
1163 if (lstat(pathname, &sb) < 0) { in selinux_restorecon_xattr()
1169 pathname, strerror(errno)); in selinux_restorecon_xattr()
1174 if (statfs(pathname, &sfsb) == 0) { in selinux_restorecon_xattr()
1180 if (check_excluded(pathname)) in selinux_restorecon_xattr()
1183 rc = add_xattr_entry(pathname, delete_nonmatch, delete_all); in selinux_restorecon_xattr()
1193 paths[0] = (char *)pathname; in selinux_restorecon_xattr()