Remove dead selinux code

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
Jo-Philipp Wich 2015-04-04 23:48:00 +02:00
parent af498dbd68
commit 5e571bcba6
3 changed files with 0 additions and 26 deletions

View File

@ -18,11 +18,7 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_ANDROID_OS
#include <linux/capability.h>
#else
#include <private/android_filesystem_capability.h> #include <private/android_filesystem_capability.h>
#endif
#define XATTR_SELINUX_SUFFIX "selinux" #define XATTR_SELINUX_SUFFIX "selinux"
#define XATTR_CAPS_SUFFIX "capability" #define XATTR_CAPS_SUFFIX "capability"
@ -497,15 +493,6 @@ static int xattr_add(u32 inode_num, int name_index, const char *name,
return result; return result;
} }
int inode_set_selinux(u32 inode_num, const char *secon)
{
if (!secon)
return 0;
return xattr_add(inode_num, EXT4_XATTR_INDEX_SECURITY,
XATTR_SELINUX_SUFFIX, secon, strlen(secon) + 1);
}
int inode_set_capabilities(u32 inode_num, uint64_t capabilities) { int inode_set_capabilities(u32 inode_num, uint64_t capabilities) {
if (capabilities == 0) if (capabilities == 0)
return 0; return 0;

View File

@ -29,7 +29,6 @@ struct dentry {
u16 gid; u16 gid;
u32 *inode; u32 *inode;
u32 mtime; u32 mtime;
char *secon;
uint64_t capabilities; uint64_t capabilities;
}; };
@ -39,7 +38,6 @@ u32 make_file(const char *filename, u64 len);
u32 make_link(const char *link); u32 make_link(const char *link);
u32 make_special(const char *path); u32 make_special(const char *path);
int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime); int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime);
int inode_set_selinux(u32 inode_num, const char *secon);
int inode_set_capabilities(u32 inode_num, uint64_t capabilities); int inode_set_capabilities(u32 inode_num, uint64_t capabilities);
struct block_allocation* get_saved_allocation_chain(); struct block_allocation* get_saved_allocation_chain();

View File

@ -242,16 +242,6 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path
if (ret) if (ret)
error("failed to set permissions on %s\n", dentries[i].path); error("failed to set permissions on %s\n", dentries[i].path);
/*
* It's important to call inode_set_selinux() before
* inode_set_capabilities(). Extended attributes need to
* be stored sorted order, and we guarantee this by making
* the calls in the proper order.
* Please see xattr_assert_sane() in contents.c
*/
ret = inode_set_selinux(entry_inode, dentries[i].secon);
if (ret)
error("failed to set SELinux context on %s\n", dentries[i].path);
ret = inode_set_capabilities(entry_inode, dentries[i].capabilities); ret = inode_set_capabilities(entry_inode, dentries[i].capabilities);
if (ret) if (ret)
error("failed to set capability on %s\n", dentries[i].path); error("failed to set capability on %s\n", dentries[i].path);
@ -260,7 +250,6 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path
free(dentries[i].full_path); free(dentries[i].full_path);
free(dentries[i].link); free(dentries[i].link);
free((void *)dentries[i].filename); free((void *)dentries[i].filename);
free(dentries[i].secon);
} }
free(dentries); free(dentries);