changeset 9127:01fae3737994 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 b745911012bb
children ca486f917810
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 00:01:39 2009 -0400
+++ b/src/plugins/acl/acl-backend-vfile.c	Mon Jun 15 19:38:30 2009 -0400
@@ -900,7 +900,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: