aboutsummaryrefslogtreecommitdiff
path: root/shells
diff options
context:
space:
mode:
authorAkinori MUSHA <knu@FreeBSD.org>2003-11-20 05:09:20 +0000
committerAkinori MUSHA <knu@FreeBSD.org>2003-11-20 05:09:20 +0000
commit2bd1b7fa390387603a0c2560598845e969b84075 (patch)
tree0d21908e4fc87afd27811b38ce409d014e571ec9 /shells
parentb5d1057a02df982777cd2b8d0e239c064a74810d (diff)
downloadports-2bd1b7fa390387603a0c2560598845e969b84075.tar.gz
ports-2bd1b7fa390387603a0c2560598845e969b84075.zip
Apply a patch that fixes segv in group lookups.
Obtained from: [FDclone-users:00244]
Notes
Notes: svn path=/head/; revision=94427
Diffstat (limited to 'shells')
-rw-r--r--shells/fd/Makefile1
-rw-r--r--shells/fd/files/patch-pathname.c31
2 files changed, 32 insertions, 0 deletions
diff --git a/shells/fd/Makefile b/shells/fd/Makefile
index 6a209a9998d1..8024758ad77e 100644
--- a/shells/fd/Makefile
+++ b/shells/fd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= fd
PORTVERSION= 2.04c
+PORTREVISION= 1
CATEGORIES= shells
MASTER_SITES= http://hp.vector.co.jp/authors/VA012337/soft/fd/ \
ftp://ftp.vector.co.jp/pack/unix/util/file/filer/fd/
diff --git a/shells/fd/files/patch-pathname.c b/shells/fd/files/patch-pathname.c
new file mode 100644
index 000000000000..0d3f5f67b5e5
--- /dev/null
+++ b/shells/fd/files/patch-pathname.c
@@ -0,0 +1,31 @@
+Taken from: [FDclone-users:00244] Re: SEGV caused by group lookups
+
+diff -u ../old/FD-2.04c/pathname.c ./pathname.c
+--- ../old/FD-2.04c/pathname.c Wed Oct 15 00:00:00 2003
++++ ./pathname.c Wed Nov 19 12:40:17 2003
+@@ -2917,7 +2917,7 @@
+ gidlist = b_realloc(gidlist, maxgid, gidtable);
+ gidlist[maxgid].gid = grp -> gr_gid;
+ gidlist[maxgid].name = strdup2(grp -> gr_name);
+- gidlist[maxgid].gr_mem = grp -> gr_mem;
++ gidlist[maxgid].gr_mem = duplvar(grp -> gr_mem, -1);
+ gidlist[maxgid].ismem = 0;
+ return(&(gidlist[maxgid++]));
+ }
+@@ -2932,13 +2932,15 @@
+ if (!(gp = findgid(gid, NULL))) return(0);
+ if (!(gp -> ismem)) {
+ gp -> ismem++;
+- if ((up = finduid(geteuid(), NULL)))
++ if (gp -> gr_mem && (up = finduid(geteuid(), NULL)))
+ for (i = 0; gp -> gr_mem[i]; i++) {
+ if (!strpathcmp(up -> name, gp -> gr_mem[i])) {
+ gp -> ismem++;
+ break;
+ }
+ }
++ freevar(gp -> gr_mem);
++ gp -> gr_mem = NULL;
+ }
+
+ return(gp -> ismem - 1);