The acl_t type is already a pointer to a structure, so there's no
reason to be passing around pointers to acl_t in acl_entry_count() and
acl_is_minimal(). This commit changes their signatures and call sites.
* @brief Determine the number of entries in the given ACL.
*
* @param acl
* @brief Determine the number of entries in the given ACL.
*
* @param acl
- * A pointer to an @c acl_t structure.
*
* @return Either the non-negative number of entries in @c acl, or
* @c ACL_ERROR on error.
*/
*
* @return Either the non-negative number of entries in @c acl, or
* @c ACL_ERROR on error.
*/
-int acl_entry_count(acl_t* acl) {
+int acl_entry_count(acl_t acl) {
acl_entry_t entry;
int entry_count = 0;
acl_entry_t entry;
int entry_count = 0;
- int result = acl_get_entry(*acl, ACL_FIRST_ENTRY, &entry);
+ int result = acl_get_entry(acl, ACL_FIRST_ENTRY, &entry);
while (result == ACL_SUCCESS) {
entry_count++;
while (result == ACL_SUCCESS) {
entry_count++;
- result = acl_get_entry(*acl, ACL_NEXT_ENTRY, &entry);
+ result = acl_get_entry(acl, ACL_NEXT_ENTRY, &entry);
}
if (result == ACL_ERROR) {
}
if (result == ACL_ERROR) {
* An ACL is minimal if it has fewer than four entries.
*
* @param acl
* An ACL is minimal if it has fewer than four entries.
*
* @param acl
- * A pointer to an acl_t structure.
+ * The ACL whose minimality is in question.
*
* @return
* - @c ACL_SUCCESS - @c acl is minimal
* - @c ACL_FAILURE - @c acl is not minimal
* - @c ACL_ERROR - Unexpected library error
*/
*
* @return
* - @c ACL_SUCCESS - @c acl is minimal
* - @c ACL_FAILURE - @c acl is not minimal
* - @c ACL_ERROR - Unexpected library error
*/
-int acl_is_minimal(acl_t* acl) {
+int acl_is_minimal(acl_t acl) {
int ec = acl_entry_count(acl);
int ec = acl_entry_count(acl);
/* Our return value. */
int result = ACL_FAILURE;
/* Our return value. */
int result = ACL_FAILURE;
- if (acl_is_minimal(&acl)) {
+ if (acl_is_minimal(acl)) {
mode_t mode = get_mode(path);
if (mode & (S_IXUSR | S_IXOTH | S_IXGRP)) {
result = ACL_SUCCESS;
mode_t mode = get_mode(path);
if (mode & (S_IXUSR | S_IXOTH | S_IXGRP)) {
result = ACL_SUCCESS;