X-Git-Url: https://git.distorted.org.uk/~mdw/checkpath/blobdiff_plain/d7b5ee0cc2a612023bb20492a75af4a7a23e856b..9c42854ddcd101d7c18dbe762afeed91fca5c477:/checkpath.c diff --git a/checkpath.c b/checkpath.c index 993cce2..a396d14 100644 --- a/checkpath.c +++ b/checkpath.c @@ -1,13 +1,13 @@ /* -*-c-*- * - * $Id: checkpath.c,v 1.5 2003/01/25 23:58:44 mdw Exp $ + * $Id: checkpath.c,v 1.6 2004/04/08 01:36:22 mdw Exp $ * * Check a path for safety * * (c) 1999 Mark Wooding */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of chkpath. * @@ -15,39 +15,21 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * chkpath is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with chkpath; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: checkpath.c,v $ - * Revision 1.5 2003/01/25 23:58:44 mdw - * Make guts into official library. - * - * Revision 1.4 2001/01/25 22:16:02 mdw - * Make flags be unsigned. - * - * Revision 1.3 1999/05/21 22:07:20 mdw - * Take advantage of new dynamic string macros. - * - * Revision 1.2 1999/05/18 20:49:12 mdw - * Use a dynamic string for reading symlinks. - * - * Revision 1.1.1.1 1999/04/06 20:12:07 mdw - * Import new project. - * - */ - /*----- Header files ------------------------------------------------------*/ +#include "config.h" + #include #include #include @@ -519,7 +501,7 @@ void checkpath_setids(struct checkpath *cp) cp->cp_uid = getuid(); n = getgroups(sizeof(cp->cp_gid) / sizeof(cp->cp_gid[0]), cp->cp_gid); - + for (i = 0; i < n; i++) { if (cp->cp_gid[i] == g) goto gid_ok;