Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
15683369
Commit
15683369
authored
Mar 16, 2005
by
Mark Andrews
Browse files
namespace sun -> sunix
parent
eaccf5e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
lib/isc/include/isc/sockaddr.h
View file @
15683369
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sockaddr.h,v 1.4
5
2005/0
2/24 00:33:34
marka Exp $ */
/* $Id: sockaddr.h,v 1.4
6
2005/0
3/16 23:39:06
marka Exp $ */
#ifndef ISC_SOCKADDR_H
#define ISC_SOCKADDR_H 1
...
...
@@ -33,7 +33,7 @@ struct isc_sockaddr {
struct
sockaddr_in
sin
;
struct
sockaddr_in6
sin6
;
#ifdef ISC_PLATFORM_HAVESYSUNH
struct
sockaddr_un
sun
;
struct
sockaddr_un
sun
ix
;
#endif
}
type
;
unsigned
int
length
;
/* XXXRTH beginning? */
...
...
lib/isc/netaddr.c
View file @
15683369
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: netaddr.c,v 1.3
3
2005/03/16 2
0:15
:0
8
marka Exp $ */
/* $Id: netaddr.c,v 1.3
4
2005/03/16 2
3:39
:0
5
marka Exp $ */
#include
<config.h>
...
...
@@ -349,7 +349,7 @@ isc_netaddr_fromsockaddr(isc_netaddr_t *t, const isc_sockaddr_t *s) {
break
;
#ifdef ISC_PLATFORM_HAVESYSUNH
case
AF_UNIX
:
memcpy
(
t
->
type
.
un
,
s
->
type
.
sun
.
sun_path
,
sizeof
(
t
->
type
.
un
));
memcpy
(
t
->
type
.
un
,
s
->
type
.
sun
ix
.
sun_path
,
sizeof
(
t
->
type
.
un
));
t
->
zone
=
0
;
break
;
#endif
...
...
lib/isc/sockaddr.c
View file @
15683369
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sockaddr.c,v 1.6
3
2005/0
2/24 00:33:33
marka Exp $ */
/* $Id: sockaddr.c,v 1.6
4
2005/0
3/16 23:39:05
marka Exp $ */
#include
<config.h>
...
...
@@ -132,11 +132,11 @@ isc_sockaddr_totext(const isc_sockaddr_t *sockaddr, isc_buffer_t *target) {
break
;
#ifdef ISC_PLAFORM_HAVESYSUNH
case
AF_UNIX
:
plen
=
strlen
(
sockaddr
->
type
.
sun
.
sun_path
);
plen
=
strlen
(
sockaddr
->
type
.
sun
ix
.
sun_path
);
if
(
plen
>=
isc_buffer_availablelength
(
target
))
return
(
ISC_R_NOSPACE
);
isc_buffer_putmem
(
target
,
sockaddr
->
type
.
sun
.
sun_path
,
plen
);
isc_buffer_putmem
(
target
,
sockaddr
->
type
.
sun
ix
.
sun_path
,
plen
);
/*
* Null terminate after used region.
...
...
@@ -482,15 +482,15 @@ isc_sockaddr_islinklocal(isc_sockaddr_t *sockaddr) {
isc_result_t
isc_sockaddr_frompath
(
isc_sockaddr_t
*
sockaddr
,
const
char
*
path
)
{
#ifdef ISC_PLATFORM_HAVESYSUNH
if
(
strlen
(
path
)
>=
sizeof
(
sockaddr
->
type
.
sun
.
sun_path
))
if
(
strlen
(
path
)
>=
sizeof
(
sockaddr
->
type
.
sun
ix
.
sun_path
))
return
(
ISC_R_NOSPACE
);
memset
(
sockaddr
,
0
,
sizeof
(
*
sockaddr
));
sockaddr
->
length
=
sizeof
(
sockaddr
->
type
.
sun
);
sockaddr
->
type
.
sun
.
sun_family
=
AF_UNIX
;
sockaddr
->
length
=
sizeof
(
sockaddr
->
type
.
sun
ix
);
sockaddr
->
type
.
sun
ix
.
sun_family
=
AF_UNIX
;
#ifdef ISC_PLATFORM_HAVESALEN
sockaddr
->
type
.
sun
.
sun_len
=
sizeof
(
sockaddr
->
type
.
sun
);
sockaddr
->
type
.
sun
ix
.
sun_len
=
sizeof
(
sockaddr
->
type
.
sun
ix
);
#endif
strcpy
(
sockaddr
->
type
.
sun
.
sun_path
,
path
);
strcpy
(
sockaddr
->
type
.
sun
ix
.
sun_path
,
path
);
return
(
ISC_R_SUCCESS
);
#else
UNUSED
(
sockaddr
);
...
...
lib/isc/unix/socket.c
View file @
15683369
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: socket.c,v 1.24
6
2005/03/1
5 01:41:28
marka Exp $ */
/* $Id: socket.c,v 1.24
7
2005/03/1
6 23:39:06
marka Exp $ */
#include
<config.h>
...
...
@@ -2891,27 +2891,27 @@ isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) {
#endif
if
(
active
)
{
if
(
stat
(
sockaddr
->
type
.
sun
.
sun_path
,
&
sb
)
<
0
)
{
if
(
stat
(
sockaddr
->
type
.
sun
ix
.
sun_path
,
&
sb
)
<
0
)
{
isc__strerror
(
errno
,
strbuf
,
sizeof
(
strbuf
));
isc_log_write
(
isc_lctx
,
ISC_LOGCATEGORY_GENERAL
,
ISC_LOGMODULE_SOCKET
,
ISC_LOG_ERROR
,
"isc_socket_cleanunix: stat(%s): %s"
,
sockaddr
->
type
.
sun
.
sun_path
,
strbuf
);
sockaddr
->
type
.
sun
ix
.
sun_path
,
strbuf
);
return
;
}
if
(
!
(
S_ISSOCK
(
sb
.
st_mode
)
||
S_ISFIFO
(
sb
.
st_mode
)))
{
isc_log_write
(
isc_lctx
,
ISC_LOGCATEGORY_GENERAL
,
ISC_LOGMODULE_SOCKET
,
ISC_LOG_ERROR
,
"isc_socket_cleanunix: %s: not a socket"
,
sockaddr
->
type
.
sun
.
sun_path
);
sockaddr
->
type
.
sun
ix
.
sun_path
);
return
;
}
if
(
unlink
(
sockaddr
->
type
.
sun
.
sun_path
)
<
0
)
{
if
(
unlink
(
sockaddr
->
type
.
sun
ix
.
sun_path
)
<
0
)
{
isc__strerror
(
errno
,
strbuf
,
sizeof
(
strbuf
));
isc_log_write
(
isc_lctx
,
ISC_LOGCATEGORY_GENERAL
,
ISC_LOGMODULE_SOCKET
,
ISC_LOG_ERROR
,
"isc_socket_cleanunix: unlink(%s): %s"
,
sockaddr
->
type
.
sun
.
sun_path
,
strbuf
);
sockaddr
->
type
.
sun
ix
.
sun_path
,
strbuf
);
}
return
;
}
...
...
@@ -2922,11 +2922,11 @@ isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) {
isc_log_write
(
isc_lctx
,
ISC_LOGCATEGORY_GENERAL
,
ISC_LOGMODULE_SOCKET
,
ISC_LOG_WARNING
,
"isc_socket_cleanunix: socket(%s): %s"
,
sockaddr
->
type
.
sun
.
sun_path
,
strbuf
);
sockaddr
->
type
.
sun
ix
.
sun_path
,
strbuf
);
return
;
}
if
(
stat
(
sockaddr
->
type
.
sun
.
sun_path
,
&
sb
)
<
0
)
{
if
(
stat
(
sockaddr
->
type
.
sun
ix
.
sun_path
,
&
sb
)
<
0
)
{
switch
(
errno
)
{
case
ENOENT
:
/* We exited cleanly last time */
break
;
...
...
@@ -2935,7 +2935,7 @@ isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) {
isc_log_write
(
isc_lctx
,
ISC_LOGCATEGORY_GENERAL
,
ISC_LOGMODULE_SOCKET
,
ISC_LOG_WARNING
,
"isc_socket_cleanunix: stat(%s): %s"
,
sockaddr
->
type
.
sun
.
sun_path
,
strbuf
);
sockaddr
->
type
.
sun
ix
.
sun_path
,
strbuf
);
break
;
}
goto
cleanup
;
...
...
@@ -2945,23 +2945,23 @@ isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) {
isc_log_write
(
isc_lctx
,
ISC_LOGCATEGORY_GENERAL
,
ISC_LOGMODULE_SOCKET
,
ISC_LOG_WARNING
,
"isc_socket_cleanunix: %s: not a socket"
,
sockaddr
->
type
.
sun
.
sun_path
);
sockaddr
->
type
.
sun
ix
.
sun_path
);
goto
cleanup
;
}
if
(
connect
(
s
,
(
struct
sockaddr
*
)
&
sockaddr
->
type
.
sun
,
sizeof
(
sockaddr
->
type
.
sun
))
<
0
)
{
if
(
connect
(
s
,
(
struct
sockaddr
*
)
&
sockaddr
->
type
.
sun
ix
,
sizeof
(
sockaddr
->
type
.
sun
ix
))
<
0
)
{
switch
(
errno
)
{
case
ECONNREFUSED
:
case
ECONNRESET
:
if
(
unlink
(
sockaddr
->
type
.
sun
.
sun_path
)
<
0
)
{
if
(
unlink
(
sockaddr
->
type
.
sun
ix
.
sun_path
)
<
0
)
{
isc__strerror
(
errno
,
strbuf
,
sizeof
(
strbuf
));
isc_log_write
(
isc_lctx
,
ISC_LOGCATEGORY_GENERAL
,
ISC_LOGMODULE_SOCKET
,
ISC_LOG_WARNING
,
"isc_socket_cleanunix: "
"unlink(%s): %s"
,
sockaddr
->
type
.
sun
.
sun_path
,
sockaddr
->
type
.
sun
ix
.
sun_path
,
strbuf
);
}
break
;
...
...
@@ -2970,7 +2970,7 @@ isc_socket_cleanunix(isc_sockaddr_t *sockaddr, isc_boolean_t active) {
isc_log_write
(
isc_lctx
,
ISC_LOGCATEGORY_GENERAL
,
ISC_LOGMODULE_SOCKET
,
ISC_LOG_WARNING
,
"isc_socket_cleanunix: connect(%s): %s"
,
sockaddr
->
type
.
sun
.
sun_path
,
strbuf
);
sockaddr
->
type
.
sun
ix
.
sun_path
,
strbuf
);
break
;
}
}
...
...
@@ -2989,14 +2989,14 @@ isc_socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm,
#ifdef ISC_PLATFORM_HAVESYSUNH
isc_result_t
result
=
ISC_R_SUCCESS
;
char
strbuf
[
ISC_STRERRORSIZE
];
char
path
[
sizeof
(
sockaddr
->
type
.
sun
.
sun_path
)];
char
path
[
sizeof
(
sockaddr
->
type
.
sun
ix
.
sun_path
)];
#ifdef NEED_SECURE_DIRECTORY
char
*
slash
;
#endif
REQUIRE
(
sockaddr
->
type
.
sa
.
sa_family
==
AF_UNIX
);
INSIST
(
strlen
(
sockaddr
->
type
.
sun
.
sun_path
)
<
sizeof
(
path
));
strcpy
(
path
,
sockaddr
->
type
.
sun
.
sun_path
);
INSIST
(
strlen
(
sockaddr
->
type
.
sun
ix
.
sun_path
)
<
sizeof
(
path
));
strcpy
(
path
,
sockaddr
->
type
.
sun
ix
.
sun_path
);
#ifdef NEED_SECURE_DIRECTORY
slash
=
strrchr
(
path
,
'/'
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment