diff options
Diffstat (limited to 'include/libbb.h')
-rw-r--r-- | include/libbb.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/include/libbb.h b/include/libbb.h index fd40ef74c..a21f4204a 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -351,7 +351,7 @@ extern char *strrstr(const char *haystack, const char *needle) FAST_FUNC; //TODO: supply a pointer to char[11] buffer (avoid statics)? extern const char *bb_mode_string(mode_t mode) FAST_FUNC; extern int is_directory(const char *name, int followLinks) FAST_FUNC; -enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */ +enum { /* cp.c, mv.c, install.c depend on these values. CAREFUL when changing them! */ FILEUTILS_PRESERVE_STATUS = 1 << 0, /* -p */ FILEUTILS_DEREFERENCE = 1 << 1, /* !-d */ FILEUTILS_RECUR = 1 << 2, /* -R */ @@ -361,15 +361,25 @@ enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */ FILEUTILS_MAKE_SOFTLINK = 1 << 6, /* -s */ FILEUTILS_DEREF_SOFTLINK = 1 << 7, /* -L */ FILEUTILS_DEREFERENCE_L0 = 1 << 8, /* -H */ + /* -a = -pdR (mapped in cp.c) */ + /* -r = -dR (mapped in cp.c) */ + /* -P = -d (mapped in cp.c) */ + FILEUTILS_VERBOSE = (1 << 12) * ENABLE_FEATURE_VERBOSE, /* -v */ + FILEUTILS_UPDATE = 1 << 13, /* -u */ #if ENABLE_SELINUX - FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 9, /* -c */ - FILEUTILS_SET_SECURITY_CONTEXT = 1 << 10, + FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 14, /* -c */ #endif - FILEUTILS_IGNORE_CHMOD_ERR = 1 << 11, - /* -v */ - FILEUTILS_VERBOSE = (1 << 12) * ENABLE_FEATURE_VERBOSE, + FILEUTILS_RMDEST = 1 << (15 - !ENABLE_SELINUX), /* --remove-destination */ + /* + * Hole. cp may have some bits set here, + * they should not affect remove_file()/copy_file() + */ +#if ENABLE_SELINUX + FILEUTILS_SET_SECURITY_CONTEXT = 1 << 30, +#endif + FILEUTILS_IGNORE_CHMOD_ERR = 1 << 31, }; -#define FILEUTILS_CP_OPTSTR "pdRfilsLH" IF_SELINUX("c") +#define FILEUTILS_CP_OPTSTR "pdRfilsLHarPvu" IF_SELINUX("c") extern int remove_file(const char *path, int flags) FAST_FUNC; /* NB: without FILEUTILS_RECUR in flags, it will basically "cat" * the source, not copy (unless "source" is a directory). |