changeset 9474:836646906a63 HEAD

acl: Don't assert-crash if removing all rights.
author Timo Sirainen <tss@iki.fi>
date Mon, 15 Jun 2009 19:38:30 -0400
parents 57a2431852f5
children 73aea4432453
files src/plugins/acl/acl-backend-vfile.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/acl/acl-backend-vfile.c	Mon Jun 15 19:40:08 2009 -0400
+++ b/src/plugins/acl/acl-backend-vfile.c	Mon Jun 15 19:38:30 2009 -0400
@@ -901,7 +901,8 @@
 				array_append(&rights, &old_rights[i], 1);
 		}
 		new_rights = &null;
-		modify_rights = array_idx(&rights, 0);
+		modify_rights = array_count(&rights) == 0 ? NULL :
+			array_idx(&rights, 0);
 		acl_rights_merge(pool, &new_rights, modify_rights, TRUE);
 		break;
 	case ACL_MODIFY_MODE_ADD: