diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-06-13 13:02:19 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-06-13 13:02:19 +0000 |
commit | cda54f3979fa7b711c7ad4b601f20fb054780ebf (patch) | |
tree | 84998fa7c63ed36b23f5f78e62585cbf1eb48e17 /usr.bin/cvs/cmd.c | |
parent | 7e40119551435f9b330ac3d8baa3471481154dd9 (diff) |
move the CVSROOT check earlier in the process, this way we get the
CVSROOT checked before the commands are run ... ok joris@.
Diffstat (limited to 'usr.bin/cvs/cmd.c')
-rw-r--r-- | usr.bin/cvs/cmd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/cvs/cmd.c b/usr.bin/cvs/cmd.c index 4b94978ab8b..afe06dbda8d 100644 --- a/usr.bin/cvs/cmd.c +++ b/usr.bin/cvs/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.24 2005/06/07 16:22:19 joris Exp $ */ +/* $OpenBSD: cmd.c,v 1.25 2005/06/13 13:02:18 xsa Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -162,6 +162,9 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv) if (cmd->cmd_op == CVS_OP_SERVER) return cvs_server(argc, argv); + if ((root = cvsroot_get(".")) == NULL) + return (CVS_EX_BADROOT); + i = 1; if (cmd->cmd_init != NULL) { if ((ret = (*cmd->cmd_init)(cmd, argc, argv, &i)) != 0) @@ -174,9 +177,6 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv) if (!(cmd->cmd_flags & CVS_CMD_ALLOWSPEC) && (argc > 0)) return (CVS_EX_USAGE); - if ((root = cvsroot_get(".")) == NULL) - return (CVS_EX_BADROOT); - if ((root->cr_method != CVS_METHOD_LOCAL) && (cvs_connect(root) < 0)) return (CVS_EX_PROTO); |