/*
Unix SMB/Netbios implementation.
VFS module to get and set Solaris ACLs
- Copyright (C) Michael Adam 2006
+ Copyright (C) Michael Adam 2006,2008
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static bool solaris_acl_get_file(const char *name, SOLARIS_ACL_T *solarisacl,
int *count);
static bool solaris_acl_get_fd(int fd, SOLARIS_ACL_T *solarisacl, int *count);
-static bool solaris_acl_sort(SOLARIS_ACL_T acl, int count);
+static bool solaris_acl_sort(SOLARIS_ACL_T theacl, int count);
static SMB_ACL_PERM_T solaris_perm_to_smb_perm(const SOLARIS_PERM_T perm);
static SOLARIS_PERM_T smb_perm_to_solaris_perm(const SMB_ACL_PERM_T perm);
+#if 0
static bool solaris_acl_check(SOLARIS_ACL_T solaris_acl, int count);
-
+#endif
/* public functions - the api */
* get the access ACL of a file referred to by a fd
*/
SMB_ACL_T solarisacl_sys_acl_get_fd(vfs_handle_struct *handle,
- files_struct *fsp,
- int fd)
+ files_struct *fsp)
{
SMB_ACL_T result = NULL;
int count;
DEBUG(10, ("entering solarisacl_sys_acl_get_fd.\n"));
- if (!solaris_acl_get_fd(fd, &solaris_acl, &count)) {
+ if (!solaris_acl_get_fd(fsp->fh->fd, &solaris_acl, &count)) {
goto done;
}
/*
DEBUG(10, ("solarisacl_sys_acl_get_fd %s.\n",
((result == NULL) ? "failed" : "succeeded")));
SAFE_FREE(solaris_acl);
- return NULL;
+ return result;
}
int solarisacl_sys_acl_set_file(vfs_handle_struct *handle,
*/
int solarisacl_sys_acl_set_fd(vfs_handle_struct *handle,
files_struct *fsp,
- int fd, SMB_ACL_T theacl)
+ SMB_ACL_T theacl)
{
SOLARIS_ACL_T solaris_acl = NULL;
SOLARIS_ACL_T default_acl = NULL;
strerror(errno)));
goto done;
}
- if (!solaris_acl_get_fd(fd, &default_acl, &default_count)) {
+ if (!solaris_acl_get_fd(fsp->fh->fd, &default_acl, &default_count)) {
DEBUG(10, ("error getting (default) acl from fd\n"));
goto done;
}
goto done;
}
- ret = facl(fd, SETACL, count, solaris_acl);
+ ret = facl(fsp->fh->fd, SETACL, count, solaris_acl);
if (ret != 0) {
DEBUG(10, ("call of facl failed (%s).\n", strerror(errno)));
}
done:
- DEBUG(10, ("solarisacl_sys_acl_st_fd %s.\n",
- ((ret == 0) ? "succeded" : "failed" )));
+ DEBUG(10, ("solarisacl_sys_acl_set_fd %s.\n",
+ ((ret == 0) ? "succeeded" : "failed" )));
SAFE_FREE(solaris_acl);
SAFE_FREE(default_acl);
return ret;
{
bool ret = False;
int i;
- int check_which, check_rc;
DEBUG(10, ("entering smb_acl_to_solaris_acl\n"));
}
switch(solaris_entry.a_type) {
case USER:
- DEBUG(10, ("got tag type USER with uid %d\n",
- smb_entry->uid));
+ DEBUG(10, ("got tag type USER with uid %u\n",
+ (unsigned int)smb_entry->uid));
solaris_entry.a_id = (uid_t)smb_entry->uid;
break;
case GROUP:
- DEBUG(10, ("got tag type GROUP with gid %d\n",
- smb_entry->gid));
+ DEBUG(10, ("got tag type GROUP with gid %u\n",
+ (unsigned int)smb_entry->gid));
solaris_entry.a_id = (uid_t)smb_entry->gid;
break;
default:
smb_perm_to_solaris_perm(smb_entry->a_perm);
DEBUG(10, ("assembled the following solaris ace:\n"));
DEBUGADD(10, (" - type: 0x%04x\n", solaris_entry.a_type));
- DEBUGADD(10, (" - id: %d\n", solaris_entry.a_id));
+ DEBUGADD(10, (" - id: %u\n", (unsigned int)solaris_entry.a_id));
DEBUGADD(10, (" - perm: o%o\n", solaris_entry.a_perm));
if (!solaris_add_to_acl(solaris_acl, count, &solaris_entry,
1, type))
DEBUG(10, ("test, if entry has been copied into acl:\n"));
DEBUGADD(10, (" - type: 0x%04x\n",
(*solaris_acl)[(*count)-1].a_type));
- DEBUGADD(10, (" - id: %d\n",
- (*solaris_acl)[(*count)-1].a_id));
+ DEBUGADD(10, (" - id: %u\n",
+ (unsigned int)(*solaris_acl)[(*count)-1].a_id));
DEBUGADD(10, (" - perm: o%o\n",
(*solaris_acl)[(*count)-1].a_perm));
}
return True;
}
+#if 0
/*
* acl check function:
* unused at the moment but could be used to get more
}
return True;
}
-
+#endif
/* VFS operations structure */