File: 05_unlock.dpatch

package info (click to toggle)
solid-pop3d 0.15-23
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 896 kB
  • ctags: 448
  • sloc: ansic: 6,085; sh: 4,682; makefile: 527
file content (66 lines) | stat: -rw-r--r-- 1,828 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh -e
## 05_unlock.dpatch by Robert Luberda <robert@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: patches for #184790 and #184793

if [ $# -lt 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

@DPATCH@
diff -Nur solid-pop3d-0.15/src/mailbox.c solid-pop3d-0.15-5/src/mailbox.c
--- solid-pop3d-0.15/src/mailbox.c	2000-05-13 15:18:33.000000000 +0200
+++ solid-pop3d-0.15-5/src/mailbox.c	2004-01-25 17:13:32.000000000 +0100
@@ -667,8 +713,14 @@
 
 void mb_release(void)
 {
-	if (mailboxfd > 0)
+	if (mailboxfd > 0) {
+		/* 
+		 * Debian bug #184793 - we should unlock mailbox if server dies
+		 * robert@debian.org, Apr 4th, 2003
+		 */
+		unlock_mailbox();
 		close(mailboxfd);
+	}
 	md_free();
 }
 
diff -Nur solid-pop3d-0.15/src/main.c solid-pop3d-0.15-5/src/main.c
--- solid-pop3d-0.15/src/main.c	2000-05-13 15:18:40.000000000 +0200
+++ solid-pop3d-0.15-5/src/main.c	2004-01-25 17:13:32.000000000 +0100
@@ -385,9 +385,18 @@
 	if (fd < 0) {
 	/* It runs with user privileges, so users can do what they want */
 		pop_log(pop_priority, "can't open or create file: %.1024s", userbullfile);
+#ifdef DEBIAN		
+		/*
+		 * see Debian bug #184970
+		 * robert@debian.org, Apr 4th, 2003
+		 */
+		maildrop->md_end_of_adding();
+		return;
+#else			
 		pop_error("open");
 		send_error("fatal error");
 		exit(1);
+#endif		
 	};
 	if (fstat(fd, &stbuf) < 0) {
 		close(fd);