summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authoratatat <atatat>2003-08-13 13:24:15 +0000
committeratatat <atatat>2003-08-13 13:24:15 +0000
commitfe696469205ca58c5cd0afc48b0d58844468d25d (patch)
treecbec2a4afa75412a2d1e83131bc70fabc9836c0b /sysutils
parent3722ea7f59f3d3814b44d9962d9dadef3f9ff860 (diff)
downloadpkgsrc-fe696469205ca58c5cd0afc48b0d58844468d25d.tar.gz
A patch (courtesy of the lsof maintainer) to make lsof build again on
NetBSD-current, where the structure of the vnode has been altered. This patch will, as usual, be obsoleted by the next lsof release. PKGREVISION bumped accordingly. Install the lsof.8 man page in man8 instead of installing the preformatted copy in man1 (doing so used to slide by, by new groff really doesn't like formatting preformatted man pages, and besides, it was in the wrong place). Since the only thing left untouched was the DESCR file, I also added mention of kqueues as something lsof might note, meaning that this patch touches every file in the pkg.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/lsof/DESCR2
-rw-r--r--sysutils/lsof/Makefile5
-rw-r--r--sysutils/lsof/PLIST4
-rw-r--r--sysutils/lsof/distinfo8
-rw-r--r--sysutils/lsof/patches/patch-aa30
-rw-r--r--sysutils/lsof/patches/patch-ab104
-rw-r--r--sysutils/lsof/patches/patch-ac33
-rw-r--r--sysutils/lsof/patches/patch-ad124
-rw-r--r--sysutils/lsof/patches/patch-ae18
9 files changed, 320 insertions, 8 deletions
diff --git a/sysutils/lsof/DESCR b/sysutils/lsof/DESCR
index a81b7178b45..e80cf20f6e5 100644
--- a/sysutils/lsof/DESCR
+++ b/sysutils/lsof/DESCR
@@ -2,4 +2,4 @@ Lsof (LiSt Open Files) lists information about files that are open by the
running processes. An open file may be a regular file, a directory, a block
special file, a character special file, an executing text reference, a
library, a stream or a network file (Internet socket, NFS file or Unix domain
-socket).
+socket), a kqueue descriptor...
diff --git a/sysutils/lsof/Makefile b/sysutils/lsof/Makefile
index 7e76ce6dcb4..6bfa43e0a13 100644
--- a/sysutils/lsof/Makefile
+++ b/sysutils/lsof/Makefile
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.65 2003/07/17 22:53:41 grant Exp $
+# $NetBSD: Makefile,v 1.66 2003/08/13 13:24:15 atatat Exp $
#
DISTNAME= lsof_4.68
PKGNAME= ${DISTNAME:S/_/-/}
+PKGREVISION= 1
WRKSRC= ${WRKDIR}/${DISTNAME}/${SRCBALL_NAME}
CATEGORIES= sysutils
MASTER_SITES= ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ \
@@ -56,7 +57,7 @@ post-extract:
do-install:
${INSTALL} ${COPY} ${_STRIPFLAG_INSTALL} -o ${BINOWN} -g ${BINGRP} -m 2755 ${REAL_GROUP} \
${WRKSRC}/lsof ${PREFIX}/sbin
- ${INSTALL_MAN} ${WRKSRC}/lsof.man ${PREFIX}/man/man1/lsof.1
+ ${INSTALL_MAN} ${WRKSRC}/lsof.8 ${PREFIX}/man/man8/lsof.8
@${INSTALL_DATA_DIR} ${PREFIX}/share/lsof
${INSTALL_SCRIPT} ${WRKSRC}/scripts/* ${PREFIX}/share/lsof
@${CHMOD} 0444 ${PREFIX}/share/lsof/00*
diff --git a/sysutils/lsof/PLIST b/sysutils/lsof/PLIST
index c008e253cd3..2b6dbb9f6f3 100644
--- a/sysutils/lsof/PLIST
+++ b/sysutils/lsof/PLIST
@@ -1,6 +1,6 @@
-@comment $NetBSD: PLIST,v 1.1 2001/10/31 22:53:26 zuntum Exp $
+@comment $NetBSD: PLIST,v 1.2 2003/08/13 13:24:15 atatat Exp $
sbin/lsof
-man/man1/lsof.1.gz
+man/man8/lsof.8.gz
share/lsof/00MANIFEST
share/lsof/00README
share/lsof/big_brother.perl5
diff --git a/sysutils/lsof/distinfo b/sysutils/lsof/distinfo
index 11950c29bd6..854e0d1d3a5 100644
--- a/sysutils/lsof/distinfo
+++ b/sysutils/lsof/distinfo
@@ -1,5 +1,9 @@
-$NetBSD: distinfo,v 1.29 2003/06/19 03:09:37 atatat Exp $
+$NetBSD: distinfo,v 1.30 2003/08/13 13:24:15 atatat Exp $
SHA1 (lsof_4.68.tar.gz) = 71df82816e84b4218c473a7102ff31c002192803
Size (lsof_4.68.tar.gz) = 963862 bytes
-SHA1 (patch-aa) = 36790019394b4088c226222d4aefaec50430bcf3
+SHA1 (patch-aa) = 7e13302b231240a5225fb02a604268539d956fe7
+SHA1 (patch-ab) = 5c7f1c1ce17644c5c5062fcd0106c9fbcec4b5e5
+SHA1 (patch-ac) = 4cd8d56feb94008c7d54df7f3bbd0c64bcbcfbd8
+SHA1 (patch-ad) = f1c66f3903ac99dfdfce9163ede04dc3b84af2d4
+SHA1 (patch-ae) = ab22b7026bb59bbaa9e41349f452b8274ccdc43a
diff --git a/sysutils/lsof/patches/patch-aa b/sysutils/lsof/patches/patch-aa
index 51174f1defc..10369a0e9a1 100644
--- a/sysutils/lsof/patches/patch-aa
+++ b/sysutils/lsof/patches/patch-aa
@@ -1,12 +1,31 @@
-$NetBSD: patch-aa,v 1.20 2002/12/22 20:04:31 atatat Exp $
+$NetBSD: patch-aa,v 1.21 2003/08/13 13:24:16 atatat Exp $
If LSOF_MORE_SECURE is non-zero, compile lsof with security, and
only let unprivileged (non-root) users view their own open files.
Set LSOF_LESS_SECURE_SOCKETS to non-zero in order to allow non-root
users to see open sockets, even when LSOF_MORE_SECURE is set.
+Patch for vnode/DNLC interface change courtesy of lsof maintainer.
+
--- dialects/n+obsd/machine.h.orig Tue Dec 3 13:23:54 2002
+++ dialects/n+obsd/machine.h
+@@ -214,16 +214,12 @@
+ * that lsof can search. A value of 1 directs printname() to prefix the
+ * cache value with the file system directory name; 2, avoid the prefix.
+ *
+- * HASNCAPID is defined for those dialects with a searchable kernel name
+- * cache whose cache and vnodes are linked by a capability ID.
+- *
+ * NCACHELDPFX is a set of C commands to execute before calling ncache_load().
+ *
+ * NCACHELDSFX is a set of C commands to execute after calling ncache_load().
+ */
+
+ #define HASNCACHE 1
+-#define HASNCAPID 1
+ /* #define NCACHELDPFX ??? */
+ /* #define NCACHELDSFX ??? */
+
@@ -371,7 +371,9 @@
* (the one that its user logged on with) of the lsof process.
*/
@@ -29,3 +48,12 @@ users to see open sockets, even when LSOF_MORE_SECURE is set.
/*
+@@ -497,7 +493,7 @@
+
+ # if (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020)
+ #define USE_LIB_RNMH 1 /* rnmh.c */
+-# else /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) */
++# else /* (defined(OPENBSDV) && OPENBSDV<2010) && (defined(NETBSDV) && NETBSDV<1020) */
+ #define USE_LIB_RNAM 1 /* rnam.c */
+ # endif /* (defined(OPENBSDV) && OPENBSDV>=2010) || (defined(NETBSDV) && NETBSDV>=1020) */
+
diff --git a/sysutils/lsof/patches/patch-ab b/sysutils/lsof/patches/patch-ab
new file mode 100644
index 00000000000..3a5c990f9da
--- /dev/null
+++ b/sysutils/lsof/patches/patch-ab
@@ -0,0 +1,104 @@
+$NetBSD: patch-ab,v 1.22 2003/08/13 13:24:16 atatat Exp $
+
+Patch for vnode/DNLC interface change courtesy of lsof maintainer.
+
+--- Configure.orig 2003-06-11 20:55:38.000000000 -0400
++++ Configure
+@@ -819,10 +819,13 @@
+ LSOF_CFGF="$LSOF_CFGF -DHASFDLINK"
+ fi # }
+ fi # }
+- grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h
+- if test $? -eq 0 # {
++ if test -r ${LSOF_INCLUDE}/sys/namei.h
+ then
+- LSOF_CFGF="$LSOF_CFGF -DHASNCVPID"
++ grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h
++ if test $? -eq 0 # {
++ then
++ LSOF_CFGF="$LSOF_CFGF -DHASNCVPID"
++ fi # }
+ fi # }
+ if test $LSOF_VERS -ge 40000 # {
+ then
+@@ -938,6 +941,14 @@
+ exit 1
+ fi # }
+ fi # }
++ if test -r ${LSOF_INCLUDE}/sys/namei.h
++ then
++ grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h
++ if test $? -eq 0 # {
++ then
++ LSOF_CFGF="$LSOF_CFGF -DHASNCVPID"
++ fi # }
++ fi # }
+ LSOF_DINC="$LSOF_DINC -I`pwd`/dialects/darwin/xnu/bsd"
+ LSOF_DINC="$LSOF_DINC -I/usr/include"
+ LSOF_DINC="$LSOF_DINC -I${DARWIN_SYSDIR}/System.framework/PrivateHeaders"
+@@ -1175,6 +1186,14 @@
+
+ LSOF_CFGF="$LSOF_CFGF -DHASIPv6"
+ fi # }
++ if test -r ${LSOF_INCLUDE}/sys/namei.h
++ then
++ grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h
++ if test $? -eq 0 # {
++ then
++ LSOF_CFGF="$LSOF_CFGF -DHASNCVPID"
++ fi # }
++ fi # }
+ LSOF_DIALECT_DIR=du
+ ;;
+
+@@ -1526,10 +1545,13 @@
+ fi # }
+ LSOF_CFGF="$LSOF_CFGF -DHAS9660FS"
+ fi # }
+- grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h
+- if test $? -eq 0 # {
++ if test -r ${LSOF_INCLUDE}/sys/namei.h
+ then
+- LSOF_CFGF="$LSOF_CFGF -DHASNCVPID"
++ grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h
++ if test $? -eq 0 # {
++ then
++ LSOF_CFGF="$LSOF_CFGF -DHASNCVPID"
++ fi # }
+ fi # }
+ if test $LSOF_DINC_ADD -eq 1 # {
+ then
+@@ -2241,10 +2263,13 @@
+ then
+ LSOF_DINC="-I$LSOF_INCLUDE -I$NETBSD_SYS"
+ fi # }
+- grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h
+- if test $? -eq 0 # {
++ if test -r ${LSOF_INCLUDE}/sys/namei.h
+ then
+- LSOF_CFGF="$LSOF_CFGF -DHASNCVPID"
++ grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h
++ if test $? -eq 0 # {
++ then
++ LSOF_CFGF="$LSOF_CFGF -DHASNCVPID"
++ fi # }
+ fi # }
+ grep -q i_ffs_size ${LSOF_INCLUDE}/ufs/ufs/inode.h
+ if test $? -eq 0 # {
+@@ -2645,10 +2670,13 @@
+ LSOF_CFGF="$LSOF_CFGF -DHASI_E2FS_PTR"
+ fi # }
+ fi # }
+- grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h
+- if test $? -eq 0 # {
++ if test -r ${LSOF_INCLUDE}/sys/namei.h
+ then
+- LSOF_CFGF="$LSOF_CFGF -DHASNCVPID"
++ grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h
++ if test $? -eq 0 # {
++ then
++ LSOF_CFGF="$LSOF_CFGF -DHASNCVPID"
++ fi # }
+ fi # }
+ if test "X$OPENBSD_UVM" = "X" # {
+ then
diff --git a/sysutils/lsof/patches/patch-ac b/sysutils/lsof/patches/patch-ac
new file mode 100644
index 00000000000..397c026828f
--- /dev/null
+++ b/sysutils/lsof/patches/patch-ac
@@ -0,0 +1,33 @@
+$NetBSD: patch-ac,v 1.10 2003/08/13 13:24:16 atatat Exp $
+
+Patch for vnode/DNLC interface change courtesy of lsof maintainer.
+
+--- dialects/n+obsd/dnode.c.orig 2003-06-11 07:45:16.000000000 -0400
++++ dialects/n+obsd/dnode.c
+@@ -68,8 +68,14 @@
+ if (!p->P_VMSPACE
+ || kread((KA_T)p->P_VMSPACE, (char *)&vm, sizeof(vm)))
+ return;
++# if defined(OPENBSDV)
++ Lf->sz = (SZOFFTYPE)((vm.vm_tsize + vm.vm_dsize
++ + vm.vm_ssize) * sysconf(_SC_PAGESIZE));
++# else /* !defined(OPENBSDV */
+ Lf->sz = (SZOFFTYPE)ctob(vm.vm_tsize + vm.vm_dsize
+ + vm.vm_ssize);
++# endif /* defined(OPENBSDV) */
++
+ Lf->sz_def = 1;
+ return;
+ }
+@@ -301,9 +307,9 @@
+
+ #if defined(HASNCACHE)
+ Lf->na = va;
+-# if defined(HASNCAPID)
++# if defined(HASNCVPID)
+ Lf->id = v->v_id;
+-# endif /* defined(HASNCAPID) */
++# endif /* defined(HASNCVPID) */
+ #endif /* defined(HASNCACHE) */
+
+ #if defined(HASFSTRUCT)
diff --git a/sysutils/lsof/patches/patch-ad b/sysutils/lsof/patches/patch-ad
new file mode 100644
index 00000000000..5810d248eae
--- /dev/null
+++ b/sysutils/lsof/patches/patch-ad
@@ -0,0 +1,124 @@
+$NetBSD: patch-ad,v 1.5 2003/08/13 13:24:17 atatat Exp $
+
+Patch for vnode/DNLC interface change courtesy of lsof maintainer.
+
+--- lib/rnam.c.orig 2000-08-02 08:53:30.000000000 -0400
++++ lib/rnam.c
+@@ -111,7 +111,10 @@
+ * table */
+ struct l_nch {
+ KA_T na; /* node address */
++
++# if defined(NCACHE_NODEID)
+ unsigned long id; /* capability ID */
++# endif /* defined(NCACHE_NODEID) */
+
+ # if defined(NCACHE_PARADDR) && defined(NCACHE_PARID)
+ KA_T pa; /* parent node address */
+@@ -128,13 +131,18 @@
+ static struct l_nch **Nchash = (struct l_nch **)NULL;
+ /* Ncache hash pointers */
+ static int Ncfirst = 1; /* first-call status */
+-
++
++# if defined(NCACHE_NODEID)
+ #define ncachehash(i,n) Nchash+(((((int)(n)>>2)+((int)(i)))*31415)&Mch)
++_PROTOTYPE(static struct l_nch *ncache_addr,(unsigned long i, KA_T na));
++# else /* !defined(NCACHE_NODEID) */
++#define ncachehash(n) Nchash+((((int)(n)>>2)*31415)&Mch)
++_PROTOTYPE(static struct l_nch *ncache_addr,(KA_T na));
++# endif /* defined(NCACHE_NODEID) */
++
+ #define DEFNCACHESZ 1024 /* local size if X_NCSIZE kernel value < 1 */
+ #define LNCHINCRSZ 64 /* local size increment */
+
+-_PROTOTYPE(static struct l_nch *ncache_addr,(unsigned long i, KA_T na));
+-
+ # if !defined(NCACHE_NO_ROOT)
+ _PROTOTYPE(static int ncache_isroot,(KA_T na, char *cp));
+ # endif /* !defined(NCACHE_NO_ROOT) */
+@@ -145,14 +153,32 @@
+ */
+
+ static struct l_nch *
++
++# if defined(NCACHE_NODEID)
+ ncache_addr(i, na)
+ unsigned long i; /* node's capability ID */
++# else /* !defined(NCACHE_NODEID) */
++ncache_addr(na)
++# endif /* defined(NCACHE_NODEID) */
++
+ KA_T na; /* node's address */
+ {
+ struct l_nch **hp;
+
+- for (hp = ncachehash(i, na); *hp; hp++) {
++# if defined(NCACHE_NODEID)
++ for (hp = ncachehash(i, na); *hp; hp++)
++# else /* !defined(NCACHE_NODEID) */
++ for (hp = ncachehash(na); *hp; hp++)
++# endif /* defined(NCACHE_NODEID) */
++
++ {
++
++# if defined(NCACHE_NODEID)
+ if ((*hp)->id == i && (*hp)->na == na)
++# else /* !defined(NCACHE_NODEID) */
++ if ((*hp)->na == na)
++# endif /* defined(NCACHE_NODEID) */
++
+ return(*hp);
+ }
+ return((struct l_nch *)NULL);
+@@ -422,8 +448,10 @@
+ }
+ # endif /* defined(NCACHE_NXT) */
+
++# if defined(NCACHE_NODEID)
+ lc->na = (KA_T)kc->NCACHE_NODEADDR;
+ lc->id = kc->NCACHE_NODEID;
++# endif /* defined(NCACHE_NODEID) */
+
+ # if defined(NCACHE_PARADDR)
+ lc->pa = (KA_T)kc->NCACHE_PARADDR;
+@@ -495,8 +523,21 @@
+ Exit(1);
+ }
+ for (i = 0, lc = Ncache; i < Nc; i++, lc++) {
+- for (hp = ncachehash(lc->id, lc->na), n = 1; *hp; hp++) {
++
++# if defined(NCACHE_NODEID)
++ for (hp = ncachehash(lc->id, lc->na), n = 1; *hp; hp++)
++# else /* defined(NCACHE_NODEID) */
++ for (hp = ncachehash(lc->na), n = 1; *hp; hp++)
++# endif /* defined(NCACHE_NODEID) */
++
++ {
++
++# if defined(NCACHE_NODEID)
+ if ((*hp)->na == lc->na && (*hp)->id == lc->id
++# else /* defined(NCACHE_NODEID) */
++ if ((*hp)->na == lc->na
++# endif /* defined(NCACHE_NODEID) */
++
+ && strcmp((*hp)->nm, lc->nm) == 0
+
+ # if defined(NCACHE_PARADDR) && defined(NCACHE_PARID)
+@@ -557,7 +598,15 @@
+ /*
+ * Look up the name cache entry for the node address.
+ */
+- if (Nc == 0 || !(lc = ncache_addr(Lf->id, Lf->na))) {
++
++# if defined(NCACHE_NODEID)
++ if (Nc == 0 || !(lc = ncache_addr(Lf->id, Lf->na)))
++# else /* defined(NCACHE_NODEID) */
++ if (Nc == 0 || !(lc = ncache_addr(Lf->na)))
++# endif /* defined(NCACHE_NODEID) */
++
++
++ {
+
+ /*
+ * If the node has no cache entry, see if it's the mount
diff --git a/sysutils/lsof/patches/patch-ae b/sysutils/lsof/patches/patch-ae
new file mode 100644
index 00000000000..23d814a823c
--- /dev/null
+++ b/sysutils/lsof/patches/patch-ae
@@ -0,0 +1,18 @@
+$NetBSD: patch-ae,v 1.3 2003/08/13 13:24:17 atatat Exp $
+
+Patch for vnode/DNLC interface change courtesy of lsof maintainer.
+
+--- lsof.h.orig 2003-06-11 07:36:32.000000000 -0400
++++ lsof.h 2003-08-11 14:33:38.000000000 -0400
+@@ -651,9 +651,9 @@
+ KA_T na; /* file structure's node address */
+ # endif /* defined(HASNCACHE) && HASNCACHE<2 */
+
+-# if defined(HASNCACHE) && defined(HASNCAPID)
++# if defined(HASNCACHE) && defined(HASNCVPID)
+ unsigned long id; /* capability ID */
+-# endif /* defined(HASNCACHE) && defined(HASNCAPID) */
++# endif /* defined(HASNCACHE) && defined(HASNCVPID) */
+
+ # if defined(HASLFILEADD)
+ HASLFILEADD