diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-12-15 08:02:54 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-12-15 08:02:54 +0000 |
commit | bde5f356eb1af7a9529e063bdafb7b44084f0314 (patch) | |
tree | a45cc9a6028ff977712a6787f3715953bf3f7e5b /usr.bin/cvs | |
parent | 68b6f17ee337c5f9a9ec7019e74b22389f3c7092 (diff) |
server-side Sticky bits.
Diffstat (limited to 'usr.bin/cvs')
-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, 27 insertions, 4 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c index a72ce40c1ef..da8354195d4 100644 --- a/usr.bin/cvs/client.c +++ b/usr.bin/cvs/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.29 2006/12/14 15:13:17 xsa Exp $ */ +/* $OpenBSD: client.c,v 1.30 2006/12/15 08:02:53 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 }, + { "Sticky", 0, cvs_server_sticky, REQ_NEEDED }, { "Entry", 0, cvs_server_entry, REQ_NEEDED }, { "Modified", 0, cvs_server_modified, REQ_NEEDED }, { "UseUnchanged", 0, cvs_server_useunchanged, REQ_NEEDED }, @@ -44,7 +45,6 @@ struct cvs_req cvs_requests[] = { */ { "Max-dotdot", 0, NULL, 0 }, { "Static-directory", 0, NULL, 0 }, - { "Sticky", 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 1181a839ebd..cc243b2166e 100644 --- a/usr.bin/cvs/remote.h +++ b/usr.bin/cvs/remote.h @@ -1,4 +1,4 @@ -/* $OpenBSD: remote.h,v 1.9 2006/11/27 16:04:10 xsa Exp $ */ +/* $OpenBSD: remote.h,v 1.10 2006/12/15 08:02:53 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_sticky(char *); void cvs_server_add(char *); void cvs_server_admin(char *); diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index 59bd3d0d549..fe17771cdc7 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.41 2006/12/04 09:51:21 xsa Exp $ */ +/* $OpenBSD: server.c,v 1.42 2006/12/15 08:02:53 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -217,6 +217,28 @@ cvs_server_validreq(char *data) } void +cvs_server_sticky(char *data) +{ + FILE *fp; + char *tagpath; + + tagpath = xmalloc(MAXPATHLEN); + if (cvs_path_cat(server_currentdir, CVS_PATH_TAG, tagpath, + MAXPATHLEN) >= MAXPATHLEN) + fatal("cvs_server_sticky: truncation"); + + if ((fp = fopen(tagpath ,"w+")) == NULL) { + cvs_log(LP_ERRNO, "%s", tagpath); + goto out; + } + + (void)fprintf(fp, "%s\n", data); + (void)fclose(fp); +out: + xfree(tagpath); +} + +void cvs_server_globalopt(char *data) { if (!strcmp(data, "-l")) |