version 1.16, 2003/07/30 20:27:32 |
version 1.17, 2005/01/19 21:08:09 |
|
|
X#include <unistd.h> |
X#include <unistd.h> |
X#include <sys/types.h> |
X#include <sys/types.h> |
X |
X |
X#ifndef __CONCAT |
|
X#if defined(__STDC__) || defined(__cplusplus) |
|
X#define __CONCAT(x,y) x ## y |
|
X#else |
|
X#define __CONCAT(x,y) x/**/y |
|
X#endif |
|
X#endif |
|
X |
|
X#ifndef __CONCAT3 |
|
X#if defined(__STDC__) || defined(__cplusplus) |
|
X#define __CONCAT3(x,y,z) x ## y ## z |
|
X#else |
|
X#define __CONCAT3(x,y,z) x/**/y/**/z |
|
X#endif |
|
X#endif |
|
X |
|
X#ifndef __P |
X#ifndef __P |
X#if defined(__STDC__) || defined(__cplusplus) |
X#if defined(__STDC__) || defined(__cplusplus) |
X#define __P(protos) protos /* full-blown ANSI C */ |
X#define __P(protos) protos /* full-blown ANSI C */ |
|
|
X * $CVSROOT is created based on HOSTNAME and LOCALROOT above |
X * $CVSROOT is created based on HOSTNAME and LOCALROOT above |
X */ |
X */ |
X#ifndef CVSROOT |
X#ifndef CVSROOT |
X#define CVSROOT __CONCAT3(HOSTNAME,":",LOCALROOT) |
X#define CVSROOT HOSTNAME ":"LOCALROOT |
X#endif |
X#endif |
X |
X |
X/* |
X/* |
|
|
Xint main __P((int, char *[])); |
Xint main __P((int, char *[])); |
X |
X |
Xchar * const env[] = { |
Xchar * const env[] = { |
X __CONCAT("PATH=",_PATH_DEFPATH), |
X "PATH="_PATH_DEFPATH, |
X __CONCAT("SHELL=",_PATH_BSHELL), |
X "SHELL="_PATH_BSHELL, |
X __CONCAT("CVSROOT=",LOCALROOT), |
X "CVSROOT="LOCALROOT, |
X "HOME=/", |
X "HOME=/", |
X "CVSREADONLYFS=1", |
X "CVSREADONLYFS=1", |
X NULL |
X NULL |
|
|
X us, ntohs(my_sa.sin_port)); |
X us, ntohs(my_sa.sin_port)); |
X#endif /* USE_SYSLOG */ |
X#endif /* USE_SYSLOG */ |
X execle("/usr/bin/cvs", "cvs", |
X execle("/usr/bin/cvs", "cvs", |
X __CONCAT("--allow-root=",LOCALROOT), "pserver", (char *)NULL, env); |
X "--allow-root="LOCALROOT, "pserver", (char *)NULL, env); |
X perror("execle: cvs"); |
X perror("execle: cvs"); |
X fprintf(stderr, "unable to exec CVS pserver!\n"); |
X fprintf(stderr, "unable to exec CVS pserver!\n"); |
X exit(1); |
X exit(1); |
|
|
X strcmp("anoncvssh", argv[0]) != 0 || |
X strcmp("anoncvssh", argv[0]) != 0 || |
X strcmp("-c", argv[1]) != 0 || |
X strcmp("-c", argv[1]) != 0 || |
X (strcmp("cvs server", argv[2]) != 0 && |
X (strcmp("cvs server", argv[2]) != 0 && |
X strcmp(__CONCAT3("cvs -d ",LOCALROOT," server"), argv[2]) != 0)) { |
X strcmp("cvs -d "LOCALROOT" server", argv[2]) != 0)) { |
X fprintf(stderr, "\nTo use anonymous CVS install the latest "); |
X fprintf(stderr, "\nTo use anonymous CVS install the latest "); |
X fprintf(stderr,"version of CVS on your local machine.\n"); |
X fprintf(stderr,"version of CVS on your local machine.\n"); |
X fprintf(stderr,"Then set your CVSROOT environment variable "); |
X fprintf(stderr,"Then set your CVSROOT environment variable "); |