~ubuntu-branches/ubuntu/karmic/cyrus-imapd-2.2/karmic

« back to all changes in this revision

Viewing changes to debian/patches/0002-allow_invalid_id_acl_removal.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-07-11 18:51:39 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060711185139-gl3oe4tppp7g3euf
Tags: 2.2.13-4ubuntu1
Synchronize with Debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## fileHfCUIw.dpatch by Sven Mueller <debian@incase.de>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: No description.
 
6
 
 
7
@DPATCH@
 
8
diff -urNad cyrus-imapd-2.2.13/lib/acl_afs.c /tmp/dpep.4TxSCg/cyrus-imapd-2.2.13/lib/acl_afs.c
 
9
--- cyrus-imapd-2.2.13/lib/acl_afs.c    2005-03-12 23:09:22.000000000 +0100
 
10
+++ /tmp/dpep.4TxSCg/cyrus-imapd-2.2.13/lib/acl_afs.c   2006-05-03 15:27:47.049193574 +0200
 
11
@@ -114,6 +114,7 @@
 
12
 cyrus_acl_canonproc_t *canonproc;
 
13
 void *canonrock;
 
14
 {
 
15
+    const char *canonid;
 
16
     char *newidentifier = 0;
 
17
     char *newacl;
 
18
     char *thisid, *nextid;
 
19
@@ -122,9 +123,14 @@
 
20
 
 
21
     /* Convert 'identifier' into canonical form */
 
22
     if (*identifier == '-') {
 
23
-       char *canonid = auth_canonifyid(identifier+1, 0);
 
24
+       canonid = auth_canonifyid(identifier+1, 0);
 
25
        if (!canonid) {
 
26
-           return -1;
 
27
+           if (access != 0L) {
 
28
+               return -1;
 
29
+           } else {
 
30
+               /* trying to delete invalid/non-existent identifier */
 
31
+               canonid = identifier+1;
 
32
+           }
 
33
        }
 
34
        newidentifier = xmalloc(strlen(canonid)+2);
 
35
        newidentifier[0] = '-';
 
36
@@ -135,9 +141,13 @@
 
37
        }
 
38
     }
 
39
     else {
 
40
-       identifier = auth_canonifyid(identifier, 0);
 
41
-       if (!identifier) {
 
42
+       canonid = auth_canonifyid(identifier, 0);
 
43
+       if (canonid) {
 
44
+           identifier = canonid;
 
45
+       } else if (access != 0L) {
 
46
            return -1;
 
47
+       } else {
 
48
+           /* trying to delete invalid/non-existent identifier */
 
49
        }
 
50
        if (canonproc) {
 
51
            access = canonproc(canonrock, identifier, access);