From c565b06325960a16ebf44afd8ae73f363775e58d Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 18 May 2015 02:00:43 -0500 Subject: More ls -Z upgrading. Move TOYBOX_SELINUX and TOYBOX_SMACK support from portability.h to new lib/lsm.h. Update ls.c to use it. Fix "ls . toys" (two directories when one is . or ..), which was filtering out the . as something we shouldn't recurse into even though it was explicitly listed on the command line. For some reason "ls -Z . toys" is still segfaulting though (but "ls -Z ." isn't), need to figure out why... --- lib/portability.h | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'lib/portability.h') diff --git a/lib/portability.h b/lib/portability.h index aa1ee488..f83cab60 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -225,6 +225,10 @@ ssize_t getline(char **lineptr, size_t *n, FILE *stream); #define O_NOFOLLOW 0 #endif +#ifndef O_NOATIME +#define O_NOATIME 01000000 +#endif + #ifndef O_CLOEXEC #define O_CLOEXEC 02000000 #endif @@ -247,24 +251,3 @@ pid_t xfork(void); //#define strncpy(...) @@strncpyisbadmmkay@@ //#define strncat(...) @@strncatisbadmmkay@@ -#if CFG_TOYBOX_SELINUX -#include -#else -#define is_selinux_enabled() 0 -int getcon(void* con); -#endif - -#if CFG_TOYBOX_SMACK -#include -#include -#include -#else -#define smack_new_label_from_path(...) (-1) -#define smack_set_label_for_path(...) (-1) -#define smack_set_label_for_self(...) (-1) -#define XATTR_NAME_SMACK "" -#define SMACK_LABEL_LEN (1) /* for just ? */ - -ssize_t fgetxattr (int fd, char *name, void *value, size_t size); -#endif - -- cgit v1.2.3