diff options
author | 2003-01-23 20:00:20 +0000 | |
---|---|---|
committer | 2003-01-23 20:00:20 +0000 | |
commit | a6f8fe3811170a24ecc123b7796beae0af3a5e4f (patch) | |
tree | a32b631ae6b493d14915d75298e94c14aaf925d8 | |
parent | be consistant on the spl everywhere and use splimp(), this seems to prevent wi_mgmt_xmit: xmit failed messages; millert@ testing and ok (diff) | |
download | wireguard-openbsd-a6f8fe3811170a24ecc123b7796beae0af3a5e4f.tar.xz wireguard-openbsd-a6f8fe3811170a24ecc123b7796beae0af3a5e4f.zip |
Add a "DisableXProg" option to CVSROOT/config that can be used to
disable support for Update-prog and Checkin-prog. This is a good
idea for anonymouse cvs servers or anyone who doesn't need this
feature. From Stefan Esser.
-rw-r--r-- | gnu/usr.bin/cvs/src/parseinfo.c | 23 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/server.c | 25 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/src/server.h | 1 |
3 files changed, 49 insertions, 0 deletions
diff --git a/gnu/usr.bin/cvs/src/parseinfo.c b/gnu/usr.bin/cvs/src/parseinfo.c index 9d501ffcb53..19a960c6c94 100644 --- a/gnu/usr.bin/cvs/src/parseinfo.c +++ b/gnu/usr.bin/cvs/src/parseinfo.c @@ -359,6 +359,29 @@ parse_config (cvsroot) } #endif /* BSD */ } + else if (strcmp (line, "DisableXProg") == 0) + { + if (strcmp (p, "no") == 0) +#ifdef AUTH_SERVER_SUPPORT + disable_x_prog = 0; +#else + /* Still parse the syntax but ignore the + option. That way the same config file can + be used for local and server. */ + ; +#endif + else if (strcmp (p, "yes") == 0) +#ifdef AUTH_SERVER_SUPPORT + disable_x_prog = 1; +#else + ; +#endif + else + { + error (0, 0, "unrecognized value '%s' for DisableXProg", p); + goto error_return; + } + } else if (strcmp (line, "PreservePermissions") == 0) { if (strcmp (p, "no") == 0) diff --git a/gnu/usr.bin/cvs/src/server.c b/gnu/usr.bin/cvs/src/server.c index 4a61b1dbf14..0fba6ee9f2a 100644 --- a/gnu/usr.bin/cvs/src/server.c +++ b/gnu/usr.bin/cvs/src/server.c @@ -115,6 +115,10 @@ static char *Pserver_Repos = NULL; CVSROOT/config. */ int system_auth = 1; +/* Should we disable Update-prog/Checkin-prog? Can be changed by + CVSROOT/config. */ +int disable_x_prog = 0; + # endif /* AUTH_SERVER_SUPPORT */ @@ -4629,6 +4633,17 @@ serve_checkin_prog (arg) char *arg; { FILE *f; + + /* Before we do anything we first check if this command is not + disabled. */ + if (disable_x_prog) + { + if (alloc_pending (80)) + sprintf (pending_error_text, "\ +E Checkin-prog disabled by configuration"); + return; + } + f = CVS_FOPEN (CVSADM_CIPROG, "w+"); if (f == NULL) { @@ -4663,6 +4678,16 @@ serve_update_prog (arg) { FILE *f; + /* Before we do anything we first check if this command is not + disabled. */ + if (disable_x_prog) + { + if (alloc_pending (80)) + sprintf (pending_error_text, "\ +E Update-prog disabled by configuration"); + return; + } + /* Before we do anything we need to make sure we are not in readonly mode. */ if (!check_command_legal_p ("commit")) diff --git a/gnu/usr.bin/cvs/src/server.h b/gnu/usr.bin/cvs/src/server.h index caeff8a7ccc..a6055a36c7d 100644 --- a/gnu/usr.bin/cvs/src/server.h +++ b/gnu/usr.bin/cvs/src/server.h @@ -131,6 +131,7 @@ extern void server_pause_check PROTO((void)); #ifdef AUTH_SERVER_SUPPORT extern char *CVS_Username; extern int system_auth; +extern int disable_x_prog; #endif /* AUTH_SERVER_SUPPORT */ #endif /* SERVER_SUPPORT */ |