/[monit]/monit/protocols/ldap3.c
ViewVC logotype

Diff of /monit/protocols/ldap3.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by martinp, Sun Jun 22 18:02:33 2003 UTC revision 1.6 by hauk, Thu Jul 24 00:35:25 2003 UTC
# Line 48  Line 48 
48   *   *
49   *  @file   *  @file
50   */   */
51  int check_ldap3(Port_T p) {  int check_ldap3(Socket_T s) {
52    
53    unsigned char buf[STRLEN];    unsigned char buf[STRLEN];
54    
# Line 114  int check_ldap3(Port_T p) { Line 114  int check_ldap3(Port_T p) {
114    
115    };    };
116    
117    ASSERT(p);    ASSERT(s);
118    
119    
120    if(port_send(p, (unsigned char *)request, sizeof(request), 0) < 0) {    if(socket_write(s, (unsigned char *)request, sizeof(request)) < 0) {
121      log("LDAP: error sending data -- %s\n", STRERROR);      log("LDAP: error sending data -- %s\n", STRERROR);
122      return FALSE;      return FALSE;
123    }    }
124    
125    if(port_recv(p, (unsigned char *)buf, sizeof(buf), 0) <= 0) {    if(socket_read(s, (unsigned char *)buf, sizeof(buf)) <= 0) {
126      log("LDAP: error receiving data -- %s\n", STRERROR);      log("LDAP: error receiving data -- %s\n", STRERROR);
127      return FALSE;      return FALSE;
128    }    }
129    
130    if(strncmp((unsigned char *)buf, (unsigned char *)response, sizeof(response))) {    if(strncmp((unsigned char *)buf,
131                 (unsigned char *)response,
132                 sizeof(response))) {
133      log("LDAP: anonymous bind failed\n");      log("LDAP: anonymous bind failed\n");
134      return FALSE;      return FALSE;
135    }    }
136    
137    if(port_send(p, (unsigned char *)unbind, sizeof(unbind), 0) < 0) {    if(socket_write(s, (unsigned char *)unbind, sizeof(unbind)) < 0) {
138      log("LDAP: error sending data -- %s\n", STRERROR);      log("LDAP: error sending data -- %s\n", STRERROR);
139      return FALSE;      return FALSE;
140    }    }
141    
   
142    return TRUE;    return TRUE;
143            
144  }  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26