• Home
  • Raw
  • Download

Lines Matching refs:pathname

1037 static int pkgdir_selabel_lookup(const char *pathname,  in pkgdir_selabel_lookup()  argument
1049 if (!strncmp(pathname, DATA_DATA_PREFIX, sizeof(DATA_DATA_PREFIX)-1)) { in pkgdir_selabel_lookup()
1050 pathname += sizeof(DATA_DATA_PREFIX) - 1; in pkgdir_selabel_lookup()
1051 } else if (!strncmp(pathname, DATA_USER_PREFIX, sizeof(DATA_USER_PREFIX)-1)) { in pkgdir_selabel_lookup()
1052 pathname += sizeof(DATA_USER_PREFIX) - 1; in pkgdir_selabel_lookup()
1053 while (isdigit(*pathname)) in pkgdir_selabel_lookup()
1054 pathname++; in pkgdir_selabel_lookup()
1055 if (*pathname == '/') in pkgdir_selabel_lookup()
1056 pathname++; in pkgdir_selabel_lookup()
1062 if (!(*pathname)) in pkgdir_selabel_lookup()
1065 pkgname = strdup(pathname); in pkgdir_selabel_lookup()
1071 pathname = end; in pkgdir_selabel_lookup()
1073 pathname++; in pkgdir_selabel_lookup()
1080 pkgname, pathname); in pkgdir_selabel_lookup()
1091 … pkgInfo ? pkgInfo->seinfo : seinfo, pkgInfo ? pkgInfo->name : pkgname, pathname, ctx); in pkgdir_selabel_lookup()
1119 __FUNCTION__, pathname, pkgname, pkgInfo->seinfo, pkgInfo->uid, strerror(errno)); in pkgdir_selabel_lookup()
1126 static int restorecon_sb(const char *pathname, const struct stat *sb, in restorecon_sb() argument
1134 if (selabel_lookup(sehandle, &secontext, pathname, sb->st_mode) < 0) in restorecon_sb()
1137 if (lgetfilecon(pathname, &oldsecontext) < 0) in restorecon_sb()
1146 if (!strncmp(pathname, DATA_DATA_PREFIX, sizeof(DATA_DATA_PREFIX)-1) || in restorecon_sb()
1147 !strncmp(pathname, DATA_USER_PREFIX, sizeof(DATA_USER_PREFIX)-1)) { in restorecon_sb()
1148 if (pkgdir_selabel_lookup(pathname, seinfo, uid, &secontext) < 0) in restorecon_sb()
1155 … "SELinux: Relabeling %s from %s to %s.\n", pathname, oldsecontext, secontext); in restorecon_sb()
1157 if (lsetfilecon(pathname, secontext) < 0) in restorecon_sb()
1172 pathname, strerror(errno)); in restorecon_sb()
1180 static int selinux_android_restorecon_common(const char* pathname, in selinux_android_restorecon_common() argument
1190 …bool issys = (!strcmp(pathname, SYS_PATH) || !strncmp(pathname, SYS_PREFIX, sizeof(SYS_PREFIX)-1))… in selinux_android_restorecon_common()
1195 char *const paths[2] = { __UNCONST(pathname), NULL }; in selinux_android_restorecon_common()
1210 if (lstat(pathname, &sb) < 0) in selinux_android_restorecon_common()
1213 return restorecon_sb(pathname, &sb, nochange, verbose, seinfo, uid); in selinux_android_restorecon_common()
1222 if (!strncmp(pathname, DATA_DATA_PREFIX, sizeof(DATA_DATA_PREFIX)-1) || in selinux_android_restorecon_common()
1223 !strncmp(pathname, DATA_USER_PREFIX, sizeof(DATA_USER_PREFIX)-1)) in selinux_android_restorecon_common()
1231 size = getxattr(pathname, RESTORECON_LAST, xattr_value, sizeof fc_digest); in selinux_android_restorecon_common()
1235 pathname); in selinux_android_restorecon_common()
1291 setxattr(pathname, RESTORECON_LAST, fc_digest, sizeof fc_digest, 0); in selinux_android_restorecon_common()