1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 07:13:36 +02:00
This commit is contained in:
deraadt
2004-03-10 04:32:45 +00:00
parent ec6c8ee6d0
commit c9d21d9720
4 changed files with 22 additions and 19 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: announce.c,v 1.19 2004/03/10 03:45:24 tedu Exp $ */
/* $OpenBSD: announce.c,v 1.20 2004/03/10 04:32:45 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -31,7 +31,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)announce.c 5.9 (Berkeley) 2/26/91";*/
static char rcsid[] = "$Id: announce.c,v 1.19 2004/03/10 03:45:24 tedu Exp $";
static char rcsid[] = "$Id: announce.c,v 1.20 2004/03/10 04:32:45 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -88,7 +88,7 @@ announce(CTL_MSG *request, char *remote_machine)
#define N_CHARS 120
/*
* Build a block of characters containing the message.
* Build a block of characters containing the message.
* It is sent blank filled and in a single block to
* try to keep the message in one piece if the recipient
* is in vi at the time
@@ -115,7 +115,7 @@ print_mesg(FILE *tf, CTL_MSG *request, char *remote_machine)
sizes[i] = strlen(line_buf[i]);
max_size = max(max_size, sizes[i]);
i++;
(void)snprintf(line_buf[i], N_CHARS,
(void)snprintf(line_buf[i], N_CHARS,
"Message from Talk_Daemon@%s at %d:%02d ...",
hostname, localclock->tm_hour , localclock->tm_min );
sizes[i] = strlen(line_buf[i]);
+10 -7
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: print.c,v 1.8 2003/07/29 18:39:23 deraadt Exp $ */
/* $OpenBSD: print.c,v 1.9 2004/03/10 04:32:45 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -31,7 +31,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)print.c 5.8 (Berkeley) 2/26/91";*/
static char rcsid[] = "$Id: print.c,v 1.8 2003/07/29 18:39:23 deraadt Exp $";
static char rcsid[] = "$Id: print.c,v 1.9 2004/03/10 04:32:45 deraadt Exp $";
#endif /* not lint */
/* debug print routines */
@@ -43,12 +43,15 @@ static char rcsid[] = "$Id: print.c,v 1.8 2003/07/29 18:39:23 deraadt Exp $";
#include <stdio.h>
#include "talkd.h"
static char *types[] =
{ "leave_invite", "look_up", "delete", "announce" };
static char *types[] = {
"leave_invite", "look_up", "delete", "announce"
};
#define NTYPES (sizeof(types) / sizeof(types[0]))
static char *answers[] =
{ "success", "not_here", "failed", "machine_unknown", "permission_denied",
"unknown_request", "badversion", "badaddr", "badctladdr" };
static char *answers[] = {
"success", "not_here", "failed", "machine_unknown", "permission_denied",
"unknown_request", "badversion", "badaddr", "badctladdr"
};
#define NANSWERS (sizeof(answers) / sizeof(answers[0]))
void
+3 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: process.c,v 1.16 2003/06/11 14:24:46 deraadt Exp $ */
/* $OpenBSD: process.c,v 1.17 2004/03/10 04:32:45 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -31,7 +31,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)process.c 5.10 (Berkeley) 2/26/91";*/
static char rcsid[] = "$Id: process.c,v 1.16 2003/06/11 14:24:46 deraadt Exp $";
static char rcsid[] = "$Id: process.c,v 1.17 2004/03/10 04:32:45 deraadt Exp $";
#endif /* not lint */
/*
@@ -101,7 +101,7 @@ process_request(CTL_MSG *mp, CTL_RESPONSE *rp)
strlcpy(buf2, inet_ntoa(satosin(&mp->ctl_addr)->sin_addr),
sizeof(buf2));
syslog(LOG_WARNING, "addresses are different, %s != %s",
buf1, buf2);
buf1, buf2);
}
rp->addr.sa_family = 0;
mp->pid = ntohl(mp->pid);
+5 -5
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: table.c,v 1.10 2003/06/11 14:24:46 deraadt Exp $ */
/* $OpenBSD: table.c,v 1.11 2004/03/10 04:32:45 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -31,13 +31,13 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)table.c 5.7 (Berkeley) 2/26/91";*/
static char rcsid[] = "$Id: table.c,v 1.10 2003/06/11 14:24:46 deraadt Exp $";
static char rcsid[] = "$Id: table.c,v 1.11 2004/03/10 04:32:45 deraadt Exp $";
#endif /* not lint */
/*
* Routines to handle insertion, deletion, etc on the table
* of requests kept by the daemon. Nothing fancy here, linear
* search on a double-linked list. A time is kept with each
* search on a double-linked list. A time is kept with each
* entry so that overly old invitations can be eliminated.
*
* Consider this a mis-guided attempt at modularity
@@ -106,7 +106,7 @@ find_match(CTL_MSG *request)
print_request("", &ptr->request);
if (strcmp(request->l_name, ptr->request.r_name) == 0 &&
strcmp(request->r_name, ptr->request.l_name) == 0 &&
ptr->request.type == LEAVE_INVITE)
ptr->request.type == LEAVE_INVITE)
return (&ptr->request);
}
if (debug)
@@ -117,7 +117,7 @@ find_match(CTL_MSG *request)
/*
* Look for an identical request, as opposed to a complimentary
* one as find_match does
* one as find_match does
*/
CTL_MSG *
find_request(CTL_MSG *request)