[newlib-cygwin/topic/posix_acl_funcs] (14 commits) Bump Cygwin version to 2.5.0
The branch 'topic/posix_acl_funcs' was updated to point to: 69b253e... Bump Cygwin version to 2.5.0 It previously pointed to: 5aa743b... Bump Cygwin version to 2.5.0 Diff: !!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST): --- 5aa743b... Bump Cygwin version to 2.5.0 04b07ae... acl_create_entry: Don't invalidate existing entry_d and per 876ce93... __acltotext: Always append NUL aaf0a01... Implement POSIX.1e ACL functions 95bff55... cygwin/acl.h: Don't clutter namespace commit 5aa743b58616fb7f954235ea5ce8367110ea7f3b Author: Corinna VinschenDate: Sun Jan 24 11:48:58 2016 +0100 Bump Cygwin version to 2.5.0 Signed-off-by: Corinna Vinschen commit 04b07ae6df0383dab14ccaa2ec83d75633f1a95b Author: Corinna Vinschen Date: Wed Jan 6 23:00:51 2016 +0100 acl_create_entry: Don't invalidate existing entry_d and permset_d. * sec_posixacl .cc (__acl_dup): Remove. (acl_dup): Fold __acl_dup functionality into this function. (acl_create_entry): Don't create new acl_t. Just realloc acl->entry to make room for new aclent_t. Signed-off-by: Corinna Vinschen commit 876ce93e1b95ef600ce1627d29f391b3b90dd8c2 Author: Corinna Vinschen Date: Wed Jan 6 21:05:56 2016 +0100 __acltotext: Always append NUL * sec_acl.cc (__acltotext): Append NUL unconditionally. Signed-off-by: Corinna Vinschen commit aaf0a01cb7f1ce0412fa6738a2c1c9325e11d2ae Author: Corinna Vinschen Date: Wed Jan 6 18:41:36 2016 +0100 Implement POSIX.1e ACL functions * Makefile.in (DLL_OFILES): Add sec_posixacl.o. (SUBLIBS): Add libacl.a (libacl.a): New rule to create libacl.a. * common.din: Export POSIX ACL functions as well as most libacl.a extensions. * fhandler.h (fhander_base::acl_get): New prototype. (fhander_base::acl_set): Ditto. (fhandler_disk_file::acl_get): Ditto. (fhandler_disk_file::acl_set): Ditto. * include/acl/libacl.h: New file. * include/cygwin/version.h: Bump API minor version. * include/sys/acl.h: Drop including cygwin/acl.h. Accommodate throughout Cygwin. Add POSIX ACL definitions. * sec_acl.cc: Include sec_posixacl.h. Replace ILLEGAL_UID and ILLEGAL_GID with ACL_UNDEFINED_ID where sensible. (__aclcheck): New internal acl check function to be used for Solaris and POSIX ACLs. (aclcheck32): Call __aclcheck. (__aclcalcmask): New function to compute ACL_MASK value. (__aclsort): New internal acl sort function to be used for Solaris and POSIX ACLs. (aclsort32): Call __aclsort. (permtostr): Work directly on provided buffer. (__acltotext): New internal acltotext function to be used for Solaris and POSIX ACLs. (acltotext32): Call __acltotext. (__aclfromtext): New internal aclfromtext function to be used for Solaris and POSIX ACLs. (aclfromtext32): Call __aclfromtext. * sec_posixacl.cc: New file implemeting POSIX ACL functions. * sec_posixacl.h: New internal header. Signed-off-by: Corinna Vinschen commit 95bff5586f824163566180a51020d6164e2150a5 Author: Corinna Vinschen Date: Wed Jan 6 18:24:03 2016 +0100 cygwin/acl.h: Don't clutter namespace include/cygwin/acl.h: Change comments to /**/ style. Reformat declarations. Use underscores in argument names. Signed-off-by: Corinna Vinschen Summary of changes (added commits): --- 69b253e... Bump Cygwin version to 2.5.0 ce97188... acl_create_entry: Don't invalidate existing entry_d and per 32bdf98... __acltotext: Always append NUL f94d912... Implement POSIX.1e ACL functions cabfc9a... cygwin/acl.h: Don't clutter namespace c4dcfc1... printf(3): Handle multibyte decimal point in field size com c5fee55... stdio.h: Use __POSIX_VISIBLE etc. guards for POSIX 1003.1:2 352cdbb... Newlib build is broken if configured with nano-malloc and n 7c9651e... * newlib/libc/stdio/nano-vfscanf.c: Fix '%X' specifier proc fa08ba8... * newlib/libc/stdio/nano-vfscanf.c: Fix '%F', '%G' and '%E' c2a2745... Change if_nameindex() to use unsigned int i variable. ba4433e... include/grp.h: Remove prototypes of non-standard functions 4792146... Fix memcpy bug that reads past end of buffer. a710c89... grp.h: use __BSD_VISIBLE and __XSI_VISIBLE guards commit 69b253e24709c28fa78351c93a4d0c17252af1b2 Author: Corinna Vinschen Date: Sun Jan 24 11:48:58 2016 +0100 Bump Cygwin version to 2.5.0 Signed-off-by: Corinna Vinschen
[newlib-cygwin/topic/posix_acl_funcs] cygwin/acl.h: Don't clutter namespace
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=cabfc9a69e183e77a6af7bb50151933eaa46e760 commit cabfc9a69e183e77a6af7bb50151933eaa46e760 Author: Corinna VinschenDate: Wed Jan 6 18:24:03 2016 +0100 cygwin/acl.h: Don't clutter namespace include/cygwin/acl.h: Change comments to /**/ style. Reformat declarations. Use underscores in argument names. Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/include/cygwin/acl.h | 70 +- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/winsup/cygwin/include/cygwin/acl.h b/winsup/cygwin/include/cygwin/acl.h index b7cbf03..846c49c 100644 --- a/winsup/cygwin/include/cygwin/acl.h +++ b/winsup/cygwin/include/cygwin/acl.h @@ -33,56 +33,62 @@ extern "C" { On one hand, there are only a limited number of SIDs shorter than the normal user/group SIDs, on the other hand there are no deny aclent_t entries, so we should be fine with 32K aclbuf_t buffers provided by the caller. */ -#defineMIN_ACL_ENTRIES (3)// minimal acl entries from GETACLCNT -#defineMAX_ACL_ENTRIES (2730) // max entries of each type +#defineMIN_ACL_ENTRIES (3)/* minimal acl entries from GETACLCNT */ +#defineMAX_ACL_ENTRIES (2730) /* max entries of each type */ -// Return values of aclcheck(3) in case of error */ +/* Return values of aclcheck(3) in case of error */ #define GRP_ERROR (0x1) #define USER_ERROR (0x2) #define CLASS_ERROR (0x3) #define OTHER_ERROR (0x4) #define DUPLICATE_ERROR (0x5) #define ENTRY_ERROR (0x6) -#define MISS_ERROR (0x7) // which = -1 -#define MEM_ERROR (0x8) // which = -1 +#define MISS_ERROR (0x7) /* which = -1 */ +#define MEM_ERROR (0x8) /* which = -1 */ -// Values for entry type of struct acl -#define USER_OBJ(0x0001)// owner -#define USER(0x0002)// additional user -#define GROUP_OBJ (0x0004)// owning group -#define GROUP (0x0008)// additional group -#define CLASS_OBJ (0x0010)// mask entry -#define OTHER_OBJ (0x0020)// others -#define ACL_DEFAULT (0x1000)// default flag -#define DEF_USER_OBJ(ACL_DEFAULT|USER_OBJ) // default owner -#define DEF_USER(ACL_DEFAULT|USER) // default additional user -#define DEF_GROUP_OBJ (ACL_DEFAULT|GROUP_OBJ) // default owning group -#define DEF_GROUP (ACL_DEFAULT|GROUP) // default additional group -#define DEF_CLASS_OBJ (ACL_DEFAULT|CLASS_OBJ) // default mask entry -#define DEF_OTHER_OBJ (ACL_DEFAULT|OTHER_OBJ) // default others -// Values with equivalent meanings +/* Values for entry type of struct acl */ +#define USER_OBJ(0x0001)/* owner */ +#define USER(0x0002)/* additional user */ +#define GROUP_OBJ (0x0004)/* owning group */ +#define GROUP (0x0008)/* additional group*/ +#define CLASS_OBJ (0x0010)/* mask entry */ +#define OTHER_OBJ (0x0020)/* others */ +#define ACL_DEFAULT (0x1000)/* default flag */ +#define DEF_USER_OBJ(ACL_DEFAULT|USER_OBJ) /* default owner */ +#define DEF_USER(ACL_DEFAULT|USER) /* default additional user */ +#define DEF_GROUP_OBJ (ACL_DEFAULT|GROUP_OBJ) /* default owning group */ +#define DEF_GROUP (ACL_DEFAULT|GROUP) /* default additional group */ +#define DEF_CLASS_OBJ (ACL_DEFAULT|CLASS_OBJ) /* default mask entry */ +#define DEF_OTHER_OBJ (ACL_DEFAULT|OTHER_OBJ) /* default others */ +/* Values with equivalent meanings */ #define USER_OWNER USER_OBJ #define GROUP_OWNER GROUP_OBJ #define MASKCLASS_OBJ #define OTHER OTHER_OBJ typedef struct acl { -int a_type;/* entry type */ -uid_ta_id; /* UID | GID */ +int a_type;/* entry type */ +id_t a_id; /* UID | GID */ mode_t a_perm;/* permissions */ } aclent_t; #ifndef __INSIDE_CYGWIN__ -int _EXFUN(acl,(const char *path, int cmd, int nentries, aclent_t *aclbufp)); -int _EXFUN(facl,(int fd, int cmd, int nentries, aclent_t *aclbufp)); -int _EXFUN(aclcheck,(aclent_t *aclbufp, int nentries, int *which)); -int _EXFUN(aclsort,(int nentries, int calclass, aclent_t *aclbufp)); -int _EXFUN(acltomode,(aclent_t *aclbufp, int nentries, mode_t *modep)); -int _EXFUN(aclfrommode,(aclent_t *aclbufp, int nentries, mode_t *modep)); -int _EXFUN(acltopbits,(aclent_t *aclbufp, int nentries, mode_t *pbitsp)); -int _EXFUN(aclfrompbits,(aclent_t *aclbufp, int nentries, mode_t
[newlib-cygwin/topic/posix_acl_funcs] Bump Cygwin version to 2.5.0
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=69b253e24709c28fa78351c93a4d0c17252af1b2 commit 69b253e24709c28fa78351c93a4d0c17252af1b2 Author: Corinna VinschenDate: Sun Jan 24 11:48:58 2016 +0100 Bump Cygwin version to 2.5.0 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/include/cygwin/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index d254a79..2ee2634 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -42,8 +42,8 @@ details. */ the Cygwin shared library". This version is used to track important changes to the DLL and is mainly informative in nature. */ -#define CYGWIN_VERSION_DLL_MAJOR 2004 -#define CYGWIN_VERSION_DLL_MINOR 1 +#define CYGWIN_VERSION_DLL_MAJOR 2005 +#define CYGWIN_VERSION_DLL_MINOR 0 /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are incompatible. */
[newlib-cygwin/topic/posix_acl_funcs] Implement POSIX.1e ACL functions
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f94d912d57ab0991e5abc582c264ad50caa6f590 commit f94d912d57ab0991e5abc582c264ad50caa6f590 Author: Corinna VinschenDate: Wed Jan 6 18:41:36 2016 +0100 Implement POSIX.1e ACL functions * Makefile.in (DLL_OFILES): Add sec_posixacl.o. (SUBLIBS): Add libacl.a (libacl.a): New rule to create libacl.a. * common.din: Export POSIX ACL functions as well as most libacl.a extensions. * fhandler.h (fhander_base::acl_get): New prototype. (fhander_base::acl_set): Ditto. (fhandler_disk_file::acl_get): Ditto. (fhandler_disk_file::acl_set): Ditto. * include/acl/libacl.h: New file. * include/cygwin/version.h: Bump API minor version. * include/sys/acl.h: Drop including cygwin/acl.h. Accommodate throughout Cygwin. Add POSIX ACL definitions. * sec_acl.cc: Include sec_posixacl.h. Replace ILLEGAL_UID and ILLEGAL_GID with ACL_UNDEFINED_ID where sensible. (__aclcheck): New internal acl check function to be used for Solaris and POSIX ACLs. (aclcheck32): Call __aclcheck. (__aclcalcmask): New function to compute ACL_MASK value. (__aclsort): New internal acl sort function to be used for Solaris and POSIX ACLs. (aclsort32): Call __aclsort. (permtostr): Work directly on provided buffer. (__acltotext): New internal acltotext function to be used for Solaris and POSIX ACLs. (acltotext32): Call __acltotext. (__aclfromtext): New internal aclfromtext function to be used for Solaris and POSIX ACLs. (aclfromtext32): Call __aclfromtext. * sec_posixacl.cc: New file implemeting POSIX ACL functions. * sec_posixacl.h: New internal header. Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/Makefile.in |6 +- winsup/cygwin/common.din | 39 ++ winsup/cygwin/fhandler.cc |2 +- winsup/cygwin/fhandler.h |5 + winsup/cygwin/fhandler_disk_file.cc|2 +- winsup/cygwin/fhandler_socket.cc |2 +- winsup/cygwin/fhandler_tty.cc |2 +- winsup/cygwin/fhandler_virtual.cc |2 +- winsup/cygwin/include/acl/libacl.h | 55 ++ winsup/cygwin/include/cygwin/version.h |3 +- winsup/cygwin/include/sys/acl.h| 85 ++- winsup/cygwin/sec_acl.cc | 768 +++ winsup/cygwin/sec_helper.cc|2 +- winsup/cygwin/sec_posixacl.cc | 1052 winsup/cygwin/sec_posixacl.h | 68 +++ winsup/cygwin/security.cc |2 +- winsup/utils/getfacl.c |3 +- winsup/utils/setfacl.c |3 +- 18 files changed, 1825 insertions(+), 276 deletions(-) diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index 271a5be..fac9b3e 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -267,6 +267,7 @@ DLL_OFILES:= \ sec_acl.o \ sec_auth.o \ sec_helper.o \ + sec_posixacl.o \ security.o \ select.o \ sem.o \ @@ -443,7 +444,7 @@ endif API_VER:=$(srcdir)/include/cygwin/version.h LIB_NAME:=libcygwin.a -SUBLIBS:=libpthread.a libutil.a ${CURDIR}/libm.a ${CURDIR}/libc.a libdl.a libresolv.a librt.a +SUBLIBS:=libpthread.a libutil.a ${CURDIR}/libm.a ${CURDIR}/libc.a libdl.a libresolv.a librt.a libacl.a EXTRALIBS:=libautomode.a libbinmode.a libtextmode.a libtextreadmode.a INSTOBJS:=automode.o binmode.o textmode.o textreadmode.o TARGET_LIBS:=$(LIB_NAME) $(CYGWIN_START) $(GMON_START) $(LIBGMON_A) $(SUBLIBS) $(INSTOBJS) $(EXTRALIBS) @@ -643,6 +644,9 @@ libresolv.a: ${LIB_NAME} minires.o librt.a: ${LIB_NAME} posix_ipc.o ${speclib} ${@F} +libacl.a: ${LIB_NAME} sec_posixacl.o + ${speclib} ${@F} + ${EXTRALIBS}: lib%.a: %.o $(AR) cru $@ $? diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din index d7f4d24..afb81f6 100644 --- a/winsup/cygwin/common.din +++ b/winsup/cygwin/common.din @@ -117,6 +117,45 @@ accept = cygwin_accept SIGFE accept4 SIGFE access SIGFE acl SIGFE +acl_add_perm NOSIGFE +acl_calc_mask SIGFE +acl_check NOSIGFE +acl_clear_perms NOSIGFE +acl_cmp SIGFE +acl_copy_entry NOSIGFE +acl_copy_ext NOSIGFE +acl_copy_int NOSIGFE +acl_create_entry SIGFE +acl_delete_def_file SIGFE +acl_delete_entry NOSIGFE +acl_delete_perm NOSIGFE +acl_dup SIGFE +acl_entries NOSIGFE +acl_equiv_mode SIGFE +acl_error NOSIGFE +acl_extended_fd SIGFE +acl_extended_file SIGFE +acl_extended_file_nofollow SIGFE +acl_free SIGFE +acl_from_mode NOSIGFE +acl_from_text SIGFE +acl_get_entry NOSIGFE +acl_get_fd SIGFE +acl_get_file SIGFE +acl_get_perm NOSIGFE +acl_get_permset NOSIGFE +acl_get_qualifier SIGFE +acl_get_tag_type NOSIGFE +acl_init SIGFE +acl_set_fd SIGFE
[newlib-cygwin/topic/posix_acl_funcs] __acltotext: Always append NUL
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=32bdf98350887a90f9ee416f788589945c56678a commit 32bdf98350887a90f9ee416f788589945c56678a Author: Corinna VinschenDate: Wed Jan 6 21:05:56 2016 +0100 __acltotext: Always append NUL * sec_acl.cc (__acltotext): Append NUL unconditionally. Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/sec_acl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index bbdf238..8698d21 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -1699,8 +1699,8 @@ __acltotext (aclent_t *aclbufp, int aclcnt, const char *prefix, char separator, { _CHK (1); *bufp++ = separator; - *bufp++ = '\0'; } + *bufp = '\0'; return strdup (buf); }