patch for warnings in test programs
The attached patch fixes warnings with getsockname_secure() type functions. It's the old sockaddr_in vs sockaddr issue.
These aren't important warnings, however we should fix all warnings so that when something really goes wrong it'll be noticed.
Signature · 4 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page
libsecure/test/tcp_server.c +2 -2
@@ -84,7 +84,7 @@/* Obtain the security context of the listening socket */ sin.sin_family =AF_INET ; sinlen =sizeof (struct sockaddr_in ); - ret =getsockname_secure (s, &sin, &sinlen, &tmp_sid); + ret =getsockname_secure (s, (struct sockaddr *)&sin, &sinlen, &tmp_sid);if (ret) {perror ("getsockname_secure" );exit (1 );
@@ -139,7 +139,7 @@ inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), context);/* Obtain the new connection socket security context */ - ret =getsockname_secure (ctrl, &sin, &sinlen, &tmp_sid); + ret =getsockname_secure (ctrl, (struct sockaddr *)&sin, &sinlen, &tmp_sid);if (ret) {perror ("getsockname_secure" );exit (1 );
libsecure/test/udp_client.c +1 -1
@@ -82,7 +82,7 @@/* Obtain the security context of the server socket */ sin.sin_family =AF_INET ; sinlen =sizeof (struct sockaddr_in ); - ret =getsockname_secure (s, &sin, &sinlen, &tmp_sid); + ret =getsockname_secure (s, (struct sockaddr *)&sin, &sinlen, &tmp_sid);if (ret) {perror ("getsockname_secure" );exit (1 );
libsecure/test/tcp_client.c +1 -1
@@ -80,7 +80,7 @@/* Obtain the security context of the client socket */ sin.sin_family =AF_INET ; sinlen =sizeof (struct sockaddr_in ); - ret =getsockname_secure (s, &sin, &sinlen, &tmp_sid); + ret =getsockname_secure (s, (struct sockaddr *)&sin, &sinlen, &tmp_sid);if (ret) {perror ("getsockname_secure" );exit (1 );
libsecure/test/unix_stream_server.c +2 -2
@@ -104,7 +104,7 @@/* Obtain the security context of the listening socket */ sun.sun_family =AF_UNIX ; sunlen =sizeof (struct sockaddr_un ); - ret =getsockname_secure (s, &sun, &sunlen, &tmp_sid); + ret =getsockname_secure (s, (struct sockaddr *)&sun, &sunlen, &tmp_sid);if (ret) {perror ("getsockname_secure" );exit (1 );
@@ -172,7 +172,7 @@/* Obtain the new connection socket security context */ sunlen =sizeof (struct sockaddr_un ); - ret =getsockname_secure (ctrl, &sun, &sunlen, &tmp_sid); + ret =getsockname_secure (ctrl, (struct sockaddr *)&sun, &sunlen, &tmp_sid);if (ret) {perror ("getsockname_secure" );CLEANUP_AND_EXIT ;
libsecure/test/unix_dgram_server.c +2 -2
@@ -104,7 +104,7 @@/* Obtain the security context of the server socket */ sun.sun_family =AF_UNIX ; sunlen =sizeof (struct sockaddr_un ); - ret =getsockname_secure (s, &sun, &sunlen, &tmp_sid); + ret =getsockname_secure (s, (struct sockaddr *)&sun, &sunlen, &tmp_sid);if (ret) {perror ("getsockname_secure" );exit (1 );
@@ -170,7 +170,7 @@ &peer_sid, &msg_sid); sunlen = msg.msg_namelen; }else { - ret =recvfrom_secure (s, buf,sizeof (buf),0 , + ret =recvfrom_secure (s, (void *)buf,sizeof (buf),0 , (struct sockaddr *)&sun, &sunlen, &peer_sid, &msg_sid); }
libsecure/test/unix_stream_client.c +1 -1
@@ -96,7 +96,7 @@/* Obtain the security context of the client socket */ sun.sun_family =AF_UNIX ; sunlen =sizeof (struct sockaddr_un ); - ret =getsockname_secure (s, &sun, &sunlen, &tmp_sid); + ret =getsockname_secure (s, (struct sockaddr *)&sun, &sunlen, &tmp_sid);if (ret) {perror ("getsockname_secure" );exit (1 );
libsecure/test/udp_server.c +1 -1
@@ -78,7 +78,7 @@/* Obtain the security context of the server socket */ sin.sin_family =AF_INET ; sinlen =sizeof (struct sockaddr_in ); - ret =getsockname_secure (s, &sin, &sinlen, &tmp_sid); + ret =getsockname_secure (s, (struct sockaddr *)&sin, &sinlen, &tmp_sid);if (ret) {perror ("getsockname_secure" );exit (1 );