Date: Wed, 2 Apr 2003 09:21:43 +0200 From: Andreas Klemm <andreas@klemm.apsfilter.org> To: Lev Walkin <vlm@spelio.net.ru> Cc: ports@FreeBSD.org Subject: ipcad 2.8.1 bug: doesn't run with uid 0 which is needed for rsh Message-ID: <20030402072143.GA78425@titan.klemm.apsfilter.org>
next in thread | raw e-mail | index | archive | help
--ZwgA9U+XZDXt4+m+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Lev, first of all thanks for this nice accounting tool. I need it for a friend of mine who has a small company where different smaller "1 person companies" share one link to the internet. They need IP accounting on the FreeBSD firewall box, since they pay for IP volume, so we need to count the traffic of every person to the FreeBSD internet gateway. Since they use NAT and squid, counting IP traffic on the inner interface seems to do the trick well. Of course this box is only firewall, not a server ;-) Otherwise they would pay for file access as well ;-)) When trying your last ipcad version 2.8.1 I trapped into a bug. See fix in the attachment. It was not allowed to configure ipcad to run under root privileges. See my patch, which fixes it. Another problem is here on a FreeBSD 4.8 box, that I cant rebuild the cfgy.c file. Since the right thing to do for me was to apply the patch to the cfg.y file. I'll also attach the error-log. Would be interesting to find out, why bison fails here on the FreeBSD box. Either another bug in the .y file or perhaps because of bison version ??? /usr/local/bin/bison: bison (GNU Bison) 1.75 A first fix for the FreeBSD port would be, if you add the patch to cfgy.c to a files subdir. If you are at it you could also update the FreeBSD port. Best regards Andreas /// --=20 Andreas Klemm http://www.64bits.de http://www.apsfilter.org/ http://people.FreeBSD.ORG/~andreas --ZwgA9U+XZDXt4+m+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch-cfgy.c" --- cfgy.c.orig Wed Apr 2 09:12:30 2003 +++ cfgy.c Wed Apr 2 09:12:40 2003 @@ -916,7 +916,7 @@ { int id = yyvsp[-1].tv_char ? atoi(yyvsp[-1].tv_char) : -1; free(yyvsp[-1].tv_char); - if(id <= 0 || id > 65535) + if(id < 0 || id > 65535) return yyerror("Inappropriate UID value"); conf->set_uid = id; ; @@ -926,7 +926,7 @@ { int id = yyvsp[-1].tv_char ? atoi(yyvsp[-1].tv_char) : -1; free(yyvsp[-1].tv_char); - if(id <= 0 || id > 65535) + if(id < 0 || id > 65535) return yyerror("Inappropriate UID value"); conf->set_gid = id; ; --ZwgA9U+XZDXt4+m+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diff.bugfix.ipcad-2.8.1" --- cfg.y.orig Wed Apr 2 08:45:27 2003 +++ cfg.y Wed Apr 2 08:45:50 2003 @@ -155,14 +155,14 @@ | UID EQ TOK_STRING ps { int id = $3 ? atoi($3) : -1; free($3); - if(id <= 0 || id > 65535) + if(id < 0 || id > 65535) return yyerror("Inappropriate UID value"); conf->set_uid = id; } | GID EQ TOK_STRING ps { int id = $3 ? atoi($3) : -1; free($3); - if(id <= 0 || id > 65535) + if(id < 0 || id > 65535) return yyerror("Inappropriate UID value"); conf->set_gid = id; } --ZwgA9U+XZDXt4+m+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diff.ipcad-2.7.1-2.8.1.fbsd.port" Content-Transfer-Encoding: quoted-printable Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /data/ncvs/ports/net/ipcad/Makefile,v retrieving revision 1.10 diff -u -r1.10 Makefile --- Makefile 21 Feb 2003 13:14:44 -0000 1.10 +++ Makefile 2 Apr 2003 06:06:04 -0000 @@ -6,7 +6,7 @@ # =20 PORTNAME=3D ipcad -PORTVERSION=3D 2.7.1 +PORTVERSION=3D 2.8.1 CATEGORIES=3D net MASTER_SITES=3D http://www.spelio.net.ru/soft/ =20 Index: distinfo =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /data/ncvs/ports/net/ipcad/distinfo,v retrieving revision 1.9 diff -u -r1.9 distinfo --- distinfo 2 Jan 2003 17:12:13 -0000 1.9 +++ distinfo 2 Apr 2003 06:06:27 -0000 @@ -1 +1 @@ -MD5 (ipcad-2.7.1.tar.gz) =3D bfbb0b4706a9cd8cffa34213f8a709e3 +MD5 (ipcad-2.8.1.tar.gz) =3D 90434ed3fbc84b11146e351c870a27a3 --- cfg.y.orig Wed Apr 2 08:56:17 2003 +++ cfg.y Wed Apr 2 08:56:26 2003 @@ -155,14 +155,14 @@ | UID EQ TOK_STRING ps { int id =3D $3 ? atoi($3) : -1; free($3); - if(id <=3D 0 || id > 65535) + if(id < 0 || id > 65535) return yyerror("Inappropriate UID value"); conf->set_uid =3D id; } | GID EQ TOK_STRING ps { int id =3D $3 ? atoi($3) : -1; free($3); - if(id <=3D 0 || id > 65535) + if(id < 0 || id > 65535) return yyerror("Inappropriate UID value"); conf->set_gid =3D id; } --ZwgA9U+XZDXt4+m+ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="make.bison.errlog" Content-Transfer-Encoding: quoted-printable bison -y -p ipcacfg -d cfg.y cfg.y:95.8: parse error, unexpected ":", expecting ";" or "|" cfg.y:97.22-30: $2 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:100.27-103.14: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:105.25-106.23: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:105.25-107.9: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:109.39-110.18: $2 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:109.39-110.22: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:109.39-111.9: $2 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:113.26-116.28: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:118.23-119.46: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:118.23-122.15: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:138.32-139.25: $2 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:138.32-139.29: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:138.32-140.9: $2 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:142.35-143.25: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:142.35-144.9: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:146.46-147.21: $2 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:146.46-147.29: unzul=E4ssiger $-Wert cfg.y:146.46-147.29: $5 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:146.46-148.9: $2 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:150.28-153.22: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:155.25-156.13: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:155.25-156.23: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:155.25-157.9: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:162.25-163.13: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:162.25-163.23: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:162.25-164.9: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:170.29-171.14: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:170.29-173.25: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:170.29-175.10: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:170.29-200.26: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:170.29-204.9: $3 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:206.57-207.22: $2 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:206.57-207.30: unzul=E4ssiger $-Wert cfg.y:206.57-207.30: $6 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:206.57-208.10: $2 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:206.57-212.9: $2 von =BBIFlags=AB hat keinen deklarierten Typ cfg.y:224.1-2: parse error, unexpected "%%", expecting ";" or "|" *** Error code 1 Stop in /usr/ports/net/ipcad/work/ipcad-2.8.1. --ZwgA9U+XZDXt4+m+--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030402072143.GA78425>