[BACK]Return to server.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

Annotation of src/usr.bin/cvs/server.c, Revision 1.59

1.59    ! ray         1: /*     $OpenBSD: server.c,v 1.58 2007/05/26 23:19:31 ray Exp $ */
1.1       jfb         2: /*
1.29      joris       3:  * Copyright (c) 2006 Joris Vink <joris@openbsd.org>
1.1       jfb         4:  *
1.29      joris       5:  * Permission to use, copy, modify, and distribute this software for any
                      6:  * purpose with or without fee is hereby granted, provided that the above
                      7:  * copyright notice and this permission notice appear in all copies.
1.1       jfb         8:  *
1.29      joris       9:  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10:  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11:  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12:  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13:  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     14:  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     15:  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1       jfb        16:  */
                     17:
1.55      otto       18: #include <sys/stat.h>
                     19:
                     20: #include <errno.h>
                     21: #include <fcntl.h>
                     22: #include <libgen.h>
                     23: #include <stdlib.h>
                     24: #include <string.h>
                     25: #include <unistd.h>
1.1       jfb        26:
                     27: #include "cvs.h"
1.29      joris      28: #include "remote.h"
                     29:
                     30: struct cvs_resp cvs_responses[] = {
                     31:        /* this is what our server uses, the client should support it */
                     32:        { "Valid-requests",     1,      cvs_client_validreq, RESP_NEEDED },
                     33:        { "ok",                 0,      cvs_client_ok, RESP_NEEDED},
                     34:        { "error",              0,      cvs_client_error, RESP_NEEDED },
                     35:        { "E",                  0,      cvs_client_e, RESP_NEEDED },
                     36:        { "M",                  0,      cvs_client_m, RESP_NEEDED },
                     37:        { "Checked-in",         0,      cvs_client_checkedin, RESP_NEEDED },
                     38:        { "Updated",            0,      cvs_client_updated, RESP_NEEDED },
                     39:        { "Merged",             0,      cvs_client_merged, RESP_NEEDED },
                     40:        { "Removed",            0,      cvs_client_removed, RESP_NEEDED },
                     41:        { "Remove-entry",       0,      cvs_client_remove_entry, RESP_NEEDED },
1.46      xsa        42:        { "Set-static-directory",       0,      cvs_client_set_static_directory, RESP_NEEDED },
1.45      xsa        43:        { "Clear-static-directory",     0,      cvs_client_clear_static_directory, RESP_NEEDED },
                     44:        { "Set-sticky",         0,      cvs_client_set_sticky, RESP_NEEDED },
                     45:        { "Clear-sticky",       0,      cvs_client_clear_sticky, RESP_NEEDED },
1.29      joris      46:
                     47:        /* unsupported responses until told otherwise */
                     48:        { "New-entry",                  0,      NULL, 0 },
                     49:        { "Created",                    0,      NULL, 0 },
                     50:        { "Update-existing",            0,      NULL, 0 },
                     51:        { "Rcs-diff",                   0,      NULL, 0 },
                     52:        { "Patched",                    0,      NULL, 0 },
                     53:        { "Mode",                       0,      NULL, 0 },
                     54:        { "Mod-time",                   0,      NULL, 0 },
                     55:        { "Checksum",                   0,      NULL, 0 },
                     56:        { "Copy-file",                  0,      NULL, 0 },
                     57:        { "Template",                   0,      NULL, 0 },
                     58:        { "Set-checkin-prog",           0,      NULL, 0 },
                     59:        { "Set-update-prog",            0,      NULL, 0 },
                     60:        { "Notified",                   0,      NULL, 0 },
                     61:        { "Module-expansion",           0,      NULL, 0 },
                     62:        { "Wrapper-rcsOption",          0,      NULL, 0 },
                     63:        { "Mbinary",                    0,      NULL, 0 },
                     64:        { "F",                          0,      NULL, 0 },
                     65:        { "MT",                         0,      NULL, 0 },
                     66:        { "",                           -1,     NULL, 0 }
                     67: };
1.1       jfb        68:
1.29      joris      69: int    cvs_server(int, char **);
                     70: char   *cvs_server_path = NULL;
1.1       jfb        71:
1.29      joris      72: static char *server_currentdir = NULL;
                     73: static char *server_argv[CVS_CMD_MAXARG];
                     74: static int server_argc = 1;
1.8       joris      75:
1.17      jfb        76: struct cvs_cmd cvs_cmd_server = {
1.29      joris      77:        CVS_OP_SERVER, 0, "server", { "", "" },
                     78:        "server mode",
1.17      jfb        79:        NULL,
1.29      joris      80:        NULL,
                     81:        NULL,
                     82:        cvs_server
1.17      jfb        83: };
1.1       jfb        84:
1.14      joris      85:
1.1       jfb        86: int
                     87: cvs_server(int argc, char **argv)
                     88: {
1.29      joris      89:        char *cmd, *data;
                     90:        struct cvs_req *req;
                     91:
                     92:        server_argv[0] = xstrdup("server");
                     93:
1.58      ray        94:        (void)xasprintf(&cvs_server_path, "%s/cvs-serv%d", cvs_tmpdir,
                     95:            getpid());
1.29      joris      96:
                     97:        if (mkdir(cvs_server_path, 0700) == -1)
                     98:                fatal("failed to create temporary server directory: %s, %s",
                     99:                    cvs_server_path, strerror(errno));
                    100:
                    101:        if (chdir(cvs_server_path) == -1)
                    102:                fatal("failed to change directory to '%s'", cvs_server_path);
                    103:
                    104:        for (;;) {
                    105:                cmd = cvs_remote_input();
                    106:
                    107:                if ((data = strchr(cmd, ' ')) != NULL)
                    108:                        (*data++) = '\0';
                    109:
                    110:                req = cvs_remote_get_request_info(cmd);
                    111:                if (req == NULL)
                    112:                        fatal("request '%s' is not supported by our server",
                    113:                            cmd);
                    114:
                    115:                if (req->hdlr == NULL)
                    116:                        fatal("opencvs server does not support '%s'", cmd);
                    117:
                    118:                (*req->hdlr)(data);
                    119:                xfree(cmd);
1.14      joris     120:        }
                    121:
1.29      joris     122:        return (0);
                    123: }
                    124:
                    125: void
                    126: cvs_server_send_response(char *fmt, ...)
                    127: {
                    128:        va_list ap;
1.59    ! ray       129:        char *data;
1.29      joris     130:
                    131:        va_start(ap, fmt);
1.56      ray       132:        if (vasprintf(&data, fmt, ap) == -1)
                    133:                fatal("vasprintf: %s", strerror(errno));
1.29      joris     134:        va_end(ap);
1.14      joris     135:
1.30      joris     136:        cvs_log(LP_TRACE, "%s", data);
1.29      joris     137:        cvs_remote_output(data);
                    138:        xfree(data);
                    139: }
                    140:
                    141: void
                    142: cvs_server_root(char *data)
                    143: {
                    144:        fatal("duplicate Root request from client, violates the protocol");
                    145: }
                    146:
                    147: void
                    148: cvs_server_validresp(char *data)
                    149: {
                    150:        int i;
                    151:        char *sp, *ep;
                    152:        struct cvs_resp *resp;
                    153:
1.57      ray       154:        if ((sp = data) == NULL)
                    155:                fatal("Missing argument for Valid-responses");
                    156:
1.29      joris     157:        do {
                    158:                if ((ep = strchr(sp, ' ')) != NULL)
                    159:                        *ep = '\0';
                    160:
                    161:                resp = cvs_remote_get_response_info(sp);
                    162:                if (resp != NULL)
                    163:                        resp->supported = 1;
                    164:
                    165:                if (ep != NULL)
                    166:                        sp = ep + 1;
                    167:        } while (ep != NULL);
                    168:
                    169:        for (i = 0; cvs_responses[i].supported != -1; i++) {
                    170:                resp = &cvs_responses[i];
                    171:                if ((resp->flags & RESP_NEEDED) &&
                    172:                    resp->supported != 1) {
                    173:                        fatal("client does not support required '%s'",
                    174:                            resp->name);
1.1       jfb       175:                }
1.29      joris     176:        }
                    177: }
1.1       jfb       178:
1.29      joris     179: void
                    180: cvs_server_validreq(char *data)
                    181: {
                    182:        BUF *bp;
                    183:        char *d;
                    184:        int i, first;
                    185:
                    186:        first = 0;
                    187:        bp = cvs_buf_alloc(512, BUF_AUTOEXT);
                    188:        for (i = 0; cvs_requests[i].supported != -1; i++) {
                    189:                if (cvs_requests[i].hdlr == NULL)
1.5       jfb       190:                        continue;
1.1       jfb       191:
1.29      joris     192:                if (first != 0)
                    193:                        cvs_buf_append(bp, " ", 1);
                    194:                else
                    195:                        first++;
                    196:
                    197:                cvs_buf_append(bp, cvs_requests[i].name,
                    198:                    strlen(cvs_requests[i].name));
                    199:        }
                    200:
                    201:        cvs_buf_putc(bp, '\0');
                    202:        d = cvs_buf_release(bp);
                    203:
                    204:        cvs_server_send_response("Valid-requests %s", d);
                    205:        cvs_server_send_response("ok");
                    206:        xfree(d);
1.42      xsa       207: }
                    208:
                    209: void
1.43      xsa       210: cvs_server_static_directory(char *data)
                    211: {
                    212:        FILE *fp;
1.51      otto      213:        char fpath[MAXPATHLEN];
1.43      xsa       214:
1.54      xsa       215:        (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s",
                    216:            server_currentdir, CVS_PATH_STATICENTRIES);
1.43      xsa       217:
                    218:        if ((fp = fopen(fpath, "w+")) == NULL) {
                    219:                cvs_log(LP_ERRNO, "%s", fpath);
1.51      otto      220:                return;
1.43      xsa       221:        }
                    222:        (void)fclose(fp);
                    223: }
                    224:
                    225: void
1.42      xsa       226: cvs_server_sticky(char *data)
                    227: {
                    228:        FILE *fp;
1.51      otto      229:        char tagpath[MAXPATHLEN];
1.42      xsa       230:
1.57      ray       231:        if (data == NULL)
                    232:                fatal("Missing argument for Sticky");
                    233:
1.54      xsa       234:        (void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s",
                    235:            server_currentdir, CVS_PATH_TAG);
1.42      xsa       236:
1.43      xsa       237:        if ((fp = fopen(tagpath, "w+")) == NULL) {
1.42      xsa       238:                cvs_log(LP_ERRNO, "%s", tagpath);
1.51      otto      239:                return;
1.42      xsa       240:        }
                    241:
                    242:        (void)fprintf(fp, "%s\n", data);
                    243:        (void)fclose(fp);
1.29      joris     244: }
                    245:
                    246: void
                    247: cvs_server_globalopt(char *data)
                    248: {
1.57      ray       249:        if (data == NULL)
                    250:                fatal("Missing argument for Global_option");
                    251:
1.38      xsa       252:        if (!strcmp(data, "-l"))
                    253:                cvs_nolog = 1;
1.29      joris     254:
                    255:        if (!strcmp(data, "-n"))
                    256:                cvs_noexec = 1;
1.38      xsa       257:
                    258:        if (!strcmp(data, "-Q"))
                    259:                verbosity = 0;
                    260:
                    261:        if (!strcmp(data, "-r"))
                    262:                cvs_readonly = 1;
                    263:
                    264:        if (!strcmp(data, "-t"))
                    265:                cvs_trace = 1;
1.29      joris     266:
                    267:        if (!strcmp(data, "-V"))
                    268:                verbosity = 2;
1.39      xsa       269: }
                    270:
                    271: void
                    272: cvs_server_set(char *data)
                    273: {
                    274:        char *ep;
                    275:
1.57      ray       276:        if (data == NULL)
                    277:                fatal("Missing argument for Set");
                    278:
1.39      xsa       279:        ep = strchr(data, '=');
                    280:        if (ep == NULL)
                    281:                fatal("no = in variable assignment");
                    282:
                    283:        *(ep++) = '\0';
                    284:        if (cvs_var_set(data, ep) < 0)
                    285:                fatal("cvs_server_set: cvs_var_set failed");
1.29      joris     286: }
1.1       jfb       287:
1.29      joris     288: void
                    289: cvs_server_directory(char *data)
                    290: {
                    291:        CVSENTRIES *entlist;
1.51      otto      292:        char *dir, *repo, *parent, entry[CVS_ENT_MAXLINELEN], *dirn, *p;
1.29      joris     293:
                    294:        dir = cvs_remote_input();
1.49      joris     295:        STRIP_SLASH(dir);
                    296:
                    297:        if (strlen(dir) < strlen(current_cvsroot->cr_dir))
1.29      joris     298:                fatal("cvs_server_directory: bad Directory request");
                    299:
1.49      joris     300:        repo = dir + strlen(current_cvsroot->cr_dir);
                    301:
                    302:        /*
                    303:         * This is somewhat required for checkout, as the
                    304:         * directory request will be:
                    305:         *
                    306:         * Directory .
                    307:         * /path/to/cvs/root
                    308:         */
                    309:        if (repo[0] == '\0')
                    310:                p = xstrdup(".");
                    311:        else
                    312:                p = xstrdup(repo + 1);
                    313:
                    314:        cvs_mkpath(p);
1.29      joris     315:
1.49      joris     316:        if ((dirn = basename(p)) == NULL)
1.29      joris     317:                fatal("cvs_server_directory: %s", strerror(errno));
                    318:
1.49      joris     319:        if ((parent = dirname(p)) == NULL)
1.29      joris     320:                fatal("cvs_server_directory: %s", strerror(errno));
                    321:
                    322:        if (strcmp(parent, ".")) {
                    323:                entlist = cvs_ent_open(parent);
1.53      xsa       324:                (void)xsnprintf(entry, CVS_ENT_MAXLINELEN, "D/%s////", dirn);
1.29      joris     325:
                    326:                cvs_ent_add(entlist, entry);
                    327:                cvs_ent_close(entlist, ENT_SYNC);
1.1       jfb       328:        }
                    329:
1.29      joris     330:        if (server_currentdir != NULL)
                    331:                xfree(server_currentdir);
1.49      joris     332:        server_currentdir = xstrdup(p);
1.29      joris     333:
1.49      joris     334:        xfree(p);
1.29      joris     335:        xfree(dir);
                    336: }
                    337:
                    338: void
                    339: cvs_server_entry(char *data)
                    340: {
                    341:        CVSENTRIES *entlist;
                    342:
1.57      ray       343:        if (data == NULL)
                    344:                fatal("Missing argument for Entry");
                    345:
1.29      joris     346:        entlist = cvs_ent_open(server_currentdir);
                    347:        cvs_ent_add(entlist, data);
                    348:        cvs_ent_close(entlist, ENT_SYNC);
                    349: }
                    350:
                    351: void
                    352: cvs_server_modified(char *data)
                    353: {
1.41      xsa       354:        int fd;
1.29      joris     355:        size_t flen;
                    356:        mode_t fmode;
                    357:        const char *errstr;
1.51      otto      358:        char *mode, *len, fpath[MAXPATHLEN];
1.29      joris     359:
1.57      ray       360:        if (data == NULL)
                    361:                fatal("Missing argument for Modified");
                    362:
1.29      joris     363:        mode = cvs_remote_input();
                    364:        len = cvs_remote_input();
                    365:
                    366:        cvs_strtomode(mode, &fmode);
                    367:        xfree(mode);
                    368:
                    369:        flen = strtonum(len, 0, INT_MAX, &errstr);
                    370:        if (errstr != NULL)
                    371:                fatal("cvs_server_modified: %s", errstr);
                    372:        xfree(len);
                    373:
1.54      xsa       374:        (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", server_currentdir, data);
1.29      joris     375:
                    376:        if ((fd = open(fpath, O_WRONLY | O_CREAT | O_TRUNC)) == -1)
                    377:                fatal("cvs_server_modified: %s: %s", fpath, strerror(errno));
                    378:
1.48      joris     379:        cvs_remote_receive_file(fd, flen);
1.29      joris     380:
                    381:        if (fchmod(fd, 0600) == -1)
                    382:                fatal("cvs_server_modified: failed to set file mode");
                    383:
                    384:        (void)close(fd);
                    385: }
                    386:
                    387: void
                    388: cvs_server_useunchanged(char *data)
                    389: {
                    390: }
                    391:
                    392: void
                    393: cvs_server_unchanged(char *data)
                    394: {
1.41      xsa       395:        int fd;
1.51      otto      396:        char fpath[MAXPATHLEN];
1.29      joris     397:        CVSENTRIES *entlist;
                    398:        struct cvs_ent *ent;
                    399:        struct timeval tv[2];
                    400:
1.57      ray       401:        if (data == NULL)
                    402:                fatal("Missing argument for Unchanged");
                    403:
1.54      xsa       404:        (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", server_currentdir, data);
1.29      joris     405:
                    406:        if ((fd = open(fpath, O_RDWR | O_CREAT | O_TRUNC)) == -1)
                    407:                fatal("cvs_server_unchanged: %s: %s", fpath, strerror(errno));
                    408:
                    409:        entlist = cvs_ent_open(server_currentdir);
                    410:        ent = cvs_ent_get(entlist, data);
                    411:        if (ent == NULL)
                    412:                fatal("received Unchanged request for non-existing file");
                    413:        cvs_ent_close(entlist, ENT_NOSYNC);
                    414:
1.52      joris     415:        tv[0].tv_sec = ent->ce_mtime;
1.29      joris     416:        tv[0].tv_usec = 0;
                    417:        tv[1] = tv[0];
                    418:        if (futimes(fd, tv) == -1)
                    419:                fatal("cvs_server_unchanged: failed to set modified time");
                    420:
                    421:        if (fchmod(fd, 0600) == -1)
                    422:                fatal("cvs_server_unchanged: failed to set mode");
                    423:
                    424:        cvs_ent_free(ent);
                    425:        (void)close(fd);
                    426: }
                    427:
                    428: void
                    429: cvs_server_questionable(char *data)
                    430: {
                    431: }
                    432:
                    433: void
                    434: cvs_server_argument(char *data)
                    435: {
                    436:
                    437:        if (server_argc > CVS_CMD_MAXARG)
                    438:                fatal("cvs_server_argument: too many arguments sent");
1.57      ray       439:
                    440:        if (data == NULL)
                    441:                fatal("Missing argument for Argument");
1.29      joris     442:
                    443:        server_argv[server_argc++] = xstrdup(data);
1.37      xsa       444: }
                    445:
                    446: void
                    447: cvs_server_argumentx(char *data)
                    448: {
1.44      xsa       449: }
                    450:
                    451: void
                    452: cvs_server_update_patches(char *data)
                    453: {
                    454:        /*
                    455:         * This does not actually do anything.
                    456:         * It is used to tell that the server is able to
                    457:         * generate patches when given an `update' request.
                    458:         * The client must issue the -u argument to `update'
                    459:         * to receive patches.
                    460:         */
1.29      joris     461: }
                    462:
                    463: void
1.31      xsa       464: cvs_server_add(char *data)
                    465: {
                    466:        if (chdir(server_currentdir) == -1)
                    467:                fatal("cvs_server_add: %s", strerror(errno));
                    468:
                    469:        cvs_cmdop = CVS_OP_ADD;
                    470:        cvs_add(server_argc, server_argv);
1.50      joris     471:        cvs_server_send_response("ok");
                    472: }
                    473:
                    474: void
                    475: cvs_server_import(char *data)
                    476: {
                    477:        if (chdir(server_currentdir) == -1)
                    478:                fatal("cvs_server_import: %s", strerror(errno));
                    479:
                    480:        cvs_cmdop = CVS_OP_IMPORT;
                    481:        cvs_import(server_argc, server_argv);
1.31      xsa       482:        cvs_server_send_response("ok");
                    483: }
1.35      xsa       484:
                    485: void
                    486: cvs_server_admin(char *data)
                    487: {
                    488:        if (chdir(server_currentdir) == -1)
                    489:                fatal("cvs_server_admin: %s", strerror(errno));
                    490:
                    491:        cvs_cmdop = CVS_OP_ADMIN;
                    492:        cvs_admin(server_argc, server_argv);
                    493:        cvs_server_send_response("ok");
                    494: }
                    495:
1.40      xsa       496: void
                    497: cvs_server_annotate(char *data)
                    498: {
                    499:        if (chdir(server_currentdir) == -1)
                    500:                fatal("cvs_server_annotate: %s", strerror(errno));
                    501:
                    502:        cvs_cmdop = CVS_OP_ANNOTATE;
                    503:        cvs_annotate(server_argc, server_argv);
                    504:        cvs_server_send_response("ok");
                    505: }
1.31      xsa       506:
                    507: void
1.29      joris     508: cvs_server_commit(char *data)
                    509: {
                    510:        if (chdir(server_currentdir) == -1)
                    511:                fatal("cvs_server_commit: %s", strerror(errno));
                    512:
                    513:        cvs_cmdop = CVS_OP_COMMIT;
                    514:        cvs_commit(server_argc, server_argv);
1.49      joris     515:        cvs_server_send_response("ok");
                    516: }
                    517:
                    518: void
                    519: cvs_server_checkout(char *data)
                    520: {      if (chdir(server_currentdir) == -1)
                    521:                fatal("cvs_server_checkout: %s", strerror(errno));
                    522:
                    523:        cvs_cmdop = CVS_OP_CHECKOUT;
                    524:        cvs_checkout(server_argc, server_argv);
1.29      joris     525:        cvs_server_send_response("ok");
                    526: }
                    527:
                    528: void
                    529: cvs_server_diff(char *data)
                    530: {
                    531:        if (chdir(server_currentdir) == -1)
                    532:                fatal("cvs_server_diff: %s", strerror(errno));
                    533:
                    534:        cvs_cmdop = CVS_OP_DIFF;
                    535:        cvs_diff(server_argc, server_argv);
1.34      xsa       536:        cvs_server_send_response("ok");
                    537: }
                    538:
                    539: void
                    540: cvs_server_init(char *data)
                    541: {
                    542:        if (chdir(server_currentdir) == -1)
                    543:                fatal("cvs_server_init: %s", strerror(errno));
                    544:
                    545:        cvs_cmdop = CVS_OP_INIT;
                    546:        cvs_init(server_argc, server_argv);
1.31      xsa       547:        cvs_server_send_response("ok");
                    548: }
                    549:
                    550: void
                    551: cvs_server_remove(char *data)
                    552: {
                    553:        if (chdir(server_currentdir) == -1)
                    554:                fatal("cvs_server_remove: %s", strerror(errno));
                    555:
                    556:        cvs_cmdop = CVS_OP_REMOVE;
                    557:        cvs_remove(server_argc, server_argv);
1.29      joris     558:        cvs_server_send_response("ok");
                    559: }
                    560:
                    561: void
                    562: cvs_server_status(char *data)
                    563: {
                    564:        if (chdir(server_currentdir) == -1)
                    565:                fatal("cvs_server_status: %s", strerror(errno));
                    566:
                    567:        cvs_cmdop = CVS_OP_STATUS;
                    568:        cvs_status(server_argc, server_argv);
                    569:        cvs_server_send_response("ok");
                    570: }
                    571:
                    572: void
                    573: cvs_server_log(char *data)
                    574: {
                    575:        if (chdir(server_currentdir) == -1)
                    576:                fatal("cvs_server_log: %s", strerror(errno));
                    577:
                    578:        cvs_cmdop = CVS_OP_LOG;
1.32      xsa       579:        cvs_getlog(server_argc, server_argv);
                    580:        cvs_server_send_response("ok");
                    581: }
                    582:
                    583: void
                    584: cvs_server_tag(char *data)
                    585: {
                    586:        if (chdir(server_currentdir) == -1)
                    587:                fatal("cvs_server_tag: %s", strerror(errno));
                    588:
                    589:        cvs_cmdop = CVS_OP_TAG;
1.33      xsa       590:        cvs_tag(server_argc, server_argv);
1.29      joris     591:        cvs_server_send_response("ok");
                    592: }
                    593:
                    594: void
                    595: cvs_server_update(char *data)
                    596: {
                    597:        if (chdir(server_currentdir) == -1)
                    598:                fatal("cvs_server_update: %s", strerror(errno));
1.14      joris     599:
1.29      joris     600:        cvs_cmdop = CVS_OP_UPDATE;
                    601:        cvs_update(server_argc, server_argv);
1.36      xsa       602:        cvs_server_send_response("ok");
                    603: }
                    604:
                    605: void
                    606: cvs_server_version(char *data)
                    607: {
                    608:        cvs_cmdop = CVS_OP_VERSION;
                    609:        cvs_version(server_argc, server_argv);
1.29      joris     610:        cvs_server_send_response("ok");
1.47      joris     611: }
                    612:
                    613: void
                    614: cvs_server_update_entry(const char *resp, struct cvs_file *cf)
                    615: {
1.58      ray       616:        char *p;
1.47      joris     617:
                    618:        if ((p = strrchr(cf->file_rpath, ',')) != NULL)
                    619:                *p = '\0';
                    620:
1.58      ray       621:        cvs_server_send_response("%s %s/", resp, cf->file_wd);
1.47      joris     622:        cvs_remote_output(cf->file_rpath);
                    623:
                    624:        if (p != NULL)
                    625:                *p = ',';
1.1       jfb       626: }