FreeBSD Bugzilla – Attachment 30776 Details for
Bug 51632
luit from x11/XFree86-4-clients is unusable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
x430-luit.diff
x430-luit.diff (text/x-patch), 7.82 KB, created by
Eric Anholt
on 2003-11-08 23:36:56 UTC
(
hide
)
Description:
x430-luit.diff
Filename:
MIME Type:
Creator:
Eric Anholt
Created:
2003-11-08 23:36:56 UTC
Size:
7.82 KB
patch
obsolete
>Index: XFree86-4-libraries/files/patch-luit >=================================================================== >RCS file: /home/ncvs/ports/x11/XFree86-4-libraries/files/patch-luit,v >retrieving revision 1.1 >diff -u -r1.1 patch-luit >--- XFree86-4-libraries/files/patch-luit 11 Mar 2003 23:38:07 -0000 1.1 >+++ XFree86-4-libraries/files/patch-luit 8 Nov 2003 22:58:03 -0000 >@@ -1,61 +1,200 @@ >---- programs/luit/Imakefile.orig Wed Oct 16 18:06:09 2002 >-+++ programs/luit/Imakefile Tue Mar 11 14:57:02 2003 >-@@ -8,7 +8,7 @@ >+Index: programs/luit/Imakefile >+=================================================================== >+RCS file: /home/ncvs/xfree/xc/programs/luit/Imakefile,v >+retrieving revision 1.2 >+retrieving revision 1.4 >+diff -u -u -r1.2 -r1.4 >+--- programs/luit/Imakefile 17 Oct 2002 01:06:09 -0000 1.2 >++++ programs/luit/Imakefile 28 May 2003 16:02:35 -0000 1.4 >+@@ -1,19 +1,19 @@ >+-XCOMM $XFree86: xc/programs/luit/Imakefile,v 1.2 2002/10/17 01:06:09 dawes Exp $ >++XCOMM $XFree86: xc/programs/luit/Imakefile,v 1.3tsi Exp $ >+ >+ #ifndef LocaleAliasFile >+-#define LocaleAliasFile \ >+- $(XLOCALEDIR)/locale.alias >++#define LocaleAliasFile $(XLOCALEDIR)/locale.alias >+ #endif >+ >++LOCALEALIASFILE = LocaleAliasFile > LOCAL_LIBRARIES = $(XFONTENCLIB) > DEPLIBS = $(DEPXFONTENCLIB) > > -SYS_LIBRARIES = MathLibrary GzipLibrary >-+SYS_LIBRARIES = MathLibrary GzipLibrary -lutil >++SYS_LIBRARIES = GzipLibrary > > SRCS = luit.c iso2022.c charset.c parser.c sys.c other.c > >---- programs/luit/sys.c.orig Mon Jan 7 12:38:30 2002 >-+++ programs/luit/sys.c Tue Mar 11 14:57:02 2003 >-@@ -33,6 +33,7 @@ >- #include <termios.h> >- #include <signal.h> >- #include <errno.h> >-+#include <libutil.h> >- >- #ifdef SVR4 >- #define HAVE_POLL >-@@ -313,6 +314,7 @@ >+ OBJS = luit.o iso2022.o charset.o parser.o sys.o other.o >+ >+-DEFINES = -DLOCALE_ALIAS_FILE=\"LocaleAliasFile\" >++DEFINES = -DLOCALE_ALIAS_FILE=\"$(LOCALEALIASFILE)\" >+ >+ ComplexProgramTarget(luit) >+Index: programs/luit/luit.c >+=================================================================== >+RCS file: /home/ncvs/xfree/xc/programs/luit/luit.c,v >+retrieving revision 1.10 >+retrieving revision 1.11 >+diff -u -u -r1.10 -r1.11 >+--- programs/luit/luit.c 24 Feb 2003 01:10:25 -0000 1.10 >++++ programs/luit/luit.c 8 Sep 2003 14:25:30 -0000 1.11 >+@@ -545,6 +545,10 @@ >+ #endif >+ installHandler(SIGCHLD, sigchldHandler); >+ >++ rc = copyTermios(0, pty); >++ if(rc < 0) >++ FatalError("Couldn't copy terminal settings\n"); >++ >+ rc = setRawTermios(); >+ if(rc < 0) >+ FatalError("Couldn't set terminal to raw\n"); >+Index: programs/luit/luit.man >+=================================================================== >+RCS file: /home/ncvs/xfree/xc/programs/luit/luit.man,v >+retrieving revision 1.7 >+retrieving revision 1.8 >+diff -u -u -r1.7 -r1.8 >+--- programs/luit/luit.man 24 Feb 2003 01:10:25 -0000 1.7 >++++ programs/luit/luit.man 3 Apr 2003 16:44:36 -0000 1.8 >+@@ -202,8 +202,8 @@ >+ takes no responsibility for any resulting security issues. >+ >+ .B Luit >+-will refuse to run if it is installed setuid and the underlying system >+-does not have POSIX saved ids. >++will refuse to run if it is installed setuid and cannot safely drop >++privileges. >+ .SH BUGS >+ None of this complexity should be necessary. Stateless UTF-8 >+ throughout the system is the way to go. >+Index: programs/luit/sys.c >+=================================================================== >+RCS file: /home/ncvs/xfree/xc/programs/luit/sys.c,v >+retrieving revision 1.7 >+retrieving revision 1.10 >+diff -u -u -r1.7 -r1.10 >+--- programs/luit/sys.c 7 Jan 2002 20:38:30 -0000 1.7 >++++ programs/luit/sys.c 8 Sep 2003 14:25:30 -0000 1.10 >+@@ -68,6 +68,10 @@ >+ #include <stropts.h> >+ #endif >+ >++#if (defined(__unix__) || defined(unix)) && !defined(USG) >++#include <sys/param.h> >++#endif >++ >+ #include "sys.h" >+ >+ static int saved_tio_valid = 0; >+@@ -211,6 +215,23 @@ >+ } >+ >+ int >++copyTermios(int sfd, int dfd) >++{ >++ struct termios tio; >++ int rc; >++ >++ rc = tcgetattr(sfd, &tio); >++ if(rc < 0) >++ return -1; >++ >++ rc = tcsetattr(dfd, TCSAFLUSH, &tio); >++ if(rc < 0) >++ return -1; >++ >++ return 0; >++} >++ >++int >+ saveTermios(void) >+ { >+ int rc; >+@@ -311,7 +332,8 @@ >+ { >+ char name[12], *line = NULL; > int pty = -1; >- char *name1 = "pqrstuvwxyzPQRST", *name2 = "0123456789abcdef"; >+- char *name1 = "pqrstuvwxyzPQRST", *name2 = "0123456789abcdef"; >++ char *name1 = "pqrstuvwxyzPQRST", >++ *name2 = "0123456789abcdefghijklmnopqrstuv"; > char *p1, *p2; >-+ int tty; > > #ifdef HAVE_GRANTPT >- char *temp_line; >-@@ -355,27 +357,11 @@ >- bsd: >- #endif /* HAVE_GRANTPT */ >- >-- strcpy(name, "/dev/pty??"); >-- for(p1 = name1; *p1; p1++) { >-- name[8] = *p1; >-- for(p2 = name2; *p2; p2++) { >-- name[9] = *p2; >-- pty = open(name, O_RDWR); >-- if(pty >= 0) >-- goto found; >+@@ -363,17 +385,16 @@ >+ pty = open(name, O_RDWR); >+ if(pty >= 0) >+ goto found; > - if(errno == ENOENT) > - goto bail; > - else > - continue; >-- } >-- } >-- >-- goto bail; >-- >-- found: >++ /* Systems derived from 4.4BSD differ in their pty names, >++ so ENOENT doesn't necessarily imply we're done. */ >++ continue; >+ } >+ } >+ >+ goto bail; >+ >+ found: > - line = malloc(strlen(name)); >-+ if (openpty(&pty, &tty, name, NULL, NULL) == -1) >-+ goto bail; >-+ close(tty); > + line = malloc(strlen(name) + 1); > strcpy(line, name); >-- line[5] = 't'; >+ line[5] = 't'; > fix_pty_perms(line); >- *pty_return = pty; >- *line_return = line; >+@@ -429,7 +450,10 @@ >+ return -1; >+ } >+ >+-#ifdef _POSIX_SAVED_IDS >++/* Post-4.4 BSD systems have POSIX semantics (_POSIX_SAVED_IDS >++ or not, depending on the version). 4.3BSD and Minix do not have >++ saved IDs at all, so there's no issue. */ >++#if (defined(BSD) && !defined(_POSIX_SAVED_IDS)) || defined(_MINIX) >+ int >+ droppriv() >+ { >+@@ -438,6 +462,25 @@ >+ if(rc < 0) >+ return rc; >+ return setgid(getgid()); >++} >++#elif defined(_POSIX_SAVED_IDS) >++int >++droppriv() >++{ >++ int uid = getuid(); >++ int euid = geteuid(); >++ int gid = getgid(); >++ int egid = getegid(); >++ int rc; >++ >++ if((uid != euid || gid != egid) && euid != 0) { >++ errno = ENOSYS; >++ return -1; >++ } >++ rc = setuid(uid); >++ if(rc < 0) >++ return rc; >++ return setgid(gid); >+ } >+ #else >+ int >+Index: programs/luit/sys.h >+=================================================================== >+RCS file: /home/ncvs/xfree/xc/programs/luit/sys.h,v >+retrieving revision 1.1 >+retrieving revision 1.2 >+diff -u -u -r1.1 -r1.2 >+--- programs/luit/sys.h 2 Nov 2001 03:06:43 -0000 1.1 >++++ programs/luit/sys.h 8 Sep 2003 14:25:30 -0000 1.2 >+@@ -24,6 +24,7 @@ >+ int waitForInput(int fd1, int fd2); >+ int setWindowSize(int sfd, int dfd); >+ int installHandler(int signum, void (*handler)(int)); >++int copyTermios(int sfd, int dfd); >+ int saveTermios(void); >+ int restoreTermios(void); >+ int setRawTermios(void); >Index: XFree86-4-clients/Makefile >=================================================================== >RCS file: /home/ncvs/ports/x11/XFree86-4-clients/Makefile,v >retrieving revision 1.114 >diff -u -r1.114 Makefile >--- XFree86-4-clients/Makefile 12 Aug 2003 18:35:36 -0000 1.114 >+++ XFree86-4-clients/Makefile 8 Nov 2003 23:10:33 -0000 >@@ -7,7 +7,7 @@ > > PORTNAME= clients > PORTVERSION= 4.3.0 >-PORTREVISION= 3 >+PORTREVISION= 4 > CATEGORIES= x11 > MASTER_SITES= ${MASTER_SITE_XFREE} > MASTER_SITE_SUBDIR= 4.3.0 >@@ -51,6 +51,10 @@ > InstallXdmConfig?= DEFAULT > InstallXinitConfig?= DEFAULT > InstallAppDefFiles?= DEFAULT >+ >+post-install: >+ ${CHOWN} root:wheel ${PREFIX}/bin/luit >+ ${CHMOD} 04711 ${PREFIX}/bin/luit > > .include "${.CURDIR}/../../x11/XFree86-4-libraries/Makefile.inc" > .include <bsd.port.pre.mk>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 51632
: 30776