[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdenetwork/ktalkd/ktalkd [POSSIBLY UNSAFE]
From: Lubos Lunak <l.lunak () kde ! org>
Date: 2002-12-12 10:26:06
[Download RAW message or body]
CVS commit by lunakl:
Reverting the TTY_SIZE change, its value mustn't change.
M +16 -0 find_user.cpp 1.21 [POSSIBLY UNSAFE: syslog]
M +4 -1 process.cpp 1.12
M +1 -19 prot_talkd.h 1.4
--- kdenetwork/ktalkd/ktalkd/find_user.cpp #1.20:1.21
@@ -33,4 +33,20 @@
#include "includ.h"
+#include <sys/param.h>
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#include <netdb.h>
+#include <syslog.h>
+#include <stdio.h>
+#include <string.h>
+#define USE_UT_HOST
+#ifndef UT_LINESIZE
+#define UT_LINESIZE 12
+#endif
+#ifndef UT_HOSTSIZE
+#define UT_HOSTSIZE 12 /*whatever*/
+#undef USE_UT_HOST
+#endif
#include <pwd.h>
--- kdenetwork/ktalkd/ktalkd/process.cpp #1.11:1.12
@@ -208,5 +208,8 @@ int do_announce(NEW_CTL_MSG *mp, NEW_CTL
/* see if the user is logged */
- result = find_user(mp->r_name, mp->r_tty, disp);
+ char tty[ UT_LINESIZE ]; // mp->r_tty may be smaller then UT_LINESIZE
+ result = find_user(mp->r_name, tty, disp);
+ strlcpy( mp->r_tty, tty, sizeof( mp->r_tty ));
+
debug("find_user : result = %d",result);
--- kdenetwork/ktalkd/ktalkd/prot_talkd.h #1.3:1.4
@@ -57,21 +57,4 @@
#include <sys/types.h>
-#include <sys/param.h>
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#include <netdb.h>
-#include <syslog.h>
-#include <stdio.h>
-#include <string.h>
-#define USE_UT_HOST
-#ifndef UT_LINESIZE
-#define UT_LINESIZE 16
-#endif
-#ifndef UT_HOSTSIZE
-#define UT_HOSTSIZE 12 /*whatever*/
-#undef USE_UT_HOST
-#endif
-
/*
* This is a copy of 4.3BSD struct sockaddr.
@@ -90,6 +73,5 @@ struct talk_addr {
*/
#define NAME_SIZE 12
-/*#define TTY_SIZE 16*/
-#define TTY_SIZE UT_LINESIZE
+#define TTY_SIZE 16
typedef struct {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic