Loading cmds/installd/commands.c +4 −4 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ int install(const char *pkgname, uid_t uid, gid_t gid) #ifdef HAVE_SELINUX if (selinux_android_setfilecon(libdir, pkgname, AID_SYSTEM) < 0) { LOGE("cannot setfilecon dir '%s': %s\n", libdir, strerror(errno)); ALOGE("cannot setfilecon dir '%s': %s\n", libdir, strerror(errno)); unlink(libdir); unlink(pkgdir); return -errno; Loading @@ -94,7 +94,7 @@ int install(const char *pkgname, uid_t uid, gid_t gid) #ifdef HAVE_SELINUX if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) { LOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); unlink(libdir); unlink(pkgdir); return -errno; Loading Loading @@ -201,7 +201,7 @@ int make_user_data(const char *pkgname, uid_t uid, uid_t persona) #ifdef HAVE_SELINUX if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) { LOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); unlink(pkgdir); return -errno; } Loading Loading @@ -405,7 +405,7 @@ int protect(char *pkgname, gid_t gid) #ifdef HAVE_SELINUX if (selinux_android_setfilecon(pkgpath, pkgname, s.st_uid) < 0) { LOGE("cannot setfilecon dir '%s': %s\n", pkgpath, strerror(errno)); ALOGE("cannot setfilecon dir '%s': %s\n", pkgpath, strerror(errno)); return -1; } #endif Loading core/jni/android_os_SELinux.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -90,14 +90,14 @@ namespace android { int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); if (env->ExceptionOccurred() != NULL) { LOGE("There was an issue with retrieving the file descriptor"); ALOGE("There was an issue with retrieving the file descriptor"); goto bail; } if (getpeercon(fd, &context) == -1) goto bail; LOGV("getPeerCon: Successfully retrived context of peer socket '%s'", context); ALOGV("getPeerCon: Successfully retrived context of peer socket '%s'", context); securityString = env->NewStringUTF(context); Loading Loading @@ -139,7 +139,7 @@ namespace android { if ((ret = setfscreatecon(securityContext)) == -1) goto bail; LOGV("setFSCreateCon: set new security context to '%s' ", context == NULL ? "default", context); ALOGV("setFSCreateCon: set new security context to '%s' ", context == NULL ? "default", context); bail: if (constant_securityContext != NULL) Loading Loading @@ -185,7 +185,7 @@ namespace android { if ((ret = setfilecon(objectPath, newCon)) == -1) goto bail; LOGV("setFileCon: Succesfully set security context '%s' for '%s'", newCon, objectPath); ALOGV("setFileCon: Succesfully set security context '%s' for '%s'", newCon, objectPath); bail: env->ReleaseStringUTFChars(path, objectPath); Loading Loading @@ -224,7 +224,7 @@ namespace android { if (getfilecon(objectPath, &context) == -1) goto bail; LOGV("getFileCon: Successfully retrived context '%s' for file '%s'", context, objectPath); ALOGV("getFileCon: Successfully retrived context '%s' for file '%s'", context, objectPath); securityString = env->NewStringUTF(context); Loading Loading @@ -259,7 +259,7 @@ namespace android { if (getcon(&context) == -1) goto bail; LOGV("getCon: Successfully retrieved context '%s'", context); ALOGV("getCon: Successfully retrieved context '%s'", context); securityString = env->NewStringUTF(context); Loading Loading @@ -295,7 +295,7 @@ namespace android { if (getpidcon(checkPid, &context) == -1) goto bail; LOGV("getPidCon: Successfully retrived context '%s' for pid '%d'", context, checkPid); ALOGV("getPidCon: Successfully retrived context '%s' for pid '%d'", context, checkPid); securityString = env->NewStringUTF(context); Loading Loading @@ -442,7 +442,7 @@ namespace android { accessGranted = selinux_check_access(myscon, mytcon, mytclass, myperm, NULL); LOGV("selinux_check_access returned %d", accessGranted); ALOGV("selinux_check_access returned %d", accessGranted); env->ReleaseStringUTFChars(scon, const_scon); env->ReleaseStringUTFChars(tcon, const_tcon); Loading Loading
cmds/installd/commands.c +4 −4 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ int install(const char *pkgname, uid_t uid, gid_t gid) #ifdef HAVE_SELINUX if (selinux_android_setfilecon(libdir, pkgname, AID_SYSTEM) < 0) { LOGE("cannot setfilecon dir '%s': %s\n", libdir, strerror(errno)); ALOGE("cannot setfilecon dir '%s': %s\n", libdir, strerror(errno)); unlink(libdir); unlink(pkgdir); return -errno; Loading @@ -94,7 +94,7 @@ int install(const char *pkgname, uid_t uid, gid_t gid) #ifdef HAVE_SELINUX if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) { LOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); unlink(libdir); unlink(pkgdir); return -errno; Loading Loading @@ -201,7 +201,7 @@ int make_user_data(const char *pkgname, uid_t uid, uid_t persona) #ifdef HAVE_SELINUX if (selinux_android_setfilecon(pkgdir, pkgname, uid) < 0) { LOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); ALOGE("cannot setfilecon dir '%s': %s\n", pkgdir, strerror(errno)); unlink(pkgdir); return -errno; } Loading Loading @@ -405,7 +405,7 @@ int protect(char *pkgname, gid_t gid) #ifdef HAVE_SELINUX if (selinux_android_setfilecon(pkgpath, pkgname, s.st_uid) < 0) { LOGE("cannot setfilecon dir '%s': %s\n", pkgpath, strerror(errno)); ALOGE("cannot setfilecon dir '%s': %s\n", pkgpath, strerror(errno)); return -1; } #endif Loading
core/jni/android_os_SELinux.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -90,14 +90,14 @@ namespace android { int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); if (env->ExceptionOccurred() != NULL) { LOGE("There was an issue with retrieving the file descriptor"); ALOGE("There was an issue with retrieving the file descriptor"); goto bail; } if (getpeercon(fd, &context) == -1) goto bail; LOGV("getPeerCon: Successfully retrived context of peer socket '%s'", context); ALOGV("getPeerCon: Successfully retrived context of peer socket '%s'", context); securityString = env->NewStringUTF(context); Loading Loading @@ -139,7 +139,7 @@ namespace android { if ((ret = setfscreatecon(securityContext)) == -1) goto bail; LOGV("setFSCreateCon: set new security context to '%s' ", context == NULL ? "default", context); ALOGV("setFSCreateCon: set new security context to '%s' ", context == NULL ? "default", context); bail: if (constant_securityContext != NULL) Loading Loading @@ -185,7 +185,7 @@ namespace android { if ((ret = setfilecon(objectPath, newCon)) == -1) goto bail; LOGV("setFileCon: Succesfully set security context '%s' for '%s'", newCon, objectPath); ALOGV("setFileCon: Succesfully set security context '%s' for '%s'", newCon, objectPath); bail: env->ReleaseStringUTFChars(path, objectPath); Loading Loading @@ -224,7 +224,7 @@ namespace android { if (getfilecon(objectPath, &context) == -1) goto bail; LOGV("getFileCon: Successfully retrived context '%s' for file '%s'", context, objectPath); ALOGV("getFileCon: Successfully retrived context '%s' for file '%s'", context, objectPath); securityString = env->NewStringUTF(context); Loading Loading @@ -259,7 +259,7 @@ namespace android { if (getcon(&context) == -1) goto bail; LOGV("getCon: Successfully retrieved context '%s'", context); ALOGV("getCon: Successfully retrieved context '%s'", context); securityString = env->NewStringUTF(context); Loading Loading @@ -295,7 +295,7 @@ namespace android { if (getpidcon(checkPid, &context) == -1) goto bail; LOGV("getPidCon: Successfully retrived context '%s' for pid '%d'", context, checkPid); ALOGV("getPidCon: Successfully retrived context '%s' for pid '%d'", context, checkPid); securityString = env->NewStringUTF(context); Loading Loading @@ -442,7 +442,7 @@ namespace android { accessGranted = selinux_check_access(myscon, mytcon, mytclass, myperm, NULL); LOGV("selinux_check_access returned %d", accessGranted); ALOGV("selinux_check_access returned %d", accessGranted); env->ReleaseStringUTFChars(scon, const_scon); env->ReleaseStringUTFChars(tcon, const_tcon); Loading