706 |
cvs_cmd_name = "server"; |
cvs_cmd_name = "server"; |
707 |
} |
} |
708 |
# endif /* AUTH_SERVER_SUPPORT || HAVE_GSSAPI */ |
# endif /* AUTH_SERVER_SUPPORT || HAVE_GSSAPI */ |
709 |
|
#endif /* SERVER_SUPPORT */ |
710 |
|
|
711 |
server_active = strcmp (cvs_cmd_name, "server") == 0; |
server_active = strcmp (cvs_cmd_name, "server") == 0; |
712 |
|
|
|
#endif /* SERVER_SUPPORT */ |
|
|
|
|
713 |
/* This is only used for writing into the history file. For |
/* This is only used for writing into the history file. For |
714 |
remote connections, it might be nice to have hostname |
remote connections, it might be nice to have hostname |
715 |
and/or remote path, on the other hand I'm not sure whether |
and/or remote path, on the other hand I'm not sure whether |
716 |
it is worth the trouble. */ |
it is worth the trouble. */ |
717 |
|
|
|
#ifdef SERVER_SUPPORT |
|
718 |
if (server_active) |
if (server_active) |
719 |
CurDir = xstrdup ("<remote>"); |
CurDir = xstrdup ("<remote>"); |
720 |
else |
else |
|
#endif |
|
721 |
{ |
{ |
722 |
CurDir = xgetwd (); |
CurDir = xgetwd (); |
723 |
if (CurDir == NULL) |
if (CurDir == NULL) |
776 |
if (use_cvsrc) |
if (use_cvsrc) |
777 |
read_cvsrc (&argc, &argv, cvs_cmd_name); |
read_cvsrc (&argc, &argv, cvs_cmd_name); |
778 |
|
|
|
#ifdef SERVER_SUPPORT |
|
779 |
/* Fiddling with CVSROOT doesn't make sense if we're running |
/* Fiddling with CVSROOT doesn't make sense if we're running |
780 |
* in server mode, since the client will send the repository |
* in server mode, since the client will send the repository |
781 |
* directory after the connection is made. |
* directory after the connection is made. |
782 |
*/ |
*/ |
783 |
if (!server_active) |
if (!server_active) |
|
#endif |
|
784 |
{ |
{ |
785 |
/* First check if a root was set via the command line. */ |
/* First check if a root was set via the command line. */ |
786 |
if (CVSroot_cmdline) |
if (CVSroot_cmdline) |
867 |
once). To get out of the loop, we perform a "break" at the |
once). To get out of the loop, we perform a "break" at the |
868 |
end of things. */ |
end of things. */ |
869 |
|
|
870 |
while ( |
while (server_active || |
871 |
#ifdef SERVER_SUPPORT |
walklist (root_directories, set_root_directory, NULL)) |
|
server_active || |
|
|
#endif |
|
|
walklist (root_directories, set_root_directory, NULL) |
|
|
) |
|
872 |
{ |
{ |
|
#ifdef SERVER_SUPPORT |
|
873 |
/* Fiddling with CVSROOT doesn't make sense if we're running |
/* Fiddling with CVSROOT doesn't make sense if we're running |
874 |
in server mode, since the client will send the repository |
in server mode, since the client will send the repository |
875 |
directory after the connection is made. */ |
directory after the connection is made. */ |
876 |
|
|
877 |
if (!server_active) |
if (!server_active) |
|
#endif |
|
878 |
{ |
{ |
879 |
/* Now we're 100% sure that we have a valid CVSROOT |
/* Now we're 100% sure that we have a valid CVSROOT |
880 |
variable. Parse it to see if we're supposed to do |
variable. Parse it to see if we're supposed to do |
887 |
/* |
/* |
888 |
* Check to see if the repository exists. |
* Check to see if the repository exists. |
889 |
*/ |
*/ |
|
#ifdef CLIENT_SUPPORT |
|
890 |
if (!current_parsed_root->isremote) |
if (!current_parsed_root->isremote) |
|
#endif /* CLIENT_SUPPORT */ |
|
891 |
{ |
{ |
892 |
char *path; |
char *path; |
893 |
int save_errno; |
int save_errno; |
913 |
{ |
{ |
914 |
static char *prev; |
static char *prev; |
915 |
char *env; |
char *env; |
|
size_t dummy; |
|
916 |
|
|
917 |
env = xmalloc (strlen (CVSROOT_ENV) |
env = xmalloc (strlen (CVSROOT_ENV) |
918 |
+ strlen (current_parsed_root->original) |
+ strlen (current_parsed_root->original) |
936 |
predetermine whether CVSROOT/config overrides things from |
predetermine whether CVSROOT/config overrides things from |
937 |
read_cvsrc and other such places or vice versa. That sort |
read_cvsrc and other such places or vice versa. That sort |
938 |
of thing probably needs more thought. */ |
of thing probably needs more thought. */ |
939 |
if (1 |
if (!server_active && !current_parsed_root->isremote) |
|
#ifdef SERVER_SUPPORT |
|
|
&& !server_active |
|
|
#endif |
|
|
#ifdef CLIENT_SUPPORT |
|
|
&& !current_parsed_root->isremote |
|
|
#endif |
|
|
) |
|
940 |
{ |
{ |
941 |
/* If there was an error parsing the config file, parse_config |
/* If there was an error parsing the config file, parse_config |
942 |
already printed an error. We keep going. Why? Because |
already printed an error. We keep going. Why? Because |
966 |
active, our list will be empty -- don't try and |
active, our list will be empty -- don't try and |
967 |
remove it from the list. */ |
remove it from the list. */ |
968 |
|
|
|
#ifdef SERVER_SUPPORT |
|
969 |
if (!server_active) |
if (!server_active) |
|
#endif /* SERVER_SUPPORT */ |
|
970 |
{ |
{ |
971 |
Node *n = findnode (root_directories, |
Node *n = findnode (root_directories, |
972 |
current_parsed_root->original); |
current_parsed_root->original); |
977 |
current_parsed_root = NULL; |
current_parsed_root = NULL; |
978 |
} |
} |
979 |
|
|
|
#ifdef SERVER_SUPPORT |
|
980 |
if (server_active) |
if (server_active) |
981 |
{ |
{ |
982 |
server_active = 0; |
server_active = 0; |
983 |
break; |
break; |
984 |
} |
} |
|
#endif |
|
985 |
} /* end of loop for cvsroot values */ |
} /* end of loop for cvsroot values */ |
986 |
|
|
987 |
dellist (&root_directories); |
dellist (&root_directories); |