1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

Update 1.6.3 --> 1.8.1

This commit is contained in:
Cy Schubert 2005-06-17 17:00:02 +00:00
parent 6f0a8dad45
commit 39830a9c20
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=137637
9 changed files with 210 additions and 198 deletions

View File

@ -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>

View File

@ -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

View File

@ -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 @@
{
static struct termios termnew;
-#ifdef TCGETS
+#ifdef __FreeBSD__
+ if (tcgetattr(ttyfd, &termorig) == -1) {
+ perror("tcgetattr failed");
+#else
if (ioctl(ttyfd, TCGETS, &termorig) == -1) {
perror("ioctl TCGETS failed");
+#endif
exit(1);
}
-#endif
(void) ioctl (0, TIOCSWINSZ, &winorig);
if (ioctl(ttyfd, TIOCGWINSZ, &winorig) == -1) {
perror("ioctl TIOCGWINSZ failed");
exit(1);
setuid (getuid ());
@@ -672,6 +708,13 @@
{
static struct termios termnew;
+#ifdef __FreeBSD__
+ if (tcgetattr(ttyfd, &termorig) == -1)
+ {
+ perror("tcgetattr failed");
+ exit (EXIT_FAILURE);
+ }
+#else
#ifdef TCGETS
if (ioctl (ttyfd, TCGETS, &termorig) == -1)
{
@@ -679,6 +722,7 @@
exit (EXIT_FAILURE);
}
#endif
+#endif
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);

View File

@ -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>

View File

@ -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

View File

@ -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 @@
{
static struct termios termnew;
-#ifdef TCGETS
+#ifdef __FreeBSD__
+ if (tcgetattr(ttyfd, &termorig) == -1) {
+ perror("tcgetattr failed");
+#else
if (ioctl(ttyfd, TCGETS, &termorig) == -1) {
perror("ioctl TCGETS failed");
+#endif
exit(1);
}
-#endif
(void) ioctl (0, TIOCSWINSZ, &winorig);
if (ioctl(ttyfd, TIOCGWINSZ, &winorig) == -1) {
perror("ioctl TIOCGWINSZ failed");
exit(1);
setuid (getuid ());
@@ -672,6 +708,13 @@
{
static struct termios termnew;
+#ifdef __FreeBSD__
+ if (tcgetattr(ttyfd, &termorig) == -1)
+ {
+ perror("tcgetattr failed");
+ exit (EXIT_FAILURE);
+ }
+#else
#ifdef TCGETS
if (ioctl (ttyfd, TCGETS, &termorig) == -1)
{
@@ -679,6 +722,7 @@
exit (EXIT_FAILURE);
}
#endif
+#endif
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);

View File

@ -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>

View File

@ -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

View File

@ -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 @@
{
static struct termios termnew;
-#ifdef TCGETS
+#ifdef __FreeBSD__
+ if (tcgetattr(ttyfd, &termorig) == -1) {
+ perror("tcgetattr failed");
+#else
if (ioctl(ttyfd, TCGETS, &termorig) == -1) {
perror("ioctl TCGETS failed");
+#endif
exit(1);
}
-#endif
(void) ioctl (0, TIOCSWINSZ, &winorig);
if (ioctl(ttyfd, TIOCGWINSZ, &winorig) == -1) {
perror("ioctl TIOCGWINSZ failed");
exit(1);
setuid (getuid ());
@@ -672,6 +708,13 @@
{
static struct termios termnew;
+#ifdef __FreeBSD__
+ if (tcgetattr(ttyfd, &termorig) == -1)
+ {
+ perror("tcgetattr failed");
+ exit (EXIT_FAILURE);
+ }
+#else
#ifdef TCGETS
if (ioctl (ttyfd, TCGETS, &termorig) == -1)
{
@@ -679,6 +722,7 @@
exit (EXIT_FAILURE);
}
#endif
+#endif
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);