[Cvs-nserver-commits] CVS: cvs-nserver/src root.c,1.1.1.5.2.4.2.1,1.1.1.5.2.4.2.2
Brought to you by:
tyranny
From: Alexey M. <ty...@us...> - 2001-08-26 19:12:13
|
Update of /cvsroot/cvs-nserver/cvs-nserver/src In directory usw-pr-cvs1:/tmp/cvs-serv14658 Modified Files: Tag: NCLI-1-11-1 root.c Log Message: Remove unneeded functions Index: root.c =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/src/root.c,v retrieving revision 1.1.1.5.2.4.2.1 retrieving revision 1.1.1.5.2.4.2.2 diff -u -d -r1.1.1.5.2.4.2.1 -r1.1.1.5.2.4.2.2 --- root.c 2001/08/19 19:24:19 1.1.1.5.2.4.2.1 +++ root.c 2001/08/26 19:12:11 1.1.1.5.2.4.2.2 @@ -173,103 +173,6 @@ #endif /* ! DEBUG */ -/* The root_allow_* stuff maintains a list of legal CVSROOT - directories. Then we can check against them when a remote user - hands us a CVSROOT directory. */ - -static int root_allow_count; -static char **root_allow_vector; -static int root_allow_size; - -void -root_allow_add (arg) - char *arg; -{ - char *p; - - if (root_allow_size <= root_allow_count) - { - if (root_allow_size == 0) - { - root_allow_size = 1; - root_allow_vector = - (char **) malloc (root_allow_size * sizeof (char *)); - } - else - { - root_allow_size *= 2; - root_allow_vector = - (char **) realloc (root_allow_vector, - root_allow_size * sizeof (char *)); - } - - if (root_allow_vector == NULL) - { - no_memory: - /* Strictly speaking, we're not supposed to output anything - now. But we're about to exit(), give it a try. */ - printf ("E Fatal server error, aborting.\n\ -error ENOMEM Virtual memory exhausted.\n"); - - /* I'm doing this manually rather than via error_exit () - because I'm not sure whether we want to call server_cleanup. - Needs more investigation.... */ - -#ifdef SYSTEM_CLEANUP - /* Hook for OS-specific behavior, for example socket - subsystems on NT and OS2 or dealing with windows - and arguments on Mac. */ - SYSTEM_CLEANUP (); -#endif - - exit (EXIT_FAILURE); - } - } - p = malloc (strlen (arg) + 1); - if (p == NULL) - goto no_memory; - strcpy (p, arg); - root_allow_vector[root_allow_count++] = p; -} - -void -root_allow_free () -{ - if (root_allow_vector != NULL) - free_names (&root_allow_count, root_allow_vector); - root_allow_size = 0; -} - -int -root_allow_ok (arg) - char *arg; -{ - int i; - - if (root_allow_count == 0) - { - /* Probably someone upgraded from CVS before 1.9.10 to 1.9.10 - or later without reading the documentation about - --allow-root. Printing an error here doesn't disclose any - particularly useful information to an attacker because a - CVS server configured in this way won't let *anyone* in. */ - - /* Note that we are called from a context where we can spit - back "error" rather than waiting for the next request which - expects responses. */ - printf ("\ -error 0 Server configuration missing --allow-root in inetd.conf\n"); - error_exit (); - } - - for (i = 0; i < root_allow_count; ++i) - if (strcmp (root_allow_vector[i], arg) == 0) - return 1; - return 0; -} - - - /* This global variable holds the global -d option. It is NULL if -d was not used, which means that we must get the CVSroot information from the CVSROOT environment variable or from a CVS/Root file. */ |