remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -3,22 +3,22 @@
|
||||
* Copyright (C) Stefan Metzmacher 2006 <metze@samba.org>
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the author nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -131,7 +131,7 @@
|
||||
|
||||
/* LD_PRELOAD doesn't work yet, so REWRITE_CALLS is all we support
|
||||
* for now */
|
||||
#define REWRITE_CALLS
|
||||
#define REWRITE_CALLS
|
||||
|
||||
#ifdef REWRITE_CALLS
|
||||
#define real_accept accept
|
||||
@@ -161,8 +161,8 @@
|
||||
|
||||
/* we need to use a very terse format here as IRIX 6.4 silently
|
||||
truncates names to 16 chars, so if we use a longer name then we
|
||||
can't tell which port a packet came from with recvfrom()
|
||||
|
||||
can't tell which port a packet came from with recvfrom()
|
||||
|
||||
with this format we have 8 chars left for the directory name
|
||||
*/
|
||||
#define SOCKET_FORMAT "%c%02X%04X"
|
||||
@@ -351,7 +351,7 @@ static int convert_in_un_remote(struct socket_info *si, const struct sockaddr *i
|
||||
|
||||
switch (si->family) {
|
||||
case AF_INET: {
|
||||
const struct sockaddr_in *in =
|
||||
const struct sockaddr_in *in =
|
||||
(const struct sockaddr_in *)inaddr;
|
||||
unsigned int addr = ntohl(in->sin_addr.s_addr);
|
||||
char u_type = '\0';
|
||||
@@ -394,7 +394,7 @@ static int convert_in_un_remote(struct socket_info *si, const struct sockaddr *i
|
||||
}
|
||||
#ifdef HAVE_IPV6
|
||||
case AF_INET6: {
|
||||
const struct sockaddr_in6 *in =
|
||||
const struct sockaddr_in6 *in =
|
||||
(const struct sockaddr_in6 *)inaddr;
|
||||
|
||||
switch (si->type) {
|
||||
@@ -425,13 +425,13 @@ static int convert_in_un_remote(struct socket_info *si, const struct sockaddr *i
|
||||
}
|
||||
|
||||
if (is_bcast) {
|
||||
snprintf(un->sun_path, sizeof(un->sun_path), "%s/EINVAL",
|
||||
snprintf(un->sun_path, sizeof(un->sun_path), "%s/EINVAL",
|
||||
socket_wrapper_dir());
|
||||
/* the caller need to do more processing */
|
||||
return 0;
|
||||
}
|
||||
|
||||
snprintf(un->sun_path, sizeof(un->sun_path), "%s/"SOCKET_FORMAT,
|
||||
snprintf(un->sun_path, sizeof(un->sun_path), "%s/"SOCKET_FORMAT,
|
||||
socket_wrapper_dir(), type, iface, prt);
|
||||
|
||||
return 0;
|
||||
@@ -450,7 +450,7 @@ static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *in
|
||||
|
||||
switch (si->family) {
|
||||
case AF_INET: {
|
||||
const struct sockaddr_in *in =
|
||||
const struct sockaddr_in *in =
|
||||
(const struct sockaddr_in *)inaddr;
|
||||
unsigned int addr = ntohl(in->sin_addr.s_addr);
|
||||
char u_type = '\0';
|
||||
@@ -501,7 +501,7 @@ static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *in
|
||||
}
|
||||
#ifdef HAVE_IPV6
|
||||
case AF_INET6: {
|
||||
const struct sockaddr_in6 *in =
|
||||
const struct sockaddr_in6 *in =
|
||||
(const struct sockaddr_in6 *)inaddr;
|
||||
|
||||
switch (si->type) {
|
||||
@@ -532,7 +532,7 @@ static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *in
|
||||
if (prt == 0) {
|
||||
/* handle auto-allocation of ephemeral ports */
|
||||
for (prt = 5001; prt < 10000; prt++) {
|
||||
snprintf(un->sun_path, sizeof(un->sun_path), "%s/"SOCKET_FORMAT,
|
||||
snprintf(un->sun_path, sizeof(un->sun_path), "%s/"SOCKET_FORMAT,
|
||||
socket_wrapper_dir(), type, iface, prt);
|
||||
if (stat(un->sun_path, &st) == 0) continue;
|
||||
|
||||
@@ -540,7 +540,7 @@ static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *in
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(un->sun_path, sizeof(un->sun_path), "%s/"SOCKET_FORMAT,
|
||||
snprintf(un->sun_path, sizeof(un->sun_path), "%s/"SOCKET_FORMAT,
|
||||
socket_wrapper_dir(), type, iface, prt);
|
||||
return 0;
|
||||
}
|
||||
@@ -549,14 +549,14 @@ static struct socket_info *find_socket_info(int fd)
|
||||
{
|
||||
struct socket_info *i;
|
||||
for (i = sockets; i; i = i->next) {
|
||||
if (i->fd == fd)
|
||||
if (i->fd == fd)
|
||||
return i;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int sockaddr_convert_to_un(struct socket_info *si, const struct sockaddr *in_addr, socklen_t in_len,
|
||||
static int sockaddr_convert_to_un(struct socket_info *si, const struct sockaddr *in_addr, socklen_t in_len,
|
||||
struct sockaddr_un *out_addr, int alloc_sock, int *bcast)
|
||||
{
|
||||
if (!out_addr)
|
||||
@@ -590,14 +590,14 @@ static int sockaddr_convert_to_un(struct socket_info *si, const struct sockaddr
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int sockaddr_convert_from_un(const struct socket_info *si,
|
||||
const struct sockaddr_un *in_addr,
|
||||
static int sockaddr_convert_from_un(const struct socket_info *si,
|
||||
const struct sockaddr_un *in_addr,
|
||||
socklen_t un_addrlen,
|
||||
int family,
|
||||
struct sockaddr *out_addr,
|
||||
socklen_t *out_addrlen)
|
||||
{
|
||||
if (out_addr == NULL || out_addrlen == NULL)
|
||||
if (out_addr == NULL || out_addrlen == NULL)
|
||||
return 0;
|
||||
|
||||
if (un_addrlen == 0) {
|
||||
@@ -732,7 +732,7 @@ static const char *socket_wrapper_pcap_file(void)
|
||||
/*
|
||||
* TODO: don't use the structs use plain buffer offsets
|
||||
* and PUSH_U8(), PUSH_U16() and PUSH_U32()
|
||||
*
|
||||
*
|
||||
* for now make sure we disable PCAP support
|
||||
* if the struct has alignment!
|
||||
*/
|
||||
@@ -1284,7 +1284,7 @@ _PUBLIC_ int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
|
||||
return real_accept(s, addr, addrlen);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* assume out sockaddr have the same size as the in parent
|
||||
* socket family
|
||||
*/
|
||||
@@ -1412,7 +1412,7 @@ static int swrap_auto_bind(struct socket_info *si)
|
||||
|
||||
memset(&in, 0, sizeof(in));
|
||||
in.sin_family = AF_INET;
|
||||
in.sin_addr.s_addr = htonl(127<<24 |
|
||||
in.sin_addr.s_addr = htonl(127<<24 |
|
||||
socket_wrapper_default_iface());
|
||||
|
||||
si->myname_len = sizeof(in);
|
||||
@@ -1454,7 +1454,7 @@ static int swrap_auto_bind(struct socket_info *si)
|
||||
|
||||
for (i=0;i<1000;i++) {
|
||||
port = autobind_start + i;
|
||||
snprintf(un_addr.sun_path, sizeof(un_addr.sun_path),
|
||||
snprintf(un_addr.sun_path, sizeof(un_addr.sun_path),
|
||||
"%s/"SOCKET_FORMAT, socket_wrapper_dir(),
|
||||
type, socket_wrapper_default_iface(), port);
|
||||
if (stat(un_addr.sun_path, &st) == 0) continue;
|
||||
@@ -1503,7 +1503,7 @@ _PUBLIC_ int swrap_connect(int s, const struct sockaddr *serv_addr, socklen_t ad
|
||||
|
||||
swrap_dump_packet(si, serv_addr, SWRAP_CONNECT_SEND, NULL, 0);
|
||||
|
||||
ret = real_connect(s, (struct sockaddr *)&un_addr,
|
||||
ret = real_connect(s, (struct sockaddr *)&un_addr,
|
||||
sizeof(struct sockaddr_un));
|
||||
|
||||
/* to give better errors */
|
||||
@@ -1610,7 +1610,7 @@ _PUBLIC_ int swrap_getsockopt(int s, int level, int optname, void *optval, sockl
|
||||
|
||||
if (level == SOL_SOCKET) {
|
||||
return real_getsockopt(s, level, optname, optval, optlen);
|
||||
}
|
||||
}
|
||||
|
||||
errno = ENOPROTOOPT;
|
||||
return -1;
|
||||
@@ -1651,7 +1651,7 @@ _PUBLIC_ ssize_t swrap_recvfrom(int s, void *buf, size_t len, int flags, struct
|
||||
/* irix 6.4 forgets to null terminate the sun_path string :-( */
|
||||
memset(&un_addr, 0, sizeof(un_addr));
|
||||
ret = real_recvfrom(s, buf, len, flags, (struct sockaddr *)&un_addr, &un_addrlen);
|
||||
if (ret == -1)
|
||||
if (ret == -1)
|
||||
return ret;
|
||||
|
||||
if (sockaddr_convert_from_un(si, &un_addr, un_addrlen,
|
||||
@@ -1698,7 +1698,7 @@ _PUBLIC_ ssize_t swrap_sendto(int s, const void *buf, size_t len, int flags, con
|
||||
type = SOCKET_TYPE_CHAR_UDP;
|
||||
|
||||
for(iface=0; iface <= MAX_WRAPPED_INTERFACES; iface++) {
|
||||
snprintf(un_addr.sun_path, sizeof(un_addr.sun_path), "%s/"SOCKET_FORMAT,
|
||||
snprintf(un_addr.sun_path, sizeof(un_addr.sun_path), "%s/"SOCKET_FORMAT,
|
||||
socket_wrapper_dir(), type, iface, prt);
|
||||
if (stat(un_addr.sun_path, &st) != 0) continue;
|
||||
|
||||
@@ -1858,7 +1858,7 @@ dup_internal(const struct socket_info *si_oldd, int fd)
|
||||
si_newd->myname =
|
||||
sockaddr_dup(si_oldd->myname, si_oldd->myname_len);
|
||||
si_newd->myname_len = si_oldd->myname_len;
|
||||
si_newd->peername =
|
||||
si_newd->peername =
|
||||
sockaddr_dup(si_oldd->peername, si_oldd->peername_len);
|
||||
si_newd->peername_len = si_oldd->peername_len;
|
||||
|
||||
|
Reference in New Issue
Block a user