From bde5f356eb1af7a9529e063bdafb7b44084f0314 Mon Sep 17 00:00:00 2001 From: Xavier Santolaria Date: Fri, 15 Dec 2006 08:02:54 +0000 Subject: server-side Sticky bits. --- usr.bin/cvs/server.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'usr.bin/cvs/server.c') 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 * @@ -216,6 +216,28 @@ cvs_server_validreq(char *data) xfree(d); } +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) { -- cgit v1.2.3