Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
09da966c
Commit
09da966c
authored
23 years ago
by
Patrik Stridvall
Committed by
Alexandre Julliard
23 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add proper check for existance of struct sockaddr member sa_len.
parent
207e1c18
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+47
-10
47 additions, 10 deletions
configure
configure.in
+15
-3
15 additions, 3 deletions
configure.in
dlls/rpcrt4/rpcrt4_main.c
+4
-4
4 additions, 4 deletions
dlls/rpcrt4/rpcrt4_main.c
include/config.h.in
+3
-0
3 additions, 0 deletions
include/config.h.in
with
69 additions
and
17 deletions
configure
+
47
−
10
View file @
09da966c
...
...
@@ -6840,9 +6840,9 @@ EOF
fi
echo
$ac_n
"checking "
for
s
un
_len
in
struct sockaddr
_un
"""...
$ac_c
"
1>&6
echo
"configure:6845: checking "
for
s
un
_len
in
struct sockaddr
_un
""
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_c_s
un
_len
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"checking "
for
s
a
_len
in
struct sockaddr
"""...
$ac_c
"
1>&6
echo
"configure:6845: checking "
for
s
a
_len
in
struct sockaddr
""
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_c_s
ockaddr_sa
_len
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
...
...
@@ -6850,25 +6850,62 @@ else
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
int main() {
static struct sockaddr addr; addr.sa_len = 1
; return 0; }
EOF
if
{
(
eval echo
configure:6859:
\"
$ac_compile
\"
)
1>&5
;
(
eval
$ac_compile
)
2>&5
;
}
;
then
rm
-rf
conftest
*
ac_cv_c_sockaddr_sa_len
=
"yes"
else
echo
"configure: failed program was:"
>
&5
cat
conftest.
$ac_ext
>
&5
rm
-rf
conftest
*
ac_cv_c_sockaddr_sa_len
=
"no"
fi
rm
-f
conftest
*
fi
echo
"
$ac_t
""
$ac_cv_c_sockaddr_sa_len
"
1>&6
if
test
"
$ac_cv_c_sockaddr_sa_len
"
=
"yes"
then
cat
>>
confdefs.h
<<
\
EOF
#define HAVE_SOCKADDR_SA_LEN 1
EOF
fi
echo
$ac_n
"checking "
for
sun_len
in
struct sockaddr_un
"""...
$ac_c
"
1>&6
echo
"configure:6882: checking "
for
sun_len
in
struct sockaddr_un
""
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_c_sockaddr_sun_len
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 6887 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
int main() {
static struct sockaddr_un addr; addr.sun_len = 1
; return 0; }
EOF
if
{
(
eval echo
configure:68
5
9:
\"
$ac_compile
\"
)
1>&5
;
(
eval
$ac_compile
)
2>&5
;
}
;
then
if
{
(
eval echo
configure:689
6
:
\"
$ac_compile
\"
)
1>&5
;
(
eval
$ac_compile
)
2>&5
;
}
;
then
rm
-rf
conftest
*
ac_cv_c_sun_len
=
"yes"
ac_cv_c_
sockaddr_
sun_len
=
"yes"
else
echo
"configure: failed program was:"
>
&5
cat
conftest.
$ac_ext
>
&5
rm
-rf
conftest
*
ac_cv_c_sun_len
=
"no"
ac_cv_c_
sockaddr_
sun_len
=
"no"
fi
rm
-f
conftest
*
fi
echo
"
$ac_t
""
$ac_cv_c_sun_len
"
1>&6
if
test
"
$ac_cv_c_sun_len
"
=
"yes"
echo
"
$ac_t
""
$ac_cv_c_
sockaddr_
sun_len
"
1>&6
if
test
"
$ac_cv_c_
sockaddr_
sun_len
"
=
"yes"
then
cat
>>
confdefs.h
<<
\
EOF
#define HAVE_SOCKADDR_SUN_LEN 1
...
...
@@ -6878,12 +6915,12 @@ fi
echo
$ac_n
"checking "
whether we need to define __i386__
"""...
$ac_c
"
1>&6
echo
"configure:6
882
: checking "
whether we need to define __i386__
""
>
&5
echo
"configure:6
919
: checking "
whether we need to define __i386__
""
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_cpp_def_i386
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 6
887
"configure"
#line 6
924
"configure"
#include "confdefs.h"
#if (defined(i386) || defined(__i386)) && !defined(__i386__)
yes
...
...
This diff is collapsed.
Click to expand it.
configure.in
+
15
−
3
View file @
09da966c
...
...
@@ -1154,14 +1154,26 @@ then
AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS, 1, [Define if struct msghdr contains msg_accrights])
fi
dnl *** Check for the sa_len member in struct sockaddr
AC_CACHE_CHECK("for sa_len in struct sockaddr", ac_cv_c_sockaddr_sa_len,
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
], [static struct sockaddr addr; addr.sa_len = 1],
ac_cv_c_sockaddr_sa_len="yes", ac_cv_c_sockaddr_sa_len="no"))
if test "$ac_cv_c_sockaddr_sa_len" = "yes"
then
AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if struct sockaddr contains sa_len])
fi
dnl *** Check for the sun_len member in struct sockaddr_un
AC_CACHE_CHECK("for sun_len in struct sockaddr_un", ac_cv_c_sun_len,
AC_CACHE_CHECK("for sun_len in struct sockaddr_un", ac_cv_c_
sockaddr_
sun_len,
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>], [static struct sockaddr_un addr; addr.sun_len = 1],
ac_cv_c_sun_len="yes", ac_cv_c_sun_len="no"))
if test "$ac_cv_c_sun_len" = "yes"
ac_cv_c_
sockaddr_
sun_len="yes", ac_cv_c_
sockaddr_
sun_len="no"))
if test "$ac_cv_c_
sockaddr_
sun_len" = "yes"
then
AC_DEFINE(HAVE_SOCKADDR_SUN_LEN, 1, [Define if struct sockaddr_un contains sun_len])
fi
...
...
This diff is collapsed.
Click to expand it.
dlls/rpcrt4/rpcrt4_main.c
+
4
−
4
View file @
09da966c
...
...
@@ -105,7 +105,7 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
* However, under earlier systems, sa_len isn't present, so
* the size is just sizeof(struct ifreq)
*/
#ifdef HAVE_SA_LEN
#ifdef HAVE_
SOCKADDR_
SA_LEN
# ifndef max
# define max(a,b) ((a) > (b) ? (a) : (b))
# endif
...
...
@@ -113,8 +113,8 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
# else
# define ifreq_size(i) sizeof(struct ifreq)
# endif
/*
HAVE
_SA_LEN */
# endif
/*
defined(HAVE_SOCKADDR
_SA_LEN
)
*/
sd
=
socket
(
AF_INET
,
SOCK_DGRAM
,
IPPROTO_IP
);
if
(
sd
<
0
)
{
/* if we can't open a socket, just use random numbers */
...
...
@@ -143,7 +143,7 @@ sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
}
else
{
/* loop through the interfaces, looking for a valid one */
n
=
ifc
.
ifc_len
;
for
(
i
=
0
;
i
<
n
;
i
+=
ifreq_size
(
*
ifr
)
)
{
for
(
i
=
0
;
i
<
n
;
i
+=
ifreq_size
(
ifr
)
)
{
ifrp
=
(
struct
ifreq
*
)((
char
*
)
ifc
.
ifc_buf
+
i
);
strncpy
(
ifr
.
ifr_name
,
ifrp
->
ifr_name
,
IFNAMSIZ
);
/* try to get the address for this interface */
...
...
This diff is collapsed.
Click to expand it.
include/config.h.in
+
3
−
0
View file @
09da966c
...
...
@@ -520,6 +520,9 @@
/* Define if struct msghdr contains msg_accrights */
#undef HAVE_MSGHDR_ACCRIGHTS
/* Define if struct sockaddr contains sa_len */
#undef HAVE_SOCKADDR_SA_LEN
/* Define if struct sockaddr_un contains sun_len */
#undef HAVE_SOCKADDR_SUN_LEN
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment