]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/cyrus-imapd-2.3.3-deleteacl_invalid_identifier_fix.patch
GeƤndert:
[ipfire-2.x.git] / src / patches / cyrus-imapd-2.3.3-deleteacl_invalid_identifier_fix.patch
1 diff -Naur cyrus-imapd-2.3.3.orig/lib/acl_afs.c cyrus-imapd-2.3.3/lib/acl_afs.c
2 --- cyrus-imapd-2.3.3.orig/lib/acl_afs.c 2005-12-13 20:36:11.000000000 +0100
3 +++ cyrus-imapd-2.3.3/lib/acl_afs.c 2006-04-12 07:28:50.000000000 +0200
4 @@ -114,6 +114,7 @@
5 cyrus_acl_canonproc_t *canonproc;
6 void *canonrock;
7 {
8 + const char *canonid;
9 char *newidentifier = 0;
10 char *newacl;
11 char *thisid, *nextid;
12 @@ -122,9 +123,14 @@
13
14 /* Convert 'identifier' into canonical form */
15 if (*identifier == '-') {
16 - char *canonid = auth_canonifyid(identifier+1, 0);
17 + canonid = auth_canonifyid(identifier+1, 0);
18 if (!canonid) {
19 - return -1;
20 + if (access != 0L) {
21 + return -1;
22 + } else {
23 + /* trying to delete invalid/non-existent identifier */
24 + canonid = identifier+1;
25 + }
26 }
27 newidentifier = xmalloc(strlen(canonid)+2);
28 newidentifier[0] = '-';
29 @@ -135,9 +141,13 @@
30 }
31 }
32 else {
33 - identifier = auth_canonifyid(identifier, 0);
34 - if (!identifier) {
35 + canonid = auth_canonifyid(identifier, 0);
36 + if (canonid) {
37 + identifier = canonid;
38 + } else if (access != 0L) {
39 return -1;
40 + } else {
41 + /* trying to delete invalid/non-existent identifier */
42 }
43 if (canonproc) {
44 access = canonproc(canonrock, identifier, access);