fix build with unix 98 ptys; switch from setuid root to setgid utmp

also tested by jasper@
This commit is contained in:
naddy 2012-12-07 18:23:40 +00:00
parent 20241024ad
commit 13166a5e1c
4 changed files with 41 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.47 2012/08/27 13:53:11 sthen Exp $
# $OpenBSD: Makefile,v 1.48 2012/12/07 18:23:40 naddy Exp $
COMMENT-main= color, low memory usage, xterm replacement
COMMENT-clock= analog clock for X11 w/appoint. reminder and mail notif
@ -6,7 +6,7 @@ COMMENT-clock= analog clock for X11 w/appoint. reminder and mail notif
VER= 2.7.10
DISTNAME= rxvt-${VER}
PKGNAME-main= rxvt-${VER}
REVISION-main= 7
REVISION-main= 8
PKGNAME-clock= rclock-${VER}
REVISION-clock= 2
CATEGORIES= x11
@ -43,7 +43,6 @@ CONFIGURE_ARGS= --enable-utmp \
--enable-xgetdefault \
--enable-xim \
--enable-mousewheel \
--enable-ttygid \
--enable-languages \
--enable-menubar \
--enable-rxvt-scroll \

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-configure,v 1.1 2007/04/01 05:37:28 steven Exp $
--- configure.orig Sun Apr 1 07:30:24 2007
+++ configure Sun Apr 1 07:31:41 2007
$OpenBSD: patch-configure,v 1.2 2012/12/07 18:23:40 naddy Exp $
--- configure.orig Wed Mar 26 07:07:26 2003
+++ configure Fri Dec 7 17:51:46 2012
@@ -12925,7 +12925,6 @@ _ACEOF
case "$host_alias" in
@ -9,3 +9,23 @@ $OpenBSD: patch-configure,v 1.1 2007/04/01 05:37:28 steven Exp $
esac
@@ -14433,8 +14432,8 @@ _ACEOF
fi
-echo "$as_me:$LINENO: checking for getpt" >&5
-echo $ECHO_N "checking for getpt... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for posix_openpt" >&5
+echo $ECHO_N "checking for posix_openpt... $ECHO_C" >&6
if test "${rxvt_cv_func_getpt+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -14452,7 +14451,7 @@ cat >>conftest.$ac_ext <<_ACEOF
int
main ()
{
-(void)getpt();
+(void)posix_openpt(0);
;
return 0;
}

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_ptytty_c,v 1.1 2012/12/07 18:23:40 naddy Exp $
--- src/ptytty.c.orig Thu Sep 19 09:40:39 2002
+++ src/ptytty.c Fri Dec 7 17:53:51 2012
@@ -102,7 +102,7 @@ rxvt_get_pty(int *fd_tty, const char **ttydev)
extern char *ptsname();
# ifdef PTYS_ARE_GETPT
- pfd = getpt();
+ pfd = posix_openpt(O_RDWR | O_NOCTTY);
# else
pfd = open("/dev/ptmx", O_RDWR | O_NOCTTY, 0);
# endif

View File

@ -1,8 +1,10 @@
@comment $OpenBSD: PLIST-main,v 1.3 2011/05/03 00:46:12 ian Exp $
@comment $OpenBSD: PLIST-main,v 1.4 2012/12/07 18:23:40 naddy Exp $
@pkgpath x11/rxvt
@mode 4755
@group utmp
@mode 2755
@bin bin/rxvt
@mode
@group
@man man/man1/rxvt.1
share/applications/rxvt.desktop
@exec %D/bin/update-desktop-database