Date: Thu, 4 Feb 2010 10:45:08 GMT From: Rob Farmer <rfarmer@predatorlabs.net> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/143547: [PATCH] x11/kdelibs3 utmp.h --> utmpx.h Message-ID: <201002041045.o14Aj8Ev061962@www.freebsd.org> Resent-Message-ID: <201002041050.o14Ao1et032699@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 143547 >Category: ports >Synopsis: [PATCH] x11/kdelibs3 utmp.h --> utmpx.h >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Thu Feb 04 10:50:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Rob Farmer >Release: 9.0-CURRENT >Organization: >Environment: FreeBSD coretwo.predatorlabs.net 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r203366: Mon Feb 1 17:42:33 PST 2010 rfarmer@coretwo.predatorlabs.net:/usr/obj/usr/src/sys/CORETWO amd64 >Description: * Convert to utmpx.h on current >How-To-Repeat: >Fix: Patch attached with submission follows: Index: Makefile =================================================================== RCS file: /home/ncvs/ports/x11/kdelibs3/Makefile,v retrieving revision 1.236 diff -u -r1.236 Makefile --- Makefile 4 Dec 2009 20:27:40 -0000 1.236 +++ Makefile 4 Feb 2010 07:00:32 -0000 @@ -37,6 +37,8 @@ ${LOCALBASE}/share/icons/hicolor/index.theme:${PORTSDIR}/misc/hicolor-icon-theme \ iceauth:${PORTSDIR}/x11/iceauth +MAKE_JOBS_SAFE= yes + CONFLICTS+= kdeadmin-3.[0-3].* kdeadmin-3.4.[0-1]* kdeartwork-3.[2-3]* kdebase-3.[0-4]* kdepim-3.2* .if defined(WITHOUT_CUPS) || defined(KDE_WITHOUT_CUPS) CONFLICTS+= kdelibs-[0-9]* @@ -74,6 +76,10 @@ .include "${.CURDIR}/../../x11/kde3/Makefile.kde" .include <bsd.port.pre.mk> +.if ${OSVERSION} > 900006 +EXTRA_PATCHES= ${PATCHDIR}/utmpx-kdecore-kpty.cpp +.endif + # bzip2 is required as a libdepend for the help: kioslave .if !exists(/usr/bin/bzip2) LIB_DEPENDS+= bz2.1:${PORTSDIR}/archivers/bzip2 Index: files/utmpx-kdecore-kpty.cpp =================================================================== RCS file: files/utmpx-kdecore-kpty.cpp diff -N files/utmpx-kdecore-kpty.cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/utmpx-kdecore-kpty.cpp 4 Feb 2010 05:56:11 -0000 @@ -0,0 +1,47 @@ +--- kdecore/kpty.cpp.orig 2008-08-19 11:18:18.000000000 -0700 ++++ kdecore/kpty.cpp 2010-02-03 21:55:39.763715012 -0800 +@@ -77,7 +77,7 @@ + #endif + + #ifdef USE_LOGIN +-# include <utmp.h> ++# include <utmpx.h> + #endif + + #ifdef HAVE_TERMIOS_H +@@ -412,21 +412,21 @@ + Q_UNUSED(remotehost); + #elif defined(USE_LOGIN) + const char *str_ptr; +- struct utmp l_struct; +- memset(&l_struct, 0, sizeof(struct utmp)); ++ struct utmpx l_struct; ++ memset(&l_struct, 0, sizeof(struct utmpx)); + // note: strncpy without terminators _is_ correct here. man 4 utmp + + if (user) +- strncpy(l_struct.ut_name, user, UT_NAMESIZE); ++ strncpy(l_struct.ut_user, user, sizeof(l_struct.ut_user)); + + if (remotehost) +- strncpy(l_struct.ut_host, remotehost, UT_HOSTSIZE); ++ strncpy(l_struct.ut_host, remotehost, sizeof(l_struct.ut_host)); + + # ifndef __GLIBC__ + str_ptr = d->ttyName.data(); + if (!memcmp(str_ptr, "/dev/", 5)) + str_ptr += 5; +- strncpy(l_struct.ut_line, str_ptr, UT_LINESIZE); ++ strncpy(l_struct.ut_line, str_ptr, sizeof(l_struct.ut_line)); + # endif + + // Handle 64-bit time_t properly, where it may be larger +@@ -434,7 +434,7 @@ + { + time_t ut_time_temp; + time(&ut_time_temp); +- l_struct.ut_time=ut_time_temp; ++ l_struct.ut_tv.tv_sec=ut_time_temp; + } + + ::login(&l_struct); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002041045.o14Aj8Ev061962>