~ubuntu-branches/ubuntu/oneiric/likewise-open/oneiric

« back to all changes in this revision

Viewing changes to packaging/debian/patches/nss_errno.patch

  • Committer: Bazaar Package Importer
  • Author(s): Rick Clark
  • Date: 2008-08-27 08:56:20 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080827085620-5q0f58b9qtog9myq
Tags: 4.1.0.2956-0ubuntu1
* missing-likewise-logo.diff: removed
* fixed copyright notice
* updated Standards-Version to 3.8.0
* removed path from command in prerm
* removed stop in S runlevel

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: likewise-open-4.1.2956/samba/source/nsswitch/wb_common.c
 
2
===================================================================
 
3
--- likewise-open-4.1.2956.orig/samba/source/nsswitch/wb_common.c       2008-08-12 12:36:20.000000000 -0500
 
4
+++ likewise-open-4.1.2956/samba/source/nsswitch/wb_common.c    2008-08-12 12:39:55.000000000 -0500
 
5
@@ -176,11 +176,13 @@
 
6
        /* Check permissions on unix socket directory */
 
7
 
 
8
        if (lstat(dir, &st) == -1) {
 
9
+               errno = ENOENT;
 
10
                return -1;
 
11
        }
 
12
 
 
13
        if (!S_ISDIR(st.st_mode) ||
 
14
            (st.st_uid != 0 && st.st_uid != geteuid())) {
 
15
+               errno = ENOENT;
 
16
                return -1;
 
17
        }
 
18
 
 
19
@@ -199,6 +201,7 @@
 
20
           the winbindd daemon is not running. */
 
21
 
 
22
        if (lstat(path, &st) == -1) {
 
23
+               errno = ENOENT;
 
24
                SAFE_FREE(path);
 
25
                return -1;
 
26
        }
 
27
@@ -208,6 +211,7 @@
 
28
 
 
29
        if (!S_ISSOCK(st.st_mode) ||
 
30
            (st.st_uid != 0 && st.st_uid != geteuid())) {
 
31
+               errno = ENOENT;
 
32
                return -1;
 
33
        }
 
34
 
 
35
@@ -368,6 +372,7 @@
 
36
  restart:
 
37
        
 
38
        if (winbind_open_pipe_sock(recursing, need_priv) == -1) {
 
39
+               errno = ENOENT;
 
40
                return -1;
 
41
        }
 
42
        
 
43
@@ -576,7 +581,11 @@
 
44
        
 
45
        if (winbind_write_sock(request, sizeof(*request),
 
46
                               request->wb_flags & WBFLAG_RECURSE,
 
47
-                              need_priv) == -1) {
 
48
+                              need_priv) == -1) 
 
49
+       {
 
50
+               /* Set ENOENT for consistency.  Required by some apps */
 
51
+               errno = ENOENT;
 
52
+               
 
53
                return NSS_STATUS_UNAVAIL;
 
54
        }
 
55
 
 
56
@@ -584,7 +593,11 @@
 
57
            (winbind_write_sock(request->extra_data.data,
 
58
                                request->extra_len,
 
59
                                request->wb_flags & WBFLAG_RECURSE,
 
60
-                               need_priv) == -1)) {
 
61
+                               need_priv) == -1)) 
 
62
+       {
 
63
+               /* Set ENOENT for consistency.  Required by some apps */
 
64
+               errno = ENOENT;
 
65
+
 
66
                return NSS_STATUS_UNAVAIL;
 
67
        }
 
68
        
 
69
@@ -608,6 +621,9 @@
 
70
 
 
71
        /* Wait for reply */
 
72
        if (winbindd_read_reply(response) == -1) {
 
73
+               /* Set ENOENT for consistency.  Required by some apps */
 
74
+               errno = ENOENT;
 
75
+
 
76
                return NSS_STATUS_UNAVAIL;
 
77
        }
 
78