aboutsummaryrefslogtreecommitdiff
path: root/security/sudosh2
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2005-06-17 17:00:02 +0000
committerCy Schubert <cy@FreeBSD.org>2005-06-17 17:00:02 +0000
commit39830a9c2027d20281033d6c3293b3640728665c (patch)
treea1d7196dfb37b01860e0a4ce1f11bcfac21a7732 /security/sudosh2
parent6f0a8dad457ea2e407121800da775e05ef5329cf (diff)
downloadports-39830a9c2027d20281033d6c3293b3640728665c.tar.gz
ports-39830a9c2027d20281033d6c3293b3640728665c.zip
Notes
Diffstat (limited to 'security/sudosh2')
-rw-r--r--security/sudosh2/Makefile3
-rw-r--r--security/sudosh2/distinfo4
-rw-r--r--security/sudosh2/files/patch-src::sudosh.c121
3 files changed, 66 insertions, 62 deletions
diff --git a/security/sudosh2/Makefile b/security/sudosh2/Makefile
index 69aae02808ea..f7c5c14d3fe1 100644
--- a/security/sudosh2/Makefile
+++ b/security/sudosh2/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= sudosh
-PORTVERSION= 1.6.3
+PORTVERSION= 1.8.1
CATEGORIES= security
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED}
MASTER_SITE_SUBDIR= ${PORTNAME:S/_/-/}
@@ -30,6 +30,7 @@ CONFIGURE_ARGS+= --with-logdir=/var/log/sudosh
CONFIGURE_ENV= LDFLAGS="-lutil"
MAN1= sudosh.1
+MAN5= sudosh.conf.5
MAN8= sudosh-replay.8
.include <bsd.port.pre.mk>
diff --git a/security/sudosh2/distinfo b/security/sudosh2/distinfo
index ef4001cfa03f..eb832bb96c5d 100644
--- a/security/sudosh2/distinfo
+++ b/security/sudosh2/distinfo
@@ -1,2 +1,2 @@
-MD5 (sudosh-1.6.3.tar.gz) = 700ee8c6060c1512ac0c2731b5727cc6
-SIZE (sudosh-1.6.3.tar.gz) = 119980
+MD5 (sudosh-1.8.1.tar.gz) = 415ff62cb3e3465eb62025d043e6d0b4
+SIZE (sudosh-1.8.1.tar.gz) = 135718
diff --git a/security/sudosh2/files/patch-src::sudosh.c b/security/sudosh2/files/patch-src::sudosh.c
index e54829cf8c68..d6d8bc4a42a9 100644
--- a/security/sudosh2/files/patch-src::sudosh.c
+++ b/security/sudosh2/files/patch-src::sudosh.c
@@ -1,16 +1,6 @@
---- src/sudosh.c.orig Thu May 12 19:37:44 2005
-+++ src/sudosh.c Wed Jun 1 14:05:14 2005
-@@ -24,6 +24,9 @@
- #include <unistd.h>
- #include <signal.h>
- #include <pwd.h>
-+#ifdef __FreeBSD__
-+#include <sys/param.h>
-+#endif
-
- #include "config.h"
-
-@@ -81,6 +84,12 @@
+--- src/sudosh.c.orig Sun Jun 12 18:13:15 2005
++++ src/sudosh.c Thu Jun 16 21:02:50 2005
+@@ -28,6 +28,13 @@
#define WRITE(a, b, c) do_write(a, b, c, __FILE__, __LINE__)
@@ -18,14 +8,15 @@
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <libutil.h>
++#include <sys/param.h>
+#endif
+
static struct termios termorig;
static struct winsize winorig;
-@@ -423,17 +432,41 @@
+@@ -554,19 +561,43 @@
{
- char *sname;
+ char *sname;
+#ifdef __FreeBSD__
+#define PTYLEN 16
@@ -44,58 +35,68 @@
+ }
+ if (openpty(&p->mfd, &p->sfd, sname, &tt, &win) == -1) {
+#else
- if ((p->mfd = open("/dev/ptmx", O_RDWR)) == -1) {
- if ((p->mfd = open("/dev/ptc", O_RDWR)) == -1) {
+ if ((p->mfd = open ("/dev/ptmx", O_RDWR)) == -1)
+ {
+ if ((p->mfd = open ("/dev/ptc", O_RDWR)) == -1)
+ {
+#endif
- perror("Cannot open cloning master pty");
- return -1;
-+#ifndef __FreeBSD__
+ perror ("Cannot open cloning master pty");
+ return -1;
++#ifdef __FreeBSD
}
+#endif
}
+#if !defined(__FreeBSD_version) || (defined(__FreeBSD_version) && __FreeBSD_version >= 500000)
- (void) unlockpt(p->mfd);
- (void) grantpt(p->mfd);
+ (void) unlockpt (p->mfd);
+ (void) grantpt (p->mfd);
+#endif
-+#ifndef __FreeBSD__
- sname = (char *) ptsname(p->mfd);
++#ifndef __FreeBSD
+ sname = (char *) ptsname (p->mfd);
+#endif
- if ((p->sfd = open(sname, O_RDWR)) == -1) {
- perror("open slave pty");
-@@ -488,7 +521,10 @@
- for (i = 3; i < 100; ++i)
- close(i);
+ if ((p->sfd = open (sname, O_RDWR)) == -1)
+ {
+@@ -628,9 +659,14 @@
+ for (i = 3; i < 100; ++i)
+ close (i);
--#ifdef TCSETS
+#ifdef __FreeBSD__
+ (void) tcsetattr(0, TCSADRAIN, &termorig);
+ (void) login_tty(pst->sfd);
+#else
- (void) ioctl(0, TCSETS, &termorig);
+ #ifdef TCSETS
+ (void) ioctl (0, TCSETS, &termorig);
#endif
- (void) ioctl(0, TIOCSWINSZ, &winorig);
-@@ -528,25 +564,32 @@
++#endif
+ (void) ioctl (0, TIOCSWINSZ, &winorig);
+
+ setuid (getuid ());
+@@ -672,6 +708,13 @@
{
- static struct termios termnew;
+ static struct termios termnew;
--#ifdef TCGETS
+#ifdef __FreeBSD__
-+ if (tcgetattr(ttyfd, &termorig) == -1) {
-+ perror("tcgetattr failed");
++ if (tcgetattr(ttyfd, &termorig) == -1)
++ {
++ perror("tcgetattr failed");
++ exit (EXIT_FAILURE);
++ }
+#else
- if (ioctl(ttyfd, TCGETS, &termorig) == -1) {
- perror("ioctl TCGETS failed");
-+#endif
- exit(1);
+ #ifdef TCGETS
+ if (ioctl (ttyfd, TCGETS, &termorig) == -1)
+ {
+@@ -679,6 +722,7 @@
+ exit (EXIT_FAILURE);
}
--#endif
+ #endif
++#endif
- if (ioctl(ttyfd, TIOCGWINSZ, &winorig) == -1) {
- perror("ioctl TIOCGWINSZ failed");
- exit(1);
+ if (ioctl (ttyfd, TIOCGWINSZ, &winorig) == -1)
+ {
+@@ -686,6 +730,11 @@
+ exit (EXIT_FAILURE);
}
+#ifdef __FreeBSD__
@@ -103,24 +104,26 @@
+ termnew.c_lflag &= ~ECHO;
+ (void) tcsetattr(ttyfd, TCSAFLUSH, &termnew);
+#else
- termnew.c_cc[VEOF] = 1;
- termnew.c_iflag = BRKINT | ISTRIP | IXON | IXANY;
- termnew.c_oflag = 0;
- termnew.c_cflag = termorig.c_cflag;
- termnew.c_lflag &= ~ECHO;
-
--#ifdef TCSETS
- (void) ioctl(ttyfd, TCSETS, &termnew);
+ termnew.c_cc[VEOF] = 1;
+ termnew.c_iflag = BRKINT | ISTRIP | IXON | IXANY;
+ termnew.c_oflag = 0;
+@@ -695,13 +744,19 @@
+ #ifdef TCSETS
+ (void) ioctl (ttyfd, TCSETS, &termnew);
#endif
++#endif
}
-@@ -556,7 +599,9 @@
- char s[32];
- char t[32];
- char *sp, *tp;
--#ifdef TCSETS
+
+ static void
+ bye (int signum)
+ {
++
+#ifdef __FreeBSD__
+ (void) tcsetattr(0, TCSADRAIN, &termorig);
+#else
- (void) ioctl(0, TCSETS, &termorig);
+ #ifdef TCSETS
+ (void) ioctl (0, TCSETS, &termorig);
++#endif
#endif
+ close (timing.fd);