Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

8
sysutils/tcx/DESCR Normal file
View File

@@ -0,0 +1,8 @@
TCX is a system designed for the transparent decompression, execution
and recompression of executables under Unix. It allows configuration
options such as the type of compression system used (compress(1),
gzip(1), your own local system etc), timeouts between recompressions,
and emergency directories in case a decompression fails from shortage
of disk space. The system is designed with a reasonable amount of
robustness in mind, such as in the event of system crashes, or races
on trying to uncompress, compress or execute something.

11
sysutils/tcx/MESSAGE Normal file
View File

@@ -0,0 +1,11 @@
===========================================================================
$NetBSD: MESSAGE,v 1.1.1.1 2003/06/23 13:55:24 agc Exp $
WARNING - this package contains a setuid root executable called
untcx, which was written in 1994, and contained calls to getwd(3),
sprintf(3), strcpy(3) and strcat(3). I've done a minor audit of
the code, and have fixed the above functions with calls to safer
alternatives, but you may wish to delete this package from your
own systems until you have carried out your own audit.
===========================================================================

21
sysutils/tcx/Makefile Normal file
View File

@@ -0,0 +1,21 @@
# $NetBSD: Makefile,v 1.8 2012/10/23 19:51:26 asau Exp $
DISTNAME= tcx-linux
PKGNAME= tcx-19940124
CATEGORIES= sysutils
MASTER_SITES= ftp://ibiblio.unc.edu/pub/Linux/utils/compress/
MAINTAINER= pkgsrc-users@NetBSD.org
#HOMEPAGE=
COMMENT= Transparently compress executables
SPECIAL_PERMS+= bin/untcx ${SETUID_ROOT_PERMS}
INSTALLATION_DIRS+= bin
WRKSRC= ${WRKDIR}/tcx
post-patch:
cd ${WRKSRC}; ${MV} config.h config.h-pre; ${SED} -e 's|@PREFIX@|"${PREFIX}"|g' < config.h-pre > config.h
.include "../../mk/bsd.pkg.mk"

3
sysutils/tcx/PLIST Normal file
View File

@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2003/06/23 13:55:24 agc Exp $
bin/tcx
bin/untcx

9
sysutils/tcx/distinfo Normal file
View File

@@ -0,0 +1,9 @@
$NetBSD: distinfo,v 1.5 2010/01/27 20:19:36 joerg Exp $
SHA1 (tcx-linux.tar.gz) = 73c112fc39cbfb794fe0f6b0d2e15739ee1c9f5a
RMD160 (tcx-linux.tar.gz) = e331acb338582391909d39fbe69f252370b81abc
Size (tcx-linux.tar.gz) = 21028 bytes
SHA1 (patch-aa) = ee2bd5713af9473925d6fa775074c1e4d4bcf2fe
SHA1 (patch-ab) = 5e7e7247783090e3029504f80440b6faebe1d1dd
SHA1 (patch-ac) = 793c6dc9d706cf8ccf3bbed6f5c285661b104241
SHA1 (patch-ad) = 5d78624ca3bad845bc952dc09cb802bf6dc30131

View File

@@ -0,0 +1,28 @@
$NetBSD: patch-aa,v 1.2 2010/01/27 20:19:36 joerg Exp $
--- Makefile 2003/05/19 15:39:04 1.1
+++ Makefile 2003/05/19 16:01:40
@@ -6,11 +6,11 @@
# C compiler of your choice. Should be ansi'ish
#CC = cc # IRIX, ULTRIX
-CC = gcc # SUNOS, LINUX
+#CC = gcc # SUNOS, LINUX
#CC = c++ # try & see?
# Cflags of choice.
-CFLAGS = -s -O6 -Wall
+#CFLAGS = -s -O6 -Wall
# Any libraries
@@ -29,4 +29,8 @@
shar -c -l 45 -o tcx README VERSION COPYING Makefile tcx.1 untcx.1 tcx.c config.h untcx.c
clean:
- /bin/rm -f *.o tcx untcx
+ rm -f *.o tcx untcx
+
+install:
+ ${BSD_INSTALL_PROGRAM} tcx ${DESTDIR}${PREFIX}/bin
+ ${BSD_INSTALL_PROGRAM} untcx ${DESTDIR}${PREFIX}/bin

View File

@@ -0,0 +1,41 @@
$NetBSD: patch-ab,v 1.1.1.1 2003/06/23 13:55:24 agc Exp $
--- config.h 2003/05/19 16:02:37 1.1
+++ config.h 2003/05/19 16:03:51
@@ -23,7 +23,7 @@
/* Define one of the following where appropriate */
/************************************************************************/
-#define LINUX
+/* #define LINUX */
/* #define SUNOS */
/* #define IRIX */
/* #define ULTRIX */
@@ -45,14 +45,14 @@
/* since PATHUNTCX must run setuid to root. */
/************************************************************************/
-#define PATHUNTCX "/usr/local/bin/untcx"
+#define PATHUNTCX @PREFIX@ "/bin/untcx"
/************************************************************************/
/* PATHTCX is the pathname to the tcx executable. This does not have to*/
/* be installed setuid. */
/************************************************************************/
-#define PATHTCX "/usr/local/bin/tcx"
+#define PATHTCX @PREFIX@ "/bin/tcx"
/************************************************************************/
/* PATHPACKER is the pathname to the compression program you wish to use*/
@@ -143,6 +143,10 @@
#define PUSLEEP(x) (usleep(x))
#endif
+#ifndef PUSLEEP
+#define PUSLEEP(x) (usleep(x))
+#endif
+
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>

View File

@@ -0,0 +1,187 @@
$NetBSD: patch-ac,v 1.3 2005/11/10 16:30:04 joerg Exp $
--- untcx.c.orig 1994-01-09 22:47:53.000000000 +0000
+++ untcx.c
@@ -48,7 +48,6 @@ pstat *pihash[MAXOPENFILES];
void update_pstat_info();
#endif
-extern int errno;
path *worklist = NULL, *freelist = NULL;
@@ -166,9 +165,9 @@ int local;
/* Set global paths */
- (void)sprintf(logpath, "%s/log", ENFSDIR);
- (void)sprintf(logtmppath, "%s/logtmp", ENFSDIR);
- (void)sprintf(lockpath, "%s/.lock", ENFSDIR);
+ (void)snprintf(logpath, sizeof(logpath), "%s/log", ENFSDIR);
+ (void)snprintf(logtmppath, sizeof(logtmppath), "%s/logtmp", ENFSDIR);
+ (void)snprintf(lockpath, sizeof(lockpath), "%s/.lock", ENFSDIR);
/* Check and start tcxd as required */
@@ -185,16 +184,16 @@ int local;
/* Grab argv[0] and resolve to full path name via getwd() */
- if(getwd(cwd) == NULL)
+ if(getcwd(cwd, sizeof(cwd)) == NULL)
{
(void)fprintf(stderr, "Get Working Directory Error: %s\n", cwd);
exit(-1);
}
if(*argv[0] == '/')
- (void)strcpy(realdir, argv[0]);
+ (void)strlcpy(realdir, argv[0], sizeof(realdir));
else
- (void)sprintf(realdir, "%s/%s", cwd, argv[0]);
+ (void)snprintf(realdir, sizeof(realdir), "%s/%s", cwd, argv[0]);
for(;;)
{
if((c = strrchr(realdir, '/')) == NULL)
@@ -203,7 +202,7 @@ int local;
exit(-1);
}
c++;
- (void)strcpy(execname, c);
+ (void)strlcpy(execname, c, sizeof(execname));
*c = '\0';
if(chdir(realdir) < 0) /* Oops. Failed. Report and quit. */
@@ -212,7 +211,7 @@ int local;
exit(-1);
}
- if(getwd(realdir) == NULL)
+ if(getcwd(realdir, sizeof(realdir)) == NULL)
{
(void)fprintf(stderr, "Get Working Directory Error: %s\n", cwd);
exit(-1);
@@ -238,11 +237,11 @@ int local;
}
execpath[len] = '\0';
if(execpath[0] == '/')
- (void)strcpy(realdir, execpath);
+ (void)strlcpy(realdir, execpath, sizeof(realdir));
else
{
- (void)strcat(realdir, "/");
- (void)strcat(realdir, execpath);
+ (void)strlcat(realdir, "/", sizeof(realdir));
+ (void)strlcat(realdir, execpath, sizeof(realdir));
}
continue;
}
@@ -291,8 +290,8 @@ int local;
#else
if(setreuid(getuid(), getuid()) < 0) { perror("setreuid"); exit(-1); }
#endif
- (void)sprintf(tcxtarg, "%s/%s", realdir, execname);
- (void)sprintf(untcxtmp, "%s/.untcx.%s", realdir, execname);
+ (void)snprintf(tcxtarg, sizeof(tcxtarg), "%s/%s", realdir, execname);
+ (void)snprintf(untcxtmp, sizeof(untcxtmp), "%s/.untcx.%s", realdir, execname);
just_untcx(tcxtarg, untcxtmp);
exit(0);
}
@@ -302,8 +301,8 @@ int local;
if(local)
{
- (void)sprintf(tcxtarg, "%s/%s", realdir, execname);
- (void)sprintf(untcxtmp, "%s/.untcx.%s", realdir, execname);
+ (void)snprintf(tcxtarg, sizeof(tcxtarg), "%s/%s", realdir, execname);
+ (void)snprintf(untcxtmp, sizeof(untcxtmp), "%s/.untcx.%s", realdir, execname);
untcx_and_exec_local(tcxtarg, untcxtmp, &(argv[1]));
}
#endif
@@ -315,7 +314,7 @@ int local;
for(c = realdir; *c ; c++)
if(*c == '/')
*c = '=';
- (void)sprintf(tcxtarg, "%s/%s", ENFSDIR, realdir);
+ (void)snprintf(tcxtarg, sizeof(tcxtarg), "%s/%s", ENFSDIR, realdir);
if(mkdir(tcxtarg, 0777) < 0)
if(errno != EEXIST)
{
@@ -323,9 +322,9 @@ int local;
exit(-1);
}
(void)chmod(tcxtarg, 0777);
- (void)strcat(tcxtarg,"/");
- (void)strcat(tcxtarg, execname);
- (void)sprintf(untcxtmp, "%s/%s/.untcx.%s", ENFSDIR, realdir, execname);
+ (void)strlcat(tcxtarg,"/", sizeof(tcxtarg));
+ (void)strlcat(tcxtarg, execname, sizeof(tcxtarg));
+ (void)snprintf(untcxtmp, sizeof(untcxtmp), "%s/%s/.untcx.%s", ENFSDIR, realdir, execname);
untcx_and_exec_nfs(argv[0], untcxtmp, tcxtarg, &(argv[1]));
@@ -415,7 +414,7 @@ int lastoff;
/* Write our process id to the lock file. Don't really care if fails. */
- (void)sprintf(spid, "%d\n", getpid());
+ (void)snprintf(spid, sizeof(spid), "%d\n", getpid());
(void)write(lkfd, spid, strlen(spid));
#ifdef UNPACK_IN_PLACE
@@ -810,30 +809,30 @@ int len;
/* resolve first stage of argv[0] */
- if(getwd(cwd) == NULL) { (void)fprintf(stderr, "Get Working Directory Error: %s\n", cwd); exit(-1); }
+ if(getcwd(cwd, sizeof(cwd)) == NULL) { (void)fprintf(stderr, "Get Working Directory Error: %s\n", cwd); exit(-1); }
- if(*argv[0] == '/') (void)strcpy(realdir, argv[0]); else (void)sprintf(realdir, "%s/%s", cwd, argv[0]);
+ if(*argv[0] == '/') (void)strlcpy(realdir, argv[0], sizeof(realdir)); else (void)snprintf(realdir, sizeof(realdir), "%s/%s", cwd, argv[0]);
if((c = strrchr(realdir, '/')) == NULL) { (void)fprintf(stderr, "Help! Internal corruption of variables!\n"); exit(-1); }
- c++; (void)strcpy(execname, c); *c = '\0';
+ c++; (void)strlcpy(execname, c, sizeof(execname)); *c = '\0';
if(chdir(realdir) < 0) { perror(realdir); exit(-1); }
- if(getwd(realdir) == NULL) { (void)fprintf(stderr, "Get Working Directory Error: %s\n", cwd); exit(-1); }
+ if(getcwd(realdir, sizeof(realdir)) == NULL) { (void)fprintf(stderr, "Get Working Directory Error: %s\n", cwd); exit(-1); }
for(c = realdir; *c; c++)
if(*c == '/')
*c = '=';
- (void)sprintf(linkpath, "%s/%s", ENFSDIR, realdir);
+ (void)snprintf(linkpath, sizeof(linkpath), "%s/%s", ENFSDIR, realdir);
if(mkdir(linkpath, 0777) < 0)
{
if(errno != EEXIST) { perror(linkpath); exit(-1); }
}
else
(void)chmod(linkpath, 0777);
- (void)strcat(linkpath,"/");
- (void)strcat(linkpath, execname);
+ (void)strlcat(linkpath,"/", sizeof(linkpath));
+ (void)strlcat(linkpath, execname, sizeof(linkpath));
if(chdir(cwd) < 0) { perror(cwd); exit(-1); }
@@ -1244,7 +1243,7 @@ struct stat sb;
if((curr = (path *)malloc(sizeof(path))) == NULL)
continue;
- (void)strcpy(curr->path, newpath);
+ (void)strlcpy(curr->path, newpath, sizeof(curr->path));
#ifdef UNPACK_IN_PLACE
curr->pid = -1;
(strstr(newpath, ENFSDIR) == newpath) ? (curr->local = 0) : (curr->local = 1);
@@ -1313,7 +1312,7 @@ int
dodecode(int infd, int outfd)
{
int pid;
-#if defined(IRIX) || defined(AIX)
+#if defined(IRIX) || defined(AIX) || defined(sun)
int status;
#else
union wait status;

View File

@@ -0,0 +1,58 @@
$NetBSD: patch-ad,v 1.3 2005/11/10 16:30:04 joerg Exp $
--- tcx.c.orig 1993-12-27 03:25:17.000000000 +0000
+++ tcx.c
@@ -17,11 +17,8 @@
/* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/************************************************************************/
-
#include "config.h"
-extern int errno;
-
int main(int, char *[]);
int is_tcx(int);
int doencode(int, int);
@@ -120,16 +117,16 @@ int islocal;
/* If cannot, warn user and quit */
if(strrchr(argv[1], '/') == NULL)
- (void)sprintf(tofile, ".tcx.%s", argv[1]);
+ (void)snprintf(tofile, sizeof(tofile), ".tcx.%s", argv[1]);
else
{
- (void)strcpy(tofile, argv[1]);
+ (void)strlcpy(tofile, argv[1], sizeof(tofile));
s = strrchr(tofile, '/');
*s = '\0';
- (void)strcat(tofile, "/.tcx.");
+ (void)strlcat(tofile, "/.tcx.", sizeof(tofile));
s = strrchr(argv[1], '/');
s++;
- (void)strcat(tofile, s);
+ (void)strlcat(tofile, s, sizeof(tofile));
}
lck.l_type = F_WRLCK; lck.l_whence = 0; lck.l_start = 0; lck.l_len = 0;
@@ -213,7 +210,7 @@ int islocal;
/* Spit out header and start encoding executable */
- (void)sprintf(header, "#!%s\n", PATHUNTCX);
+ (void)snprintf(header, sizeof(header), "#!%s\n", PATHUNTCX);
if(write(outfd, header, strlen(header)) < 0) { (void)perror("write"); exit(-1); }
c = 0; if((write(outfd, &c, 1)) < 0) { (void)perror("write"); exit(-1); }
@@ -291,7 +288,11 @@ int
doencode(int infd, int outfd)
{
int pid;
+#if defined(sun)
+int status;
+#else
union wait status;
+#endif
pid = fork();
if(pid < 0) return -1;