1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

Fix from Michael Davidson <md@caldera.com> for DEC OSF/1 ACLs (ie.

Digital UNIX).
Jeremy.
(This used to be commit 324ba0512e)
This commit is contained in:
Jeremy Allison 2001-07-26 21:16:39 +00:00
parent ac26e23139
commit 08138a3244
7 changed files with 810 additions and 622 deletions

View File

@ -147,6 +147,7 @@
#undef HAVE_SOLARIS_ACLS
#undef HAVE_IRIX_ACLS
#undef HAVE_AIX_ACLS
#undef HAVE_DRAFT13_POSIX_ACLS
#undef HAVE_NO_ACLS
#undef HAVE_LIBPAM
#undef HAVE_ASPRINTF_DECL

1231
source3/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -2273,6 +2273,11 @@ AC_ARG_WITH(acl-support,
AC_MSG_RESULT(Using AIX ACLs)
AC_DEFINE(HAVE_AIX_ACLS)
;;
*osf*)
AC_MSG_RESULT(Using Draft 13 Posix ACLs)
AC_DEFINE(HAVE_DRAFT13_POSIX_ACLS)
LIBS="$LIBS -lpacl"
;;
*)
AC_CHECK_LIB(acl,acl_get_file)
AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[

View File

@ -1,4 +1,4 @@
/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* include/config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if on AIX 3.
System headers sometimes define this.
@ -210,6 +210,7 @@
#undef HAVE_SOLARIS_ACLS
#undef HAVE_IRIX_ACLS
#undef HAVE_AIX_ACLS
#undef HAVE_DRAFT13_POSIX_ACLS
#undef HAVE_NO_ACLS
#undef HAVE_LIBPAM
#undef HAVE_ASPRINTF_DECL

View File

@ -54,6 +54,36 @@
#define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS
#define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT
#elif defined(HAVE_DRAFT13_POSIX_ACLS)
/* This is for DEC OSF/1 */
#define SMB_ACL_TAG_T acl_tag_t
#define SMB_ACL_TYPE_T acl_type_t
#define SMB_ACL_PERMSET_T acl_permset_t
#define SMB_ACL_PERM_T acl_perm_t
#define SMB_ACL_READ ACL_READ
#define SMB_ACL_WRITE ACL_WRITE
#define SMB_ACL_EXECUTE ACL_EXECUTE
/* Types of ACLs. */
#define SMB_ACL_USER ACL_USER
#define SMB_ACL_USER_OBJ ACL_USER_OBJ
#define SMB_ACL_GROUP ACL_GROUP
#define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ
#define SMB_ACL_OTHER ACL_OTHER
#define SMB_ACL_MASK ACL_MASK
#define SMB_ACL_T acl_t
#define SMB_ACL_ENTRY_T acl_entry_t
#define SMB_ACL_FIRST_ENTRY 0
#define SMB_ACL_NEXT_ENTRY 1
#define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS
#define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT
#elif defined(HAVE_UNIXWARE_ACLS) || defined(HAVE_SOLARIS_ACLS)
/*
* Donated by Michael Davidson <md@sco.COM> for UnixWare / OpenUNIX.

View File

@ -64,7 +64,7 @@ extern int DEBUGLEVEL;
int sys_acl_free_text(char *text) - free acl_to_text
int sys_acl_free_acl(SMB_ACL_T posix_acl)
int sys_acl_free_qualifier(SMB_ACL_T posix_acl)
int sys_acl_free_qualifier(void *qualifier, SMB_ACL_TAG_T tagtype)
*/
@ -186,11 +186,157 @@ int sys_acl_free_acl(SMB_ACL_T the_acl)
return acl_free(the_acl);
}
int sys_acl_free_qualifier(void *qual)
int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype)
{
return acl_free(qual);
}
#elif defined(HAVE_DRAFT13_POSIX_ACLS)
int sys_acl_get_entry( SMB_ACL_T the_acl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
{
SMB_ACL_ENTRY_T entry;
if (entry_id == SMB_ACL_FIRST_ENTRY && acl_first_entry(the_acl) != 0) {
return -1;
}
errno = 0;
if ((entry = acl_get_entry(the_acl)) != NULL) {
*entry_p = entry;
return 1;
}
return errno ? -1 : 0;
}
int sys_acl_get_tag_type( SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p)
{
return acl_get_tag_type( entry_d, tag_type_p);
}
int sys_acl_get_permset( SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
{
return acl_get_permset( entry_d, permset_p);
}
void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d)
{
return acl_get_qualifier( entry_d);
}
SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type)
{
return acl_get_file((char *)path_p, type);
}
SMB_ACL_T sys_acl_get_fd(int fd)
{
return acl_get_fd(fd, ACL_TYPE_ACCESS);
}
int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset)
{
return acl_clear_perm(permset);
}
int sys_acl_add_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
{
return acl_add_perm(permset, perm);
}
int sys_acl_get_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
{
#if defined(HAVE_ACL_GET_PERM_NP)
return acl_get_perm_np(permset, perm);
#else
/*
* if we don't have an acl_get_perm() interface
* this will probably work for most implementations
*/
return *permset & perm;
#endif
}
char *sys_acl_to_text( SMB_ACL_T the_acl, ssize_t *plen)
{
return acl_to_text( the_acl, plen);
}
SMB_ACL_T sys_acl_init( int count)
{
return acl_init(count);
}
int sys_acl_create_entry( SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
{
SMB_ACL_ENTRY_T entry;
if ((entry = acl_create_entry(pacl)) == NULL) {
return -1;
}
*pentry = entry;
return 0;
}
int sys_acl_set_tag_type( SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype)
{
return acl_set_tag_type(entry, tagtype);
}
int sys_acl_set_qualifier( SMB_ACL_ENTRY_T entry, void *qual)
{
return acl_set_qualifier(entry, qual);
}
int sys_acl_set_permset( SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset)
{
return acl_set_permset(entry, permset);
}
int sys_acl_valid( SMB_ACL_T theacl )
{
acl_entry_t entry;
return acl_valid(theacl, &entry);
}
int sys_acl_set_file( const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
{
return acl_set_file((char *)name, acltype, theacl);
}
int sys_acl_set_fd( int fd, SMB_ACL_T theacl)
{
return acl_set_fd(fd, ACL_TYPE_ACCESS, theacl);
}
int sys_acl_delete_def_file(const char *name)
{
return acl_delete_def_file((char *)name);
}
int sys_acl_free_text(char *text)
{
/*
* (void) cast and explicit return 0 are for DEC UNIX
* which just #defines acl_free_text() to be free()
*/
(void) acl_free_text(text);
return 0;
}
int sys_acl_free_acl(SMB_ACL_T the_acl)
{
return acl_free(the_acl);
}
int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype)
{
return acl_free_qualifier(qual, tagtype);
}
#elif defined(HAVE_UNIXWARE_ACLS) || defined(HAVE_SOLARIS_ACLS)
/*
@ -820,7 +966,7 @@ int sys_acl_free_acl(SMB_ACL_T acl_d)
return 0;
}
int sys_acl_free_qualifier(void *qual)
int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype)
{
return 0;
}
@ -1075,7 +1221,7 @@ int sys_acl_free_acl(SMB_ACL_T acl_d)
return 0;
}
int sys_acl_free_qualifier(void *qual)
int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype)
{
return 0;
}
@ -1960,7 +2106,7 @@ int sys_acl_free_acl(SMB_ACL_T posix_acl)
return(0);
}
int sys_acl_free_qualifier(void *qual)
int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype)
{
return(0);
}
@ -2093,7 +2239,7 @@ int sys_acl_free_acl(SMB_ACL_T the_acl)
return -1;
}
int sys_acl_free_qualifier(void *qual)
int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype)
{
errno = ENOSYS;
return -1;

View File

@ -1457,7 +1457,7 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_
uid_to_sid( &sid, *puid);
unix_ug.uid = *puid;
owner_type = UID_ACE;
sys_acl_free_qualifier((void *)puid);
sys_acl_free_qualifier((void *)puid,tagtype);
break;
}
case SMB_ACL_GROUP_OBJ:
@ -1476,7 +1476,7 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_
gid_to_sid( &sid, *pgid);
unix_ug.gid = *pgid;
owner_type = GID_ACE;
sys_acl_free_qualifier((void *)pgid);
sys_acl_free_qualifier((void *)pgid,tagtype);
break;
}
case SMB_ACL_MASK: