PERFORCE change 40241 for review
Robert Watson
rwatson at FreeBSD.org
Thu Oct 23 02:29:38 GMT 2003
http://perforce.freebsd.org/chv.cgi?CH=40241
Change 40241 by rwatson at rwatson_paprika on 2003/10/22 19:29:24
libexec updates to 39070 from trustedbsd_mac. Includes libmap
support to run-time plug libraries (such as threading libraries).
Affected files ...
.. //depot/projects/trustedbsd/sebsd/libexec/ftpd/ftpd.8#4 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/ftpd/ftpd.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/ftpd/popen.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/lukemftpd/Makefile#4 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/lukemftpd/nbsd2fbsd.h#3 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/rpc.rquotad/rquotad.c#2 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/Makefile#4 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/libmap.c#3 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/libmap.h#3 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/malloc.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/rtld.c#4 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/rtld.h#4 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/talkd/talkd.8#2 integrate
.. //depot/projects/trustedbsd/sebsd/libexec/talkd/talkd.c#4 integrate
Differences ...
==== //depot/projects/trustedbsd/sebsd/libexec/ftpd/ftpd.8#4 (text+ko) ====
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)ftpd.8 8.2 (Berkeley) 4/19/94
-.\" $FreeBSD: src/libexec/ftpd/ftpd.8,v 1.64 2003/06/08 12:39:17 charnier Exp $
+.\" $FreeBSD: src/libexec/ftpd/ftpd.8,v 1.66 2003/09/14 16:42:46 ume Exp $
.\"
.Dd January 27, 2000
.Dt FTPD 8
@@ -68,16 +68,8 @@
.It Fl 4
When
.Fl D
-is specified, accept IPv4 connections.
-When
-.Fl 6
-is also specified, accept IPv4 connection via
-.Dv AF_INET6
-socket.
-When
-.Fl 6
-is not specified, accept IPv4 connection via
-.Dv AF_INET
+is specified, accept connections via
+.Dv AF_INET4
socket.
.It Fl 6
When
@@ -204,6 +196,8 @@
Refer to
.Xr umask 2
for details.
+This option may be overridden by
+.Xr login.conf 5 .
.It Fl v
A synonym for
.Fl d .
==== //depot/projects/trustedbsd/sebsd/libexec/ftpd/ftpd.c#4 (text+ko) ====
@@ -44,7 +44,7 @@
static char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94";
#endif
static const char rcsid[] =
- "$FreeBSD: src/libexec/ftpd/ftpd.c,v 1.145 2003/07/09 12:46:24 yar Exp $";
+ "$FreeBSD: src/libexec/ftpd/ftpd.c,v 1.146 2003/09/14 16:42:46 ume Exp $";
#endif /* not lint */
/*
@@ -106,7 +106,6 @@
extern off_t restart_point;
extern char cbuf[];
-union sockunion server_addr;
union sockunion ctrl_addr;
union sockunion data_source;
union sockunion data_dest;
@@ -258,6 +257,7 @@
static void reapchild(int);
static void logxfer(char *, off_t, time_t);
static char *doublequote(char *);
+static int *socksetup(int, char *, const char *);
static char *
curdir(void)
@@ -282,7 +282,6 @@
char *bindname = NULL;
const char *bindport = "ftp";
int family = AF_UNSPEC;
- int enable_v4 = 0;
struct sigaction sa;
tzset(); /* in case no timezone database in ~ftp */
@@ -304,13 +303,11 @@
"46a:AdDEhlmMoOp:P:rRSt:T:u:UvW")) != -1) {
switch (ch) {
case '4':
- enable_v4 = 1;
- if (family == AF_UNSPEC)
- family = AF_INET;
+ family = (family == AF_INET6) ? AF_UNSPEC : AF_INET;
break;
case '6':
- family = AF_INET6;
+ family = (family == AF_INET) ? AF_UNSPEC : AF_INET6;
break;
case 'a':
@@ -430,8 +427,9 @@
openlog("ftpd", LOG_PID | LOG_NDELAY, LOG_FTP);
if (daemon_mode) {
- int ctl_sock, fd;
- struct addrinfo hints, *res;
+ int *ctl_sock, fd, maxfd = -1, nfds, i;
+ fd_set defreadfds, readfds;
+ pid_t pid;
/*
* Detach from parent.
@@ -442,61 +440,26 @@
}
sa.sa_handler = reapchild;
(void)sigaction(SIGCHLD, &sa, NULL);
- /* init bind_sa */
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = family == AF_UNSPEC ? AF_INET : family;
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_protocol = 0;
- hints.ai_flags = AI_PASSIVE;
- error = getaddrinfo(bindname, bindport, &hints, &res);
- if (error) {
- if (family == AF_UNSPEC) {
- hints.ai_family = AF_UNSPEC;
- error = getaddrinfo(bindname, bindport, &hints,
- &res);
- }
- }
- if (error) {
- syslog(LOG_ERR, "%s", gai_strerror(error));
- if (error == EAI_SYSTEM)
- syslog(LOG_ERR, "%s", strerror(errno));
- exit(1);
- }
- if (res->ai_addr == NULL) {
- syslog(LOG_ERR, "-a %s: getaddrinfo failed", hostname);
- exit(1);
- } else
- family = res->ai_addr->sa_family;
/*
* Open a socket, bind it to the FTP port, and start
* listening.
*/
- ctl_sock = socket(family, SOCK_STREAM, 0);
- if (ctl_sock < 0) {
- syslog(LOG_ERR, "control socket: %m");
+ ctl_sock = socksetup(family, bindname, bindport);
+ if (ctl_sock == NULL)
exit(1);
+
+ FD_ZERO(&defreadfds);
+ for (i = 1; i <= *ctl_sock; i++) {
+ FD_SET(ctl_sock[i], &defreadfds);
+ if (listen(ctl_sock[i], 32) < 0) {
+ syslog(LOG_ERR, "control listen: %m");
+ exit(1);
+ }
+ if (maxfd < ctl_sock[i])
+ maxfd = ctl_sock[i];
}
- if (setsockopt(ctl_sock, SOL_SOCKET, SO_REUSEADDR,
- &on, sizeof(on)) < 0)
- syslog(LOG_WARNING,
- "control setsockopt (SO_REUSEADDR): %m");
- if (family == AF_INET6 && enable_v4 == 0) {
- if (setsockopt(ctl_sock, IPPROTO_IPV6, IPV6_V6ONLY,
- &on, sizeof (on)) < 0)
- syslog(LOG_WARNING,
- "control setsockopt (IPV6_V6ONLY): %m");
- }
- memcpy(&server_addr, res->ai_addr, res->ai_addr->sa_len);
- if (bind(ctl_sock, (struct sockaddr *)&server_addr,
- server_addr.su_len) < 0) {
- syslog(LOG_ERR, "control bind: %m");
- exit(1);
- }
- if (listen(ctl_sock, 32) < 0) {
- syslog(LOG_ERR, "control listen: %m");
- exit(1);
- }
+
/*
* Atomically write process ID
*/
@@ -524,16 +487,31 @@
* children to handle them.
*/
while (1) {
- addrlen = server_addr.su_len;
- fd = accept(ctl_sock, (struct sockaddr *)&his_addr, &addrlen);
- if (fork() == 0) {
- /* child */
- (void) dup2(fd, 0);
- (void) dup2(fd, 1);
- close(ctl_sock);
+ FD_COPY(&defreadfds, &readfds);
+ nfds = select(maxfd + 1, &readfds, NULL, NULL, 0);
+ if (nfds <= 0) {
+ if (nfds < 0 && errno != EINTR)
+ syslog(LOG_WARNING, "select: %m");
+ continue;
+ }
+
+ pid = -1;
+ for (i = 1; i <= *ctl_sock; i++)
+ if (FD_ISSET(ctl_sock[i], &readfds)) {
+ addrlen = sizeof(his_addr);
+ fd = accept(ctl_sock[i],
+ (struct sockaddr *)&his_addr,
+ &addrlen);
+ if ((pid = fork()) == 0) {
+ /* child */
+ (void) dup2(fd, 0);
+ (void) dup2(fd, 1);
+ close(ctl_sock[i]);
+ } else
+ close(fd);
+ }
+ if (pid == 0)
break;
- }
- close(fd);
}
} else {
addrlen = sizeof(his_addr);
@@ -3162,3 +3140,73 @@
return (s2);
}
+
+/* setup server socket for specified address family */
+/* if af is PF_UNSPEC more than one socket may be returned */
+/* the returned list is dynamically allocated, so caller needs to free it */
+static int *
+socksetup(int af, char *bindname, const char *bindport)
+{
+ struct addrinfo hints, *res, *r;
+ int error, maxs, *s, *socks;
+ const int on = 1;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_family = af;
+ hints.ai_socktype = SOCK_STREAM;
+ error = getaddrinfo(bindname, bindport, &hints, &res);
+ if (error) {
+ syslog(LOG_ERR, "%s", gai_strerror(error));
+ if (error == EAI_SYSTEM)
+ syslog(LOG_ERR, "%s", strerror(errno));
+ return NULL;
+ }
+
+ /* Count max number of sockets we may open */
+ for (maxs = 0, r = res; r; r = r->ai_next, maxs++)
+ ;
+ socks = malloc((maxs + 1) * sizeof(int));
+ if (!socks) {
+ freeaddrinfo(res);
+ syslog(LOG_ERR, "couldn't allocate memory for sockets");
+ return NULL;
+ }
+
+ *socks = 0; /* num of sockets counter at start of array */
+ s = socks + 1;
+ for (r = res; r; r = r->ai_next) {
+ *s = socket(r->ai_family, r->ai_socktype, r->ai_protocol);
+ if (*s < 0) {
+ syslog(LOG_DEBUG, "control socket: %m");
+ continue;
+ }
+ if (setsockopt(*s, SOL_SOCKET, SO_REUSEADDR,
+ &on, sizeof(on)) < 0)
+ syslog(LOG_WARNING,
+ "control setsockopt (SO_REUSEADDR): %m");
+ if (r->ai_family == AF_INET6) {
+ if (setsockopt(*s, IPPROTO_IPV6, IPV6_V6ONLY,
+ &on, sizeof(on)) < 0)
+ syslog(LOG_WARNING,
+ "control setsockopt (IPV6_V6ONLY): %m");
+ }
+ if (bind(*s, r->ai_addr, r->ai_addrlen) < 0) {
+ syslog(LOG_DEBUG, "control bind: %m");
+ close(*s);
+ continue;
+ }
+ (*socks)++;
+ s++;
+ }
+
+ if (res)
+ freeaddrinfo(res);
+
+ if (*socks == 0) {
+ syslog(LOG_ERR, "control socket: Couldn't bind to any socket");
+ free(socks);
+ return NULL;
+ }
+ return(socks);
+}
==== //depot/projects/trustedbsd/sebsd/libexec/ftpd/popen.c#2 (text+ko) ====
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)popen.c 8.3 (Berkeley) 4/6/94";
#endif
static const char rcsid[] =
- "$FreeBSD: src/libexec/ftpd/popen.c,v 1.23 2002/07/17 05:47:49 mikeh Exp $";
+ "$FreeBSD: src/libexec/ftpd/popen.c,v 1.24 2003/09/01 04:12:18 kan Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -58,7 +58,6 @@
#include "pathnames.h"
#include <syslog.h>
#include <time.h>
-#include <varargs.h>
#define MAXUSRARGS 100
#define MAXGLOBARGS 1000
==== //depot/projects/trustedbsd/sebsd/libexec/lukemftpd/Makefile#4 (text+ko) ====
@@ -1,5 +1,5 @@
# @(#)Makefile 8.2 (Berkeley) 4/4/94
-# $FreeBSD: src/libexec/lukemftpd/Makefile,v 1.11 2003/06/14 19:32:51 obrien Exp $
+# $FreeBSD: src/libexec/lukemftpd/Makefile,v 1.13 2003/09/10 19:03:48 obrien Exp $
LUKEMFTPD= ${.CURDIR}/../../contrib/lukemftpd
.PATH: ${LUKEMFTPD}/src ${LUKEMFTPD}/libnetbsd
@@ -13,7 +13,7 @@
WFORMAT= 0
CFLAGS+= -include nbsd2fbsd.h
CFLAGS+= -I${.CURDIR} -I${LUKEMFTPD} -I${LUKEMFTPD}/src
-CFLAGS+= -I${.CURDIR}/../..//lib/libc/stdtime
+CFLAGS+= -I${.CURDIR}/../../lib/libc/stdtime
YFLAGS=
LDADD= -lcrypt -lutil
@@ -43,3 +43,5 @@
CLEANFILES+= lukemftpd.8
.include <bsd.prog.mk>
+
+${OBJS}: ${.CURDIR}/nbsd2fbsd.h
==== //depot/projects/trustedbsd/sebsd/libexec/lukemftpd/nbsd2fbsd.h#3 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/libexec/lukemftpd/nbsd2fbsd.h,v 1.3 2003/01/06 04:42:20 obrien Exp $ */
+/* $FreeBSD: src/libexec/lukemftpd/nbsd2fbsd.h,v 1.4 2003/09/11 03:28:21 obrien Exp $ */
/* XXX: Depend on our system headers protecting against multiple includes. */
#include <paths.h>
@@ -15,3 +15,10 @@
#endif
long long strsuftollx(const char *, const char *,
long long, long long, char *, size_t);
+
+/*
+ * IEEE Std 1003.1c-95, adopted in X/Open CAE Specification Issue 5 Version 2
+ */
+#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
+#define LOGIN_NAME_MAX MAXLOGNAME /* max login name length (incl. NUL) */
+#endif
==== //depot/projects/trustedbsd/sebsd/libexec/rpc.rquotad/rquotad.c#2 (text+ko) ====
@@ -6,7 +6,7 @@
#ifndef lint
static const char rcsid[] =
- "$FreeBSD: src/libexec/rpc.rquotad/rquotad.c,v 1.7 2002/07/15 18:51:57 alfred Exp $";
+ "$FreeBSD: src/libexec/rpc.rquotad/rquotad.c,v 1.8 2003/09/01 04:12:18 kan Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -28,7 +28,6 @@
#include <unistd.h>
#include <syslog.h>
-#include <varargs.h>
#include <ufs/ufs/quota.h>
#include <rpc/rpc.h>
==== //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/Makefile#4 (text+ko) ====
@@ -1,26 +1,19 @@
-# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.20 2003/06/04 05:42:04 obrien Exp $
+# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.25 2003/09/13 21:50:35 mdodd Exp $
PROG= ld-elf.so.1
SRCS= rtld_start.S rtld.c rtld_lock.c map_object.c malloc.c \
- xmalloc.c debug.c reloc.c
+ xmalloc.c debug.c reloc.c libmap.c
MAN= rtld.1
CSTD?= gnu99
CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD
CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}
LDFLAGS+= -nostdlib -e .rtld_start
INSTALLFLAGS= -fschg -C -b
+BINDIR= /libexec
+SYMLINKS= ${BINDIR}/${PROG} /usr/libexec/${PROG}
MLINKS= rtld.1 ld-elf.so.1.1 \
rtld.1 ld.so.1
-#
-# To enable the libmap.conf functionality please
-# add 'WITH_LIBMAP=yes' to /etc/make.conf, recompile
-# and reinstall rtld-elf.
-.ifdef WITH_LIBMAP
-CFLAGS+= -DWITH_LIBMAP
-SRCS+= libmap.c
-.endif
-
.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
.endif
@@ -50,6 +43,11 @@
dyn_hack.so:
${CC} -shared -nostdlib -o dyn_hack.so -x c /dev/null
+# Since moving rtld-elf to /libexec, we need to create a symlink.
+# Fixup the existing binary that's there so we can symlink over it.
+beforeinstall:
+ -chflags noschg ${DESTDIR}/usr/libexec/${PROG}
+
.PATH: ${.CURDIR}/${MACHINE_ARCH}
.include <bsd.prog.mk>
==== //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/libmap.c#3 (text+ko) ====
@@ -1,5 +1,5 @@
/*
- * $FreeBSD: src/libexec/rtld-elf/libmap.c,v 1.8 2003/06/18 05:31:08 mdodd Exp $
+ * $FreeBSD: src/libexec/rtld-elf/libmap.c,v 1.9 2003/09/13 21:43:08 mdodd Exp $
*/
#include <stdio.h>
@@ -41,7 +41,7 @@
#define iseol(c) (((c) == '#') || ((c) == '\0') || \
((c) == '\n') || ((c) == '\r'))
-void
+int
lm_init (void)
{
FILE *fp;
@@ -55,7 +55,7 @@
TAILQ_INIT(&lmp_head);
if ((fp = fopen(_PATH_LIBMAP_CONF, "r")) == NULL)
- return;
+ return (1);
p = NULL;
while ((cp = fgets(line, MAXPATHLEN + 1, fp)) != NULL) {
@@ -128,7 +128,7 @@
lm_add(p, f, t);
}
fclose(fp);
- return;
+ return (0);
}
static void
==== //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/libmap.h#3 (text+ko) ====
@@ -1,7 +1,7 @@
/*
- * $FreeBSD: src/libexec/rtld-elf/libmap.h,v 1.1 2003/04/07 16:21:25 mdodd Exp $
+ * $FreeBSD: src/libexec/rtld-elf/libmap.h,v 1.2 2003/09/13 21:43:08 mdodd Exp $
*/
-void lm_init (void);
+int lm_init (void);
void lm_fini (void);
char * lm_find (const char *, const char *);
==== //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/malloc.c#4 (text+ko) ====
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)malloc.c 5.11 (Berkeley) 2/23/91";*/
-static char *rcsid = "$FreeBSD: src/libexec/rtld-elf/malloc.c,v 1.9 2003/05/04 00:56:00 obrien Exp $";
+static char *rcsid = "$FreeBSD: src/libexec/rtld-elf/malloc.c,v 1.10 2003/08/22 02:22:59 imp Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -51,10 +51,10 @@
#include <err.h>
#include <paths.h>
#include <stdarg.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stddef.h>
#include <unistd.h>
#include <sys/param.h>
#include <sys/mman.h>
==== //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/rtld.c#4 (text+ko) ====
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/libexec/rtld-elf/rtld.c,v 1.85 2003/06/19 03:55:38 mdodd Exp $
+ * $FreeBSD: src/libexec/rtld-elf/rtld.c,v 1.89 2003/09/13 21:50:36 mdodd Exp $
*/
/*
@@ -52,12 +52,10 @@
#include "debug.h"
#include "rtld.h"
-#ifdef WITH_LIBMAP
#include "libmap.h"
-#endif
#define END_SYM "_end"
-#define PATH_RTLD "/usr/libexec/ld-elf.so.1"
+#define PATH_RTLD "/libexec/ld-elf.so.1"
/* Types. */
typedef void (*func_ptr_type)();
@@ -340,10 +338,8 @@
sym_zero.st_info = ELF_ST_INFO(STB_GLOBAL, STT_NOTYPE);
sym_zero.st_shndx = SHN_UNDEF;
-#ifdef WITH_LIBMAP
if (!libmap_disable)
- lm_init();
-#endif
+ libmap_disable = (bool)lm_init();
dbg("loading LD_PRELOAD libraries");
if (load_preload_objects() == -1)
@@ -807,7 +803,7 @@
* rpath in the referencing file
* LD_LIBRARY_PATH
* ldconfig hints
- * /usr/lib
+ * /lib:/usr/lib
*/
static char *
find_library(const char *xname, const Obj_Entry *refobj)
@@ -824,10 +820,8 @@
return xstrdup(xname);
}
-#ifdef WITH_LIBMAP
if (libmap_disable || (refobj == NULL) ||
(name = lm_find(refobj->path, xname)) == NULL)
-#endif
name = (char *)xname;
dbg(" Searching for \"%s\"", name);
@@ -1464,10 +1458,8 @@
obj->refcount = 0;
objlist_call_fini(&list_fini);
/* No need to remove the items from the list, since we are exiting. */
-#ifdef WITH_LIBMAP
if (!libmap_disable)
lm_fini();
-#endif
}
static void *
==== //depot/projects/trustedbsd/sebsd/libexec/rtld-elf/rtld.h#4 (text+ko) ====
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/libexec/rtld-elf/rtld.h,v 1.31 2003/06/19 03:55:38 mdodd Exp $
+ * $FreeBSD: src/libexec/rtld-elf/rtld.h,v 1.32 2003/08/17 07:55:17 gordon Exp $
*/
#ifndef RTLD_H /* { */
@@ -40,7 +40,7 @@
#include "rtld_machdep.h"
#ifndef STANDARD_LIBRARY_PATH
-#define STANDARD_LIBRARY_PATH "/usr/lib"
+#define STANDARD_LIBRARY_PATH "/lib:/usr/lib"
#endif
#define NEW(type) ((type *) xmalloc(sizeof(type)))
==== //depot/projects/trustedbsd/sebsd/libexec/talkd/talkd.8#2 (text+ko) ====
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)talkd.8 8.2 (Berkeley) 12/11/93
-.\" $FreeBSD: src/libexec/talkd/talkd.8,v 1.6 2002/07/06 19:19:39 charnier Exp $
+.\" $FreeBSD: src/libexec/talkd/talkd.8,v 1.7 2003/09/08 19:57:18 ru Exp $
.\"
.Dd December 11, 1993
.Dt TALKD 8
@@ -55,7 +55,7 @@
type
.Tn LOOK_UP
(see
-.Aq Pa protocols/talkd.h ) .
+.In protocols/talkd.h ) .
This causes the server to search its invitation
tables to check if an invitation currently exists for the caller
(to speak to the callee specified in the message).
==== //depot/projects/trustedbsd/sebsd/libexec/talkd/talkd.c#4 (text+ko) ====
@@ -42,7 +42,7 @@
static char sccsid[] = "@(#)talkd.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$FreeBSD: src/libexec/talkd/talkd.c,v 1.14 2003/04/03 05:13:27 jmallett Exp $";
+ "$FreeBSD: src/libexec/talkd/talkd.c,v 1.15 2003/09/28 09:16:09 tjr Exp $";
#endif /* not lint */
/*
@@ -86,6 +86,7 @@
{
register CTL_MSG *mp = &request;
int cc;
+ struct sockaddr ctl_addr;
#ifdef NOTDEF
/*
@@ -116,12 +117,13 @@
continue;
}
lastmsgtime = time(0);
+ (void)memcpy(&ctl_addr, &mp->ctl_addr, sizeof(ctl_addr));
+ ctl_addr.sa_family = ntohs(mp->ctl_addr.sa_family);
+ ctl_addr.sa_len = sizeof(ctl_addr);
process_request(mp, &response);
/* can block here, is this what I want? */
- mp->ctl_addr.sa_family = htons(mp->ctl_addr.sa_family);
- cc = sendto(sockt, (char *)&response,
- sizeof (response), 0, (struct sockaddr *)&mp->ctl_addr,
- sizeof (mp->ctl_addr));
+ cc = sendto(sockt, (char *)&response, sizeof (response), 0,
+ &ctl_addr, sizeof (ctl_addr));
if (cc != sizeof (response))
syslog(LOG_WARNING, "sendto: %m");
}
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list