summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-12-19 18:41:51 +0000
committerJeremy Allison <jra@samba.org>2000-12-19 18:41:51 +0000
commited7ecca3aa12afab6feb5cf176a84a76994c9194 (patch)
tree2dd5373c8e6ed6802d6950bfe856621329ab4f7a
parente28f0a1f55fb8184f1edfb0bd8333f3d71e12225 (diff)
downloadsamba-ed7ecca3aa12afab6feb5cf176a84a76994c9194.tar.gz
samba-ed7ecca3aa12afab6feb5cf176a84a76994c9194.tar.bz2
samba-ed7ecca3aa12afab6feb5cf176a84a76994c9194.zip
Split the one sys_acl_free call into sys_acl_free_TYPE calls, to allow
easier wrapping of non-POSIX ACL interfaces. Jeremy. (This used to be commit 1a31b4eb082b23d60e3d9040b3c0110eef1f9385)
-rw-r--r--source3/include/proto.h12
-rw-r--r--source3/lib/sysacls.c43
-rw-r--r--source3/smbd/posix_acls.c6
3 files changed, 42 insertions, 19 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 2112187865..d54f26dd0b 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -17,9 +17,6 @@ void cmd_tar(void);
int process_tar(void);
int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind);
-/*The following definitions come from groupdb/mapping.c */
-
-
/*The following definitions come from lib/access.c */
BOOL allow_access(char *deny_list,char *allow_list,
@@ -250,22 +247,24 @@ int sys_acl_get_permset( SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p);
void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d);
SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type);
SMB_ACL_T sys_acl_get_fd(int fd);
-int sys_acl_free( void *obj_p);
int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset);
int sys_acl_add_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
int sys_acl_get_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
char *sys_acl_to_text( SMB_ACL_T the_acl, ssize_t *plen);
+int sys_acl_free_text(char *text);
+int sys_acl_free_acl(SMB_ACL_T the_acl) ;
int sys_acl_get_entry( SMB_ACL_T the_acl, int entry_id, SMB_ACL_ENTRY_T *entry_p);
int sys_acl_get_tag_type( SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p);
int sys_acl_get_permset( SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p);
void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d);
SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type);
SMB_ACL_T sys_acl_get_fd(int fd);
-int sys_acl_free( void *obj_p);
int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset);
int sys_acl_add_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
int sys_acl_get_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
char *sys_acl_to_text( SMB_ACL_T the_acl, ssize_t *plen);
+int sys_acl_free_text(char *text);
+int sys_acl_free_acl(SMB_ACL_T the_acl) ;
/*The following definitions come from lib/system.c */
@@ -668,6 +667,9 @@ uint32 cli_lsa_lookup_sids(struct cli_state *cli, POLICY_HND *hnd,
uint32 cli_lsa_lookup_names(struct cli_state *cli, POLICY_HND *hnd,
int num_names, char **names, DOM_SID **sids,
uint32 **types, int *num_sids);
+uint32 cli_lsa_query_info_policy(struct cli_state *cli, POLICY_HND *hnd,
+ uint16 info_class, fstring domain_name,
+ DOM_SID * domain_sid);
/*The following definitions come from libsmb/cliconnect.c */
diff --git a/source3/lib/sysacls.c b/source3/lib/sysacls.c
index e2cf535d3e..6f26ff8007 100644
--- a/source3/lib/sysacls.c
+++ b/source3/lib/sysacls.c
@@ -36,7 +36,6 @@ extern int DEBUGLEVEL;
void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d)
SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type)
SMB_ACL_T sys_acl_get_fd(int fd)
- int sys_acl_free( void *obj_p)
int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset);
int sys_acl_add_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm);
char *sys_acl_to_text( SMB_ACL_T acl, ssize_t *plen)
@@ -45,6 +44,18 @@ extern int DEBUGLEVEL;
More POSIX braindamage.
int sys_acl_get_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
+
+ The generic POSIX free is the following call. We split this into
+ several different free functions as we may need to add tag info
+ to structures when emulating the POSIX interface.
+
+ int sys_acl_free( void *obj_p)
+
+ The calls we actually use are :
+
+ int sys_acl_free_text(char *text) - free acl_to_text
+ int sys_acl_free_acl(SMB_ACL_T posix_acl)
+
*/
#if defined(HAVE_POSIX_ACLS)
@@ -81,11 +92,6 @@ SMB_ACL_T sys_acl_get_fd(int fd)
return acl_get_fd(fd);
}
-int sys_acl_free( void *obj_p)
-{
- return acl_free(obj_p);
-}
-
int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset)
{
return acl_clear_perms(permset);
@@ -106,6 +112,16 @@ char *sys_acl_to_text( SMB_ACL_T the_acl, ssize_t *plen)
return acl_to_text( the_acl, plen);
}
+int sys_acl_free_text(char *text)
+{
+ return acl_free(text);
+}
+
+int sys_acl_free_acl(SMB_ACL_T the_acl)
+{
+ return acl_free(the_acl);
+}
+
#elif defined(HAVE_SOLARIS_ACLS)
#elif defined(HAVE_IRIX_ACLS)
@@ -142,11 +158,6 @@ SMB_ACL_T sys_acl_get_fd(int fd)
return (SMB_ACL_T)NULL;
}
-int sys_acl_free( void *obj_p)
-{
- return -1;
-}
-
int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset)
{
return -1;
@@ -166,4 +177,14 @@ char *sys_acl_to_text( SMB_ACL_T the_acl, ssize_t *plen)
{
return NULL;
}
+
+int sys_acl_free_text(char *text)
+{
+ return -1;
+}
+
+int sys_acl_free_acl(SMB_ACL_T the_acl)
+{
+ return -1;
+}
#endif /* No ACLs. */
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index bc27ea9ae2..7b8d693a1d 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -544,7 +544,7 @@ static canon_ace *canonicalise_acl( SMB_ACL_T posix_acl, SMB_STRUCT_STAT *psbuf)
dbgtext("canonicalize_acl: processed acl %s\n", acl_text == NULL ? "NULL" : acl_text );
if (acl_text)
- sys_acl_free(acl_text);
+ sys_acl_free_text(acl_text);
}
return list_head;
@@ -688,9 +688,9 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc)
done:
if (posix_acl)
- sys_acl_free(posix_acl);
+ sys_acl_free_acl(posix_acl);
if (dir_acl)
- sys_acl_free(dir_acl);
+ sys_acl_free_acl(dir_acl);
if (file_ace)
free_canon_ace_list(file_ace);
if (dir_ace)