]> git.sur5r.net Git - openldap/commitdiff
Do not attempt to obtain sizeof(sin_addr.s_addr) or &sin_addr.s_addr
authorKurt Zeilenga <kurt@openldap.org>
Sat, 30 Oct 1999 04:58:06 +0000 (04:58 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 30 Oct 1999 04:58:06 +0000 (04:58 +0000)
as s_addr member of in_addr may be a bitfield.

clients/finger/main.c
clients/gopher/go500.c
clients/gopher/go500gw.c
include/ldap.h
libraries/libldap/cldap.c
libraries/libldap/os-ip.c
servers/ldapd/main.c
servers/ldapd/message.c
servers/slapd/daemon.c

index 5e84fe4916bc8cca28988d0cfacaf608a9bf21f5..45b0d90ac3db8b11e350c302392c5de53b6846ff 100644 (file)
@@ -136,8 +136,8 @@ main( int argc, char **argv )
        }
 
        if ( dosyslog && !interactive ) {
-               hp = gethostbyaddr( (char *) &peername.sin_addr.s_addr,
-                                   sizeof(peername.sin_addr.s_addr), AF_INET );
+               hp = gethostbyaddr( (char *) &peername.sin_addr,
+                                   sizeof(peername.sin_addr), AF_INET );
                syslog( LOG_INFO, "connection from %s (%s)",
                        (hp == NULL) ? "unknown" : hp->h_name,
                        inet_ntoa( peername.sin_addr ) );
index e8342fc4a61b5ca93fafaaa7610ac36af0895fcb..ff3bb2254e51bd90b830968a28424482566108bc 100644 (file)
@@ -203,8 +203,8 @@ main( int argc, char **argv )
                fromlen = sizeof(from);
                if ( getpeername( 0, (struct sockaddr *) &from, &fromlen )
                    == 0 ) {
-                       hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr),
-                           sizeof(from.sin_addr.s_addr), AF_INET );
+                       hp = gethostbyaddr( (char *) &(from.sin_addr),
+                           sizeof(from.sin_addr), AF_INET );
                        Debug( LDAP_DEBUG_ARGS, "connection from %s (%s)\n",
                            (hp == NULL) ? "unknown" : hp->h_name,
                            inet_ntoa( from.sin_addr ), 0 );
@@ -247,8 +247,8 @@ main( int argc, char **argv )
                        exit( EXIT_FAILURE );
                }
 
-               hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr),
-                   sizeof(from.sin_addr.s_addr), AF_INET );
+               hp = gethostbyaddr( (char *) &(from.sin_addr),
+                   sizeof(from.sin_addr), AF_INET );
 
                if ( dosyslog ) {
                        syslog( LOG_INFO, "TCP connection from %s (%s)",
index c1c5ab4a9ef47c556e3823f66d3ce195aedeb13f..21939f3ca55b56c29f0618f7d519f0fd0d43338c 100644 (file)
@@ -226,8 +226,8 @@ main (int  argc, char **argv )
                fromlen = sizeof(from);
                if ( getpeername( 0, (struct sockaddr *) &from, &fromlen )
                    == 0 ) {
-                       hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr),
-                           sizeof(from.sin_addr.s_addr), AF_INET );
+                       hp = gethostbyaddr( (char *) &(from.sin_addr),
+                           sizeof(from.sin_addr), AF_INET );
                        Debug( LDAP_DEBUG_ARGS, "connection from %s (%s)\n",
                            (hp == NULL) ? "unknown" : hp->h_name,
                            inet_ntoa( from.sin_addr ), 0 );
@@ -272,8 +272,8 @@ main (int  argc, char **argv )
                        exit( EXIT_FAILURE );
                }
 
-               hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr),
-                   sizeof(from.sin_addr.s_addr), AF_INET );
+               hp = gethostbyaddr( (char *) &(from.sin_addr),
+                   sizeof(from.sin_addr), AF_INET );
 
                if ( dosyslog ) {
                        syslog( LOG_INFO, "TCP connection from %s (%s)",
index cda3ad767af4023db749a2fb6139cb895dedc09c..9a5ed0bb170751519ca37db66d680647a9aec953 100644 (file)
@@ -170,10 +170,16 @@ typedef struct ldapcontrol {
 
 #define LDAP_CONTROL_MANAGEDSAIT "2.16.840.1.113730.3.4.2"
 
+/* Experimental Controls */
+#define LDAP_CONTROL_X_PASSWD_MOD_REQ "1.3.6.1.4.1.4203.666.5.1"
+#define LDAP_CONTROL_X_PASSWD_MOD_RES "1.3.6.1.4.1.4203.666.5.1"
+
+
 /* LDAP Unsolicited Notifications */
 #define        LDAP_NOTICE_OF_DISCONNECTION    "1.3.6.1.4.1.1466.20036"
 #define LDAP_NOTICE_DISCONNECT LDAP_NOTICE_OF_DISCONNECTION
 
+
 /* LDAP Extended Operations */
 
 
index de6208136b3d5f89b6d1c0df4b3b531a6239c800..46872b47413cad3deae2cd1721d3c4dee76a334a 100644 (file)
@@ -129,9 +129,9 @@ cldap_open( LDAP_CONST char *host, int port )
                }
 
                for ( i = 0; hp->h_addr_list[ i ] != 0; ++i ) {
-                   SAFEMEMCPY( (char *)&sock.sin_addr.s_addr,
+                   SAFEMEMCPY( (char *)&sock.sin_addr,
                            (char *)hp->h_addr_list[ i ],
-                           sizeof(sock.sin_addr.s_addr));
+                           sizeof(sock.sin_addr));
                    if ( add_addr( ld, (struct sockaddr *)&sock ) < 0 ) {
                        ldap_ld_free( ld, 1, NULL, NULL );
                        LDAP_FREE( host_dup );
index 0ed3c90046549b4d52f804dd3e4a2c8b54962cc7..beba17ebbf26dc3e0a41d613de6c8f805747bcb4 100644 (file)
@@ -303,9 +303,9 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb, const char *host,
                (void)memset((char *)&sin, 0, sizeof(struct sockaddr_in));
                sin.sin_family = AF_INET;
                sin.sin_port = port;
-               p = (char *)&sin.sin_addr.s_addr;
+               p = (char *)&sin.sin_addr;
                q = use_hp ? (char *)hp->h_addr_list[i] : (char *)&address;
-               SAFEMEMCPY(p, q, sizeof(p) );
+               SAFEMEMCPY(p, q, sizeof(sin.sin_addr) );
 
                osip_debug(ld, "ldap_connect_to_host: Trying %s:%d\n", 
                                inet_ntoa(sin.sin_addr),ntohs(sin.sin_port),0);
index 764f4e9c094e8267595f4baebe4541d97d77dc92..193f7446d05ec519351346936544028cb7627e0a 100644 (file)
@@ -319,8 +319,8 @@ main( int argc, char **argv )
                len = sizeof(from);
                if ( getpeername( ns, (struct sockaddr *) &from, &len )
                    == 0 ) {
-                       hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr),
-                       sizeof(from.sin_addr.s_addr), AF_INET );
+                       hp = gethostbyaddr( (char *) &(from.sin_addr),
+                       sizeof(from.sin_addr), AF_INET );
                        Debug( LDAP_DEBUG_ARGS, "connection from %s (%s)\n",
                            (hp == NULL) ? "unknown" : hp->h_name,
                            inet_ntoa( from.sin_addr ), 0 );
@@ -401,8 +401,8 @@ main( int argc, char **argv )
                        continue;
                }
 
-               hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr),
-                   sizeof(from.sin_addr.s_addr), AF_INET );
+               hp = gethostbyaddr( (char *) &(from.sin_addr),
+                   sizeof(from.sin_addr), AF_INET );
 
 #ifdef HAVE_TCPD
                if ( !hosts_ctl("ldapd", (hp == NULL) ? "unknown" : hp->h_name,
index f9aa99309e7bdc97b613820840567fd8cf962421..23a56c794a53ddb14065ee125a1f1a247fe70e3c 100644 (file)
@@ -165,8 +165,8 @@ get_cldap_msg(
                    tmp->m_msgtype == msgtype &&
                    ((struct sockaddr_in *)&tmp->m_clientaddr)->sin_port ==
                    ((struct sockaddr_in *)fromaddr)->sin_port &&
-                   ((struct sockaddr_in *)&tmp->m_clientaddr)->sin_addr.s_addr
-                   == ((struct sockaddr_in *)fromaddr)->sin_addr.s_addr ) {
+                   ((struct sockaddr_in *)&tmp->m_clientaddr)->sin_addr
+                   == ((struct sockaddr_in *)fromaddr)->sin_addr ) {
                        break;
                }
        }
index ffcf29e23d2dfbd61bee2c3b6ce2f1d4f9d68c21..f7072e1c12d49bc3694427056b00e757d8665ebd 100644 (file)
@@ -664,8 +664,8 @@ slapd_daemon_task(
 
 #if defined(SLAPD_RLOOKUPS) || defined(HAVE_TCPD)
                        hp = gethostbyaddr( (char *)
-                           &(from.sin_addr.s_addr),
-                           sizeof(from.sin_addr.s_addr), AF_INET );
+                           &(from.sin_addr),
+                           sizeof(from.sin_addr), AF_INET );
 
                        if(hp) {
                                dnsname = ldap_pvt_str2lower( hp->h_name );