Anonymous avatar Anonymous committed f122d1c Merge

Merge "Remove HAVE_SELINUX guards"

Comments (0)

Files changed (2)

 
 LOCAL_MODULE := mkyaffs2image
 
-ifeq ($(HAVE_SELINUX), true)
-LOCAL_C_INCLUDES += external/libselinux/include
-LOCAL_STATIC_LIBRARIES += libselinux
-LOCAL_CFLAGS += -DHAVE_SELINUX
-endif # HAVE_SELINUX
+LOCAL_STATIC_LIBRARIES := libselinux
 
 include $(BUILD_HOST_EXECUTABLE)
 

yaffs2/utils/mkyaffs2image.c

 #include <string.h>
 #include <unistd.h>
 
-#ifdef HAVE_SELINUX
 #define XATTR_NAME_SELINUX "security.selinux"
 #include <selinux/selinux.h>
 #include <selinux/label.h>
 static struct selabel_handle *sehnd;
 static unsigned int seprefixlen;
 static char *mntpoint;
-#endif
 
 #include <private/android_filesystem_config.h>
 
 	
 	
 	yaffs_ObjectHeader *oh = (yaffs_ObjectHeader *)bytes;
-#ifdef HAVE_SELINUX
 	char *xb = (char *)bytes + sizeof(*oh);
 	int xnamelen = strlen(XATTR_NAME_SELINUX) + 1;
 	int xvalsize = 0;
 		xvalsize = strlen(secontext) + 1;
 		xreclen = sizeof(int) + xnamelen + xvalsize;
 	}
-#endif
 	
 	memset(bytes,0xff,sizeof(bytes));
 	
 	
 	strncpy(oh->name,name,YAFFS_MAX_NAME_LENGTH);
 
-#ifdef HAVE_SELINUX
 	if (xreclen) {
 		memcpy(xb, &xreclen, sizeof(int));
 		xb += sizeof(int);
 		xb += xnamelen;
 		memcpy(xb, secontext, xvalsize);
 	}
-#endif
 	
 	if(t != YAFFS_OBJECT_TYPE_HARDLINK)
 	{
 			   strcmp(entry->d_name,".."))
  			{
  				char full_name[500];
-#ifdef HAVE_SELINUX
 				char *suffix, dest_name[500];
 				int ret;
-#endif
 				struct stat stats;
 				int equivalentObj;
 				int newObj;
 				
 				lstat(full_name,&stats);
 
-#ifdef HAVE_SELINUX
 				if (sehnd) {
 					suffix = full_name + seprefixlen;
 					ret = snprintf(dest_name,
 					}
 					free(sepath);
 				}
-#endif
 
 				if(S_ISLNK(stats.st_mode) ||
 				    S_ISREG(stats.st_mode) ||
 	}
 
 	dir = argv[optind];
-#ifdef HAVE_SELINUX
 	seprefixlen = strlen(dir);
-#endif
 	image = argv[optind + 1];
 
 	if (optind + 2 < argc) {
 		if (!strncmp(argv[optind + 2], "convert", strlen("convert")))
 			convert_endian = 1;
 		else {
-#ifdef HAVE_SELINUX
 			struct selinux_opt seopts[] = {
 				{ SELABEL_OPT_PATH, argv[optind + 2] }
 			};
 				if (!strncmp(argv[optind + 4], "convert", strlen("convert")))
 					convert_endian = 1;
 			}
-#else
-			usage();
-			exit(1);
-#endif
 		}
 	}
 
     }
     
 	//printf("Processing directory %s into image file %s\n",dir,image);
-#ifdef HAVE_SELINUX
     if (sehnd) {
 
         char *sepath = NULL;
 
 	free(sepath);
     }
-#endif
 
     error =  write_object_header(1, YAFFS_OBJECT_TYPE_DIRECTORY, &stats, 1,"", -1, NULL, secontext);
 	if(error)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.