diff options
author | veego <veego@pkgsrc.org> | 2007-08-14 19:59:17 +0000 |
---|---|---|
committer | veego <veego@pkgsrc.org> | 2007-08-14 19:59:17 +0000 |
commit | 3f3c24790abf92d775b11aaa20e6570385e84f53 (patch) | |
tree | 1f1fb72ae13f61b71983217dfe78482386b3aa54 /sysutils/lsof | |
parent | ea9b9c675e4641ff39c259e744188aa6f8b3add2 (diff) | |
download | pkgsrc-3f3c24790abf92d775b11aaa20e6570385e84f53.tar.gz |
- Don't hardcode the MFSNAMELEN length, inspired by commits from
Christos (patch-ae and patch-af). Fix PR 36680
- Define NETBSD_SYS in the pkgsrc Makefile so it works if NETBSDSRCDIR is
not pointing to a default location and thus some featues, like ptyfs
support were disabled
- Update the line numbers in patch-aa
- Add tmpfs support (patch-ad, patch-af and patch-ag)
- Update the NetBSD versions in Configure otherwise NETBSDV would fall
back to 1006000 and so at least one feature was not found, the PFSfd
procfs support (patch-ag)
- Bump pkg revision for new features (normaly I wouldn't have bumped the
version if it were only to fix a -current compile, because the version
also includes the kernel version)
Diffstat (limited to 'sysutils/lsof')
-rw-r--r-- | sysutils/lsof/Makefile | 4 | ||||
-rw-r--r-- | sysutils/lsof/distinfo | 11 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-aa | 10 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-ad | 79 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-ae | 19 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-af | 29 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-ag | 103 |
7 files changed, 232 insertions, 23 deletions
diff --git a/sysutils/lsof/Makefile b/sysutils/lsof/Makefile index 6c2cf412787..6bb0f6c06e1 100644 --- a/sysutils/lsof/Makefile +++ b/sysutils/lsof/Makefile @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.92 2007/05/06 21:41:30 christos Exp $ +# $NetBSD: Makefile,v 1.93 2007/08/14 19:59:17 veego Exp $ # DISTNAME= lsof_4.78 PKGNAME= ${DISTNAME:S/_/-/}.${OS_VERSION} +PKGREVISION= 1 CATEGORIES= sysutils MASTER_SITES= ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ \ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/NEW/ \ @@ -34,6 +35,7 @@ PKG_INSTALLATION_TYPES= overwrite pkgviews .if ${OPSYS} == "NetBSD" REAL_GROUP= -g kmem +CONFIGURE_ENV+= NETBSD_SYS="${NETBSDSRCDIR}/sys" .elif ${OPSYS} == "SunOS" MAKE_ENV+= CPPFLAGS= .endif diff --git a/sysutils/lsof/distinfo b/sysutils/lsof/distinfo index 48aec8a1e96..1012473fa72 100644 --- a/sysutils/lsof/distinfo +++ b/sysutils/lsof/distinfo @@ -1,10 +1,11 @@ -$NetBSD: distinfo,v 1.68 2007/08/12 15:00:34 seb Exp $ +$NetBSD: distinfo,v 1.69 2007/08/14 19:59:18 veego Exp $ SHA1 (lsof_4.78.tar.bz2) = 0379fc9f38a931ce19e8386e662314d96fc2a099 RMD160 (lsof_4.78.tar.bz2) = 50d71e500f1109cda717b73ce209c0e100a6dbe9 Size (lsof_4.78.tar.bz2) = 756729 bytes -SHA1 (patch-aa) = 332eb1ac95d86023dde66d1b99b9335c8f54b81f +SHA1 (patch-aa) = 051015025297ab131c30ceb62e926750c365d14a SHA1 (patch-ab) = 1501d8b0e6fd2c61949ba0d447c7b726655725c4 -SHA1 (patch-ad) = bbdd2c4c997233f7743a0c99ffcc6ce29679a8a9 -SHA1 (patch-ae) = ba3804e89101fb504edd33983f35904559a63dbf -SHA1 (patch-af) = 0ceeb8e4a704d89aba5b9271d17afe038d877e8f +SHA1 (patch-ad) = ac9ade0dce7299704d60daa15fb95a436938f456 +SHA1 (patch-ae) = 1d8c1c3baf9575631c23d3ced7b12fab1df95cd6 +SHA1 (patch-af) = 7110b279ca99bd399d1654683b6fc8367d2fee8d +SHA1 (patch-ag) = b992cc4a80563f143e72fe3f27557a460af38121 diff --git a/sysutils/lsof/patches/patch-aa b/sysutils/lsof/patches/patch-aa index b5cd0062dd9..d2b1879bfa0 100644 --- a/sysutils/lsof/patches/patch-aa +++ b/sysutils/lsof/patches/patch-aa @@ -1,13 +1,13 @@ -$NetBSD: patch-aa,v 1.25 2005/01/17 14:54:01 atatat Exp $ +$NetBSD: patch-aa,v 1.26 2007/08/14 19:59:18 veego 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. ---- dialects/n+obsd/machine.h.orig 2004-10-17 17:55:27.000000000 -0400 -+++ dialects/n+obsd/machine.h -@@ -383,7 +383,9 @@ +--- dialects/n+obsd/machine.h.orig 2006-03-28 23:54:17.000000000 +0200 ++++ dialects/n+obsd/machine.h 2007-08-11 18:01:56.000000000 +0200 +@@ -410,7 +410,9 @@ * (the one that its user logged on with) of the lsof process. */ @@ -18,7 +18,7 @@ users to see open sockets, even when LSOF_MORE_SECURE is set. /* -@@ -392,7 +394,9 @@ +@@ -419,7 +421,9 @@ * listing is selected by the "-i" option. */ diff --git a/sysutils/lsof/patches/patch-ad b/sysutils/lsof/patches/patch-ad index 066209feeb1..d2f75141ff2 100644 --- a/sysutils/lsof/patches/patch-ad +++ b/sysutils/lsof/patches/patch-ad @@ -1,7 +1,7 @@ -$NetBSD: patch-ad,v 1.12 2007/05/06 21:41:30 christos Exp $ +$NetBSD: patch-ad,v 1.13 2007/08/14 19:59:18 veego Exp $ ---- dialects/n+obsd/dnode.c.orig 2007-04-24 12:22:06.000000000 -0400 -+++ dialects/n+obsd/dnode.c 2007-05-06 16:43:51.000000000 -0400 +--- dialects/n+obsd/dnode.c.orig 2007-04-24 18:22:06.000000000 +0200 ++++ dialects/n+obsd/dnode.c 2007-08-11 19:46:43.000000000 +0200 @@ -38,6 +38,9 @@ #include "lsof.h" @@ -12,7 +12,7 @@ $NetBSD: patch-ad,v 1.12 2007/05/06 21:41:30 christos Exp $ #if defined(HAS_DINODE_U) #define DINODE_U dinode_u -@@ -194,7 +197,9 @@ +@@ -194,12 +197,17 @@ unsigned char ns; unsigned char rdevs; char *ep, *ty; @@ -21,8 +21,37 @@ $NetBSD: patch-ad,v 1.12 2007/05/06 21:41:30 christos Exp $ +#endif struct inode i; struct mfsnode m; ++#if defined(HASTMPFS) ++ struct tmpfs_node tmp; ++#endif /* defined(HASTMPFS) */ struct nfsnode n; -@@ -619,6 +624,7 @@ + enum nodetype {NONODE, CDFSNODE, DOSNODE, EXT2NODE, FDESCNODE, INODE, +- KERNFSNODE, MFSNODE, NFSNODE, PFSNODE, PTYFSNODE} nty; ++ KERNFSNODE, MFSNODE, NFSNODE, PFSNODE, PTYFSNODE, TMPFSNODE} nty; + enum vtype type; + struct vnode *v, vb; + struct l_vfs *vfs; +@@ -471,6 +479,19 @@ + nty = MFSNODE; + break; + ++#if defined(HASTMPFS) ++ case VT_TMPFS: ++ if (!v->v_data ++ || kread((KA_T)v->v_data, (char *)&tmp, sizeof(tmp))) { ++ (void) snpf(Namech, Namechl, "can't read tmpfs_node at: %s", ++ print_kptr((KA_T)v->v_data, (char *)NULL, 0)); ++ enter_nm(Namech); ++ return; ++ } ++ nty = TMPFSNODE; ++ break; ++#endif /* defined(HASTMPFS) */ ++ + #if defined(HASMSDOSFS) + case VT_MSDOSFS: + if (!v->v_data +@@ -619,6 +640,7 @@ } @@ -30,7 +59,7 @@ $NetBSD: patch-ad,v 1.12 2007/05/06 21:41:30 christos Exp $ if ((lff = i.i_lockf)) { /* -@@ -667,6 +673,7 @@ +@@ -667,6 +689,7 @@ break; } while ((lfp = lf.lf_next) && lfp != lff); } @@ -38,3 +67,41 @@ $NetBSD: patch-ad,v 1.12 2007/05/06 21:41:30 christos Exp $ break; default: if (v->v_type == VBAD || v->v_type == VNON) +@@ -900,6 +923,13 @@ + break; + #endif /* defined(HASPTYFS) */ + ++#if defined(HASTMPFS) ++ case TMPFSNODE: ++ Lf->inode = (INODETYPE)tmp.tn_id; ++ Lf->inp_ty = 1; ++ break; ++#endif /* defined(HASTMPFS) */ ++ + } + + /* +@@ -1019,6 +1049,13 @@ + Lf->sz_def = 1; + break; + ++#if defined(HASTMPFS) ++ case TMPFSNODE: ++ Lf->sz = (SZOFFTYPE)tmp.tn_size; ++ Lf->sz_def = 1; ++ break; ++#endif /* defined(HASTMPFS) */ ++ + #if defined(HASEXT2FS) + case EXT2NODE: + # if defined(HASI_E2FS_PTR) +@@ -1221,6 +1258,9 @@ + Lf->dev_def = Lf->rdev_def = 0; + (void) snpf(Namech, Namechl, "%#x", m.mfs_baseoff); + enter_dev_ch("memory"); ++ } else if (nty == TMPFSNODE) { ++ Lf->dev_def = Lf->rdev_def = 0; ++ enter_dev_ch("memory"); + } + + #if defined(HASPROCFS) diff --git a/sysutils/lsof/patches/patch-ae b/sysutils/lsof/patches/patch-ae index 12e9964d751..f7345f7f093 100644 --- a/sysutils/lsof/patches/patch-ae +++ b/sysutils/lsof/patches/patch-ae @@ -1,7 +1,7 @@ -$NetBSD: patch-ae,v 1.10 2006/08/01 12:29:59 tron Exp $ +$NetBSD: patch-ae,v 1.11 2007/08/14 19:59:18 veego Exp $ ---- dialects/n+obsd/dmnt.c.orig 2005-08-08 20:53:31.000000000 +0100 -+++ dialects/n+obsd/dmnt.c 2006-08-01 13:25:57.000000000 +0100 +--- dialects/n+obsd/dmnt.c.orig 2005-08-08 21:53:31.000000000 +0200 ++++ dialects/n+obsd/dmnt.c 2007-08-11 14:43:05.000000000 +0200 @@ -45,6 +45,15 @@ #include <sys/statvfs.h> #endif /* defined(NETBSDV) && defined(HASSTATVFS) */ @@ -18,3 +18,16 @@ $NetBSD: patch-ae,v 1.10 2006/08/01 12:29:59 tron Exp $ #include "lsof.h" +@@ -94,7 +103,12 @@ + for (; n; n--, mb++) { + if (mb->f_fstypename[0] == '\0') + continue; ++#if defined(NETBSDV) && __NetBSD_Version__ >= 499002500 ++ /* MFSNAMELEN was removed from the kernel source after 4.99.24 */ ++ mb->f_fstypename[sizeof(mb->f_fstypename) - 1] = '\0'; ++#else + mb->f_fstypename[MFSNAMELEN - 1] = '\0'; ++#endif + /* + * Interpolate a possible symbolic directory link. + */ diff --git a/sysutils/lsof/patches/patch-af b/sysutils/lsof/patches/patch-af index 08f517ef1f4..705cb92bd64 100644 --- a/sysutils/lsof/patches/patch-af +++ b/sysutils/lsof/patches/patch-af @@ -1,7 +1,7 @@ -$NetBSD: patch-af,v 1.9 2007/08/12 15:00:34 seb Exp $ +$NetBSD: patch-af,v 1.10 2007/08/14 19:59:18 veego Exp $ ---- dialects/n+obsd/dlsof.h.orig 2006-03-28 16:54:15.000000000 -0500 -+++ dialects/n+obsd/dlsof.h 2007-05-06 17:37:00.000000000 -0400 +--- dialects/n+obsd/dlsof.h.orig 2006-03-28 23:54:15.000000000 +0200 ++++ dialects/n+obsd/dlsof.h 2007-08-11 18:16:59.000000000 +0200 @@ -161,6 +161,7 @@ #include <sys/socketvar.h> #include <sys/un.h> @@ -18,3 +18,26 @@ $NetBSD: patch-af,v 1.9 2007/08/12 15:00:34 seb Exp $ #include <netinet/in_pcb.h> #include <netinet/ip_var.h> #include <netinet/tcp.h> +@@ -264,6 +264,9 @@ + + #undef KERNEL + #include <ufs/mfs/mfsnode.h> ++# if defined(HASTMPFS) ++#include <fs/tmpfs/tmpfs.h> ++# endif /* defined(HASTMPFS) */ + + # if defined(HASNFSPROTO) + #include <nfs/rpcv2.h> +@@ -489,7 +492,12 @@ + struct l_vfs { + KA_T addr; /* kernel address */ + fsid_t fsid; /* file system ID */ ++#if defined(NETBSDV) && __NetBSD_Version__ >= 499002500 ++ /* MFSNAMELEN was removed from the kernel source after 4.99.24 */ ++ char type[sizeof(((struct statvfs *)NULL)->f_fstypename)]; /* type of file system */ ++#else + char type[MFSNAMELEN]; /* type of file system */ ++#endif + char *dir; /* mounted directory */ + char *fsname; /* file system name */ + struct l_vfs *next; /* forward link */ diff --git a/sysutils/lsof/patches/patch-ag b/sysutils/lsof/patches/patch-ag new file mode 100644 index 00000000000..5489a0df536 --- /dev/null +++ b/sysutils/lsof/patches/patch-ag @@ -0,0 +1,103 @@ +$NetBSD: patch-ag,v 1.3 2007/08/14 19:59:18 veego Exp $ + +--- Configure.orig 2007-04-24 21:00:22.000000000 +0200 ++++ Configure 2007-08-11 18:00:38.000000000 +0200 +@@ -86,6 +86,7 @@ + # $LSOF_LOCALSUFFIX local suffix for Makefile + # $LSOF_NBSD_BUFQH NetBSD <sys/bufq.h> copy status + # $LSOF_NBSD_PTYFS NetBSD ${NETBSD_SYS}/sys/fs/ptyfs/ copy status ++# $LSOF_NBSD_TMPFS NetBSD ${NETBSD_SYS}/sys/fs/tmpfs/ copy status + # $LSOF_N_UNIXV *BSD system's kernel file + # $LSOF_PL patch level + # $LSOF_RANLIB randomizing command for the lsof library +@@ -2447,6 +2448,19 @@ + echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR" + echo "!!!WARNING!!! Configuring for NetBSD 3.0" + ;; ++ 4.0*) ++ LSOF_TSTBIGF=" " ++ LSOF_VERS="4000000" ++ ;; ++ 4.99.*) ++ LSOF_TSTBIGF=" " ++ LSOF_VERS="4099000" ++ ;; ++ 4*) ++ LSOF_VERS="4000000" ++ echo "!!!WARNING!!! Unsupported NetBSD version: $LSOF_VSTR" ++ echo "!!!WARNING!!! Configuring for NetBSD 4.0" ++ ;; + *) + echo "Unknown NetBSD release: $LSOF_VSTR" + echo Assuming NetBSD 1.6 +@@ -2464,6 +2478,8 @@ + ;; + 3000000|3099000) + ;; ++ 4000000|4099000) ++ ;; + *) + echo "Unknown NetBSD version: $LSOF_VERS" + rm -f $LSOF_HLP +@@ -2871,6 +2887,7 @@ + fi # } + LSOF_TMP2="sys/vnode.h" + LSOF_NBSD_PTYFS=0 ++ LSOF_NBSD_TMPFS=0 + if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { + then + LSOF_TMP3="${LSOF_INCLUDE}/$LSOF_TMP2" +@@ -2948,6 +2965,24 @@ + fi # } + fi # } + fi # } ++ grep -q VT_TMPFS $LSOF_TMP3 ++ if test $? -eq 0 # { ++ then ++ LSOF_TMP2="fs/tmpfs/tmpfs.h" ++ if test -r ${LSOF_INCLUDE}/$LSOF_TMP2 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASTMPFS" ++ else ++ if test -r ${NETBSD_SYS}/$LSOF_TMP2 # { ++ then ++ if test $NETBSD_SYS != $LSOF_INCLUDE # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -DHASTMPFS" ++ LSOF_NBSD_TMPFS=1 ++ fi # } ++ fi # } ++ fi # } ++ fi # } + if test "X$NETBSD_UVM" = "X" # { + then + grep -q UVM $LSOF_TMP3 +@@ -3233,6 +3268,28 @@ + LSOF_CFGF="$LSOF_CFGF -I`pwd`/dialects/n+obsd/include" + fi # } + fi # } ++ if test $LSOF_NBSD_TMPFS -eq 1 # { ++ then ++ ++ # Make a local copy of $NETBSD_SYS/sys/fs/tmpfs/tmpfs.h. ++ ++ if test ! -d dialects/n+obsd/include # { ++ then ++ mkdir dialects/n+obsd/include ++ fi # } ++ if test ! -d dialects/n+obsd/include/fs # { ++ then ++ mkdir dialects/n+obsd/include/fs ++ fi # } ++ rm -rf dialects/n+obsd/include/fs/tmpfs ++ mkdir dialects/n+obsd/include/fs/tmpfs ++ cp $NETBSD_SYS/fs/tmpfs/tmpfs.h dialects/n+obsd/include/fs/tmpfs ++ echo $LSOF_CFGF | grep /dialects/n+obsd/include > /dev/null 2>&1 ++ if test $? -ne 0 # { ++ then ++ LSOF_CFGF="$LSOF_CFGF -I`pwd`/dialects/n+obsd/include" ++ fi # } ++ fi # } + LSOF_CFGL="$LSOF_CFGL -lkvm" + LSOF_DIALECT_DIR=n+obsd + ;; |