[IRC-Dev CVS] [CVS] Module ircd-ircdev: Change committed
Brought to you by:
zolty
From: Toni G. <zo...@us...> - 2004-02-22 16:27:27
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-02-22 16:14:35 UTC Modified files: tools/Makefile.crypt tools/README tools/crypter tools/mkchroot tools/mkpasswd.c tools/ringlog.c tools/ringlog.pl tools/transition tools/wrapper.c Log message: Author: zoltan <zo...@ir...> Log message: 2004-02-22 Toni Garcia <zo...@ir...> 1.0.alpha8 * Sincronizacion con u2.10.11.07. * Limpieza de cabeceras (Licencia GPLv2) ---------------------- diff included ---------------------- Index: ircd-ircdev/tools/Makefile.crypt diff -u ircd-ircdev/tools/Makefile.crypt:1.1.1.1 ircd-ircdev/tools/Makefile.crypt:1.2 --- ircd-ircdev/tools/Makefile.crypt:1.1.1.1 Mon Sep 8 03:34:31 2003 +++ ircd-ircdev/tools/Makefile.crypt Sun Feb 22 08:14:25 2004 @@ -1,22 +1,26 @@ -#************************************************************************ -#* IRC - Internet Relay Chat, ircd/crypt/Makefile -#* Copyright (C) 1991 Darren Reed -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 1, or (at your option) -#* any later version. -#* -#* This program 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 this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#*/ # +# IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/Makefile.crypt +# +# Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> +# Copyright (C) 1991 Darren Reed +# +# This program is free software; you can redistribute it and/or modify +# 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. +# +# This program 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 this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id: Makefile.crypt,v 1.2 2004/02/22 16:14:25 zolty Exp $ +# + # Change this to the path of your local ircd.conf file # IRCDCONF = /usr/local/lib/irc/ircd.conf Index: ircd-ircdev/tools/README diff -u ircd-ircdev/tools/README:1.1.1.1 ircd-ircdev/tools/README:1.2 --- ircd-ircdev/tools/README:1.1.1.1 Mon Sep 8 03:34:31 2003 +++ ircd-ircdev/tools/README Sun Feb 22 08:14:25 2004 @@ -1,20 +1,25 @@ -/************************************************************************ - * IRC - Internet Relay Chat, tools/README - * Copyright (C) 1991 Nelson Minar - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 1, or (at your option) - * any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/README + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 1991 Nelson Minar + * + * This program is free software; you can redistribute it and/or modify + * 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. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: README,v 1.2 2004/02/22 16:14:25 zolty Exp $ + * */ The change implemented here is that the operator passwords in the ircd.conf Index: ircd-ircdev/tools/crypter diff -u ircd-ircdev/tools/crypter:1.1.1.1 ircd-ircdev/tools/crypter:1.2 --- ircd-ircdev/tools/crypter:1.1.1.1 Mon Sep 8 03:34:31 2003 +++ ircd-ircdev/tools/crypter Sun Feb 22 08:14:25 2004 @@ -1,22 +1,26 @@ #!/usr/local/bin/perl -#************************************************************************ -#* IRC - Internet Relay Chat, ircd/crypt/crypter -#* Copyright (C) 1991 Sean Batt -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 1, or (at your option) -#* any later version. -#* -#* This program 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 this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#*/ +# +# IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/crypter +# +# Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> +# Copyright (C) 1991 Sean Batt +# +# This program is free software; you can redistribute it and/or modify +# 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. +# +# This program 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 this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id: crypter,v 1.2 2004/02/22 16:14:25 zolty Exp $ +# #From Sean Batt se...@co... # Index: ircd-ircdev/tools/mkchroot diff -u ircd-ircdev/tools/mkchroot:1.1.1.1 ircd-ircdev/tools/mkchroot:1.2 --- ircd-ircdev/tools/mkchroot:1.1.1.1 Mon Sep 8 03:34:31 2003 +++ ircd-ircdev/tools/mkchroot Sun Feb 22 08:14:25 2004 @@ -1,12 +1,14 @@ #!/bin/sh # -# IRC - Internet Relay Chat, tools/mkchroot +# IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/mkchroot +# +# Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> # Copyright (C) 2001 Kevin L. Mitchell <kl...@mi...> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 1, or (at your option) -# any later version. +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,9 +17,10 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id: mkchroot,v 1.2 2004/02/22 16:14:25 zolty Exp $ # -# $Id: mkchroot,v 1.1.1.1 2003/09/08 10:34:31 zolty Exp $ if test $# -lt 2; then echo "Usage: $0 <destdir> <executable> [<executable> [...]]" >&2 Index: ircd-ircdev/tools/mkpasswd.c diff -u ircd-ircdev/tools/mkpasswd.c:1.1.1.1 ircd-ircdev/tools/mkpasswd.c:1.2 --- ircd-ircdev/tools/mkpasswd.c:1.1.1.1 Mon Sep 8 03:34:31 2003 +++ ircd-ircdev/tools/mkpasswd.c Sun Feb 22 08:14:25 2004 @@ -1,6 +1,25 @@ -/* simple password generator by Nelson Minar (mi...@re...) - * copyright 1991, all rights reserved. - * You can use this code as long as my name stays with it. +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/mkpasswd.c + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 1991 Nelson Minar (mi...@re...) + * + * This program is free software; you can redistribute it and/or modify + * 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. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: mkpasswd.c,v 1.2 2004/02/22 16:14:25 zolty Exp $ + * */ #define _XOPEN_SOURCE #define _XOPEN_VERSION 4 @@ -36,4 +55,3 @@ printf("%s\n", crypt(plaintext, salt)); return 0; } - Index: ircd-ircdev/tools/ringlog.c diff -u ircd-ircdev/tools/ringlog.c:1.1.1.1 ircd-ircdev/tools/ringlog.c:1.2 --- ircd-ircdev/tools/ringlog.c:1.1.1.1 Mon Sep 8 03:34:31 2003 +++ ircd-ircdev/tools/ringlog.c Sun Feb 22 08:14:25 2004 @@ -1,22 +1,27 @@ /* -** Copyright (C) 2002 by Kevin L. Mitchell <kl...@mi...> -** -** This program is free software; you can redistribute it and/or modify -** 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. -** -** This program 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 this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** @(#)$Id: ringlog.c,v 1.1.1.1 2003/09/08 10:34:31 zolty Exp $ -*/ + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/ringlog.c + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2002 by Kevin L. Mitchell <kl...@mi...> + * + * This program is free software; you can redistribute it and/or modify + * 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. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: ringlog.c,v 1.2 2004/02/22 16:14:25 zolty Exp $ + * + */ + /* * This file contains two separate pieces, along with some common * gunk. If RINGLOG_INSTRUMENT is defined, the two special functions Index: ircd-ircdev/tools/ringlog.pl diff -u ircd-ircdev/tools/ringlog.pl:1.1.1.1 ircd-ircdev/tools/ringlog.pl:1.2 --- ircd-ircdev/tools/ringlog.pl:1.1.1.1 Mon Sep 8 03:34:31 2003 +++ ircd-ircdev/tools/ringlog.pl Sun Feb 22 08:14:25 2004 @@ -1,6 +1,9 @@ #! /usr/bin/perl -w # -# Copyright (C) 2002 by Kevin L. Mitchell <kl...@mi...> +# IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/ringlog.pl +# +# Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> +# Copyright (C) 2002 Kevin L. Mitchell <kl...@mi...> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,8 +19,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# @(#)$Id: ringlog.pl,v 1.1.1.1 2003/09/08 10:34:31 zolty Exp $ +# $Id: ringlog.pl,v 1.2 2004/02/22 16:14:25 zolty Exp $ # + # This program is intended to be used in conjunction with ringlog and # the binutils program addr2line. The -r option specifies the path to # the ringlog program; the -a option specifies the path to addr2line. Index: ircd-ircdev/tools/transition diff -u ircd-ircdev/tools/transition:1.1.1.1 ircd-ircdev/tools/transition:1.2 --- ircd-ircdev/tools/transition:1.1.1.1 Mon Sep 8 03:34:31 2003 +++ ircd-ircdev/tools/transition Sun Feb 22 08:14:25 2004 @@ -1,12 +1,14 @@ #!/bin/sh # -# IRC - Internet Relay Chat, tools/transition +# IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/transition +# +# Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> # Copyright (C) 2001 Kevin L. Mitchell <kl...@mi...> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 1, or (at your option) -# any later version. +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,9 +17,10 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# $Id: transition,v 1.2 2004/02/22 16:14:25 zolty Exp $ # -# $Id: transition,v 1.1.1.1 2003/09/08 10:34:31 zolty Exp $ # Better than having evals all over the place setvar () { Index: ircd-ircdev/tools/wrapper.c diff -u ircd-ircdev/tools/wrapper.c:1.1.1.1 ircd-ircdev/tools/wrapper.c:1.2 --- ircd-ircdev/tools/wrapper.c:1.1.1.1 Mon Sep 8 03:34:31 2003 +++ ircd-ircdev/tools/wrapper.c Sun Feb 22 08:14:25 2004 @@ -1,22 +1,26 @@ /* -** Copyright (C) 2000 by Kevin L. Mitchell <kl...@mi...> -** -** This program is free software; you can redistribute it and/or modify -** 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. -** -** This program 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 this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -** -** @(#)$Id: wrapper.c,v 1.1.1.1 2003/09/08 10:34:31 zolty Exp $ -*/ + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/wrapper.c + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2000 by Kevin L. Mitchell <kl...@mi...> + * + * This program is free software; you can redistribute it and/or modify + * 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. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: wrapper.c,v 1.2 2004/02/22 16:14:25 zolty Exp $ + * + */ #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -47,6 +51,9 @@ #endif #endif +/*fix for change uid/gid with chroot #ubra 08/02/03*/ +int uid, gid; + /* * Set the hard and soft limits for maximum file descriptors. */ @@ -78,14 +85,16 @@ /* * Change the user and group ids--including supplementary groups!--as * appropriate. + * + * fix for change uid/gid with chroot #ubra 08/02/03 + * old change_user() got splited into get_user() and set_user() */ int -change_user(char *user, char *group) +get_user(char *user, char *group) { struct passwd *pwd; struct group *grp; char *tmp; - int uid, gid; /* Track down a struct passwd describing the desired user */ uid = strtol(user, &tmp, 10); /* was the user given as a number? */ @@ -111,6 +120,11 @@ if (initgroups(pwd->pw_name, gid)) /* initialize supplementary groups */ return -1; + return 0; /* success! */ +} + +int +set_user(void) { if (setgid(gid)) /* change our current group */ return -1; if (setuid(uid)) /* change our current user */ @@ -182,6 +196,13 @@ return 1; } + if(user) /* get the selected user account uid/gid*/ + if (get_user(user, group)) { + perror(prog); + return 1; + } + + if (root) /* change root directories */ if (change_root(root)) { perror(prog); @@ -189,7 +210,7 @@ } if (user) /* change to selected user account */ - if (change_user(user, group)) { + if (set_user()) { perror(prog); return 1; } ----------------------- End of diff ----------------------- |