diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-12-15 09:50:38 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-12-15 09:50:38 +0000 |
commit | 88355826afc100b74e57a6d88fbd99a91f4ac6c7 (patch) | |
tree | 789750b5f83a2ee46c7b328334fdc1de1a4713cf | |
parent | e8f8d5703435cd511ff27bd9afe6afb84d81f950 (diff) |
server-side Static-directory bits.
-rw-r--r-- | usr.bin/cvs/client.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/remote.h | 3 | ||||
-rw-r--r-- | usr.bin/cvs/server.c | 24 |
3 files changed, 26 insertions, 5 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c index 8564ea4db30..a603b8d6458 100644 --- a/usr.bin/cvs/client.c +++ b/usr.bin/cvs/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.31 2006/12/15 08:26:18 xsa Exp $ */ +/* $OpenBSD: client.c,v 1.32 2006/12/15 09:50:37 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -28,6 +28,7 @@ struct cvs_req cvs_requests[] = { { "Valid-responses", 1, cvs_server_validresp, REQ_NEEDED }, { "valid-requests", 1, cvs_server_validreq, REQ_NEEDED }, { "Directory", 0, cvs_server_directory, REQ_NEEDED }, + { "Static-directory", 0, cvs_server_static_directory, REQ_NEEDED }, { "Sticky", 0, cvs_server_sticky, REQ_NEEDED }, { "Entry", 0, cvs_server_entry, REQ_NEEDED }, { "Modified", 0, cvs_server_modified, REQ_NEEDED }, @@ -44,7 +45,6 @@ struct cvs_req cvs_requests[] = { * working copy, unsupported until we are told otherwise */ { "Max-dotdot", 0, NULL, 0 }, - { "Static-directory", 0, NULL, 0 }, { "Checkin-prog", 0, NULL, 0 }, { "Update-prog", 0, NULL, 0 }, { "Kopt", 0, NULL, 0 }, diff --git a/usr.bin/cvs/remote.h b/usr.bin/cvs/remote.h index cc243b2166e..4140f0dfaff 100644 --- a/usr.bin/cvs/remote.h +++ b/usr.bin/cvs/remote.h @@ -1,4 +1,4 @@ -/* $OpenBSD: remote.h,v 1.10 2006/12/15 08:02:53 xsa Exp $ */ +/* $OpenBSD: remote.h,v 1.11 2006/12/15 09:50:37 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -72,6 +72,7 @@ void cvs_server_questionable(char *); void cvs_server_argument(char *); void cvs_server_argumentx(char *); void cvs_server_set(char *); +void cvs_server_static_directory(char *); void cvs_server_sticky(char *); void cvs_server_add(char *); diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index fe17771cdc7..2a2d0b5d75d 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.42 2006/12/15 08:02:53 xsa Exp $ */ +/* $OpenBSD: server.c,v 1.43 2006/12/15 09:50:37 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -217,6 +217,26 @@ cvs_server_validreq(char *data) } void +cvs_server_static_directory(char *data) +{ + FILE *fp; + char *fpath; + + fpath = xmalloc(MAXPATHLEN); + if (cvs_path_cat(server_currentdir, CVS_PATH_STATICENTRIES, fpath, + MAXPATHLEN) >= MAXPATHLEN) + fatal("cvs_server_static_directory: truncation"); + + if ((fp = fopen(fpath, "w+")) == NULL) { + cvs_log(LP_ERRNO, "%s", fpath); + goto out; + } + (void)fclose(fp); +out: + xfree(fpath); +} + +void cvs_server_sticky(char *data) { FILE *fp; @@ -227,7 +247,7 @@ cvs_server_sticky(char *data) MAXPATHLEN) >= MAXPATHLEN) fatal("cvs_server_sticky: truncation"); - if ((fp = fopen(tagpath ,"w+")) == NULL) { + if ((fp = fopen(tagpath, "w+")) == NULL) { cvs_log(LP_ERRNO, "%s", tagpath); goto out; } |