version 1.123, 2010/09/29 18:14:52 |
version 1.124, 2015/01/16 06:40:06 |
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
|
|
#include <sys/param.h> |
#include <sys/types.h> |
#include <sys/dirent.h> |
#include <sys/dirent.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <sys/time.h> |
#include <sys/time.h> |
|
|
{ |
{ |
struct stat st; |
struct stat st; |
int nb; |
int nb; |
char *d, *date, fpath[MAXPATHLEN], repo[MAXPATHLEN], *tag; |
char *d, *date, fpath[PATH_MAX], repo[PATH_MAX], *tag; |
|
|
d = NULL; |
d = NULL; |
|
|
if (lastdir != NULL && !strcmp(dir, lastdir)) |
if (lastdir != NULL && !strcmp(dir, lastdir)) |
return; |
return; |
|
|
cvs_get_repository_path(dir, repo, MAXPATHLEN); |
cvs_get_repository_path(dir, repo, PATH_MAX); |
|
|
if (cvs_cmdop != CVS_OP_RLOG) |
if (cvs_cmdop != CVS_OP_RLOG) |
cvs_client_send_request("Directory %s\n%s", dir, repo); |
cvs_client_send_request("Directory %s\n%s", dir, repo); |
|
|
(void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", |
(void)xsnprintf(fpath, PATH_MAX, "%s/%s", |
dir, CVS_PATH_STATICENTRIES); |
dir, CVS_PATH_STATICENTRIES); |
|
|
if (stat(fpath, &st) == 0 && (st.st_mode & (S_IRUSR|S_IRGRP|S_IROTH))) |
if (stat(fpath, &st) == 0 && (st.st_mode & (S_IRUSR|S_IRGRP|S_IROTH))) |
|
|
const char *errstr; |
const char *errstr; |
struct tm datetm; |
struct tm datetm; |
struct timeval tv[2]; |
struct timeval tv[2]; |
char repo[MAXPATHLEN], *entry; |
char repo[PATH_MAX], *entry; |
char timebuf[CVS_TIME_BUFSZ], revbuf[CVS_REV_BUFSZ]; |
char timebuf[CVS_TIME_BUFSZ], revbuf[CVS_REV_BUFSZ]; |
char *en, *mode, *len, *rpath, *p; |
char *en, *mode, *len, *rpath, *p; |
char sticky[CVS_ENT_MAXLINELEN], fpath[MAXPATHLEN]; |
char sticky[CVS_ENT_MAXLINELEN], fpath[PATH_MAX]; |
|
|
if (data == NULL) |
if (data == NULL) |
fatal("Missing argument for Updated"); |
fatal("Missing argument for Updated"); |
|
|
len = cvs_remote_input(); |
len = cvs_remote_input(); |
|
|
client_check_directory(data, rpath); |
client_check_directory(data, rpath); |
cvs_get_repository_path(".", repo, MAXPATHLEN); |
cvs_get_repository_path(".", repo, PATH_MAX); |
|
|
STRIP_SLASH(repo); |
STRIP_SLASH(repo); |
|
|
|
|
|
|
client_check_directory(data, rpath); |
client_check_directory(data, rpath); |
|
|
repo = xmalloc(MAXPATHLEN); |
repo = xmalloc(PATH_MAX); |
cvs_get_repository_path(".", repo, MAXPATHLEN); |
cvs_get_repository_path(".", repo, PATH_MAX); |
|
|
STRIP_SLASH(repo); |
STRIP_SLASH(repo); |
|
|
|
|
cvs_client_removed(char *data) |
cvs_client_removed(char *data) |
{ |
{ |
CVSENTRIES *entlist; |
CVSENTRIES *entlist; |
char *rpath, *filename, fpath[MAXPATHLEN]; |
char *rpath, *filename, fpath[PATH_MAX]; |
|
|
if (data == NULL) |
if (data == NULL) |
fatal("Missing argument for Removed"); |
fatal("Missing argument for Removed"); |
|
|
entlist = cvs_ent_open(data); |
entlist = cvs_ent_open(data); |
cvs_ent_remove(entlist, filename); |
cvs_ent_remove(entlist, filename); |
|
|
(void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", data, filename); |
(void)xsnprintf(fpath, PATH_MAX, "%s/%s", data, filename); |
(void)unlink(fpath); |
(void)unlink(fpath); |
|
|
xfree(rpath); |
xfree(rpath); |
|
|
cvs_client_set_static_directory(char *data) |
cvs_client_set_static_directory(char *data) |
{ |
{ |
FILE *fp; |
FILE *fp; |
char *dir, fpath[MAXPATHLEN]; |
char *dir, fpath[PATH_MAX]; |
|
|
if (data == NULL) |
if (data == NULL) |
fatal("Missing argument for Set-static-directory"); |
fatal("Missing argument for Set-static-directory"); |
|
|
if (cvs_cmdop == CVS_OP_EXPORT) |
if (cvs_cmdop == CVS_OP_EXPORT) |
return; |
return; |
|
|
(void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", |
(void)xsnprintf(fpath, PATH_MAX, "%s/%s", |
data, CVS_PATH_STATICENTRIES); |
data, CVS_PATH_STATICENTRIES); |
|
|
if ((fp = fopen(fpath, "w+")) == NULL) { |
if ((fp = fopen(fpath, "w+")) == NULL) { |
|
|
void |
void |
cvs_client_clear_static_directory(char *data) |
cvs_client_clear_static_directory(char *data) |
{ |
{ |
char *dir, fpath[MAXPATHLEN]; |
char *dir, fpath[PATH_MAX]; |
|
|
if (data == NULL) |
if (data == NULL) |
fatal("Missing argument for Clear-static-directory"); |
fatal("Missing argument for Clear-static-directory"); |
|
|
if (cvs_cmdop == CVS_OP_EXPORT) |
if (cvs_cmdop == CVS_OP_EXPORT) |
return; |
return; |
|
|
(void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", |
(void)xsnprintf(fpath, PATH_MAX, "%s/%s", |
data, CVS_PATH_STATICENTRIES); |
data, CVS_PATH_STATICENTRIES); |
|
|
(void)cvs_unlink(fpath); |
(void)cvs_unlink(fpath); |
|
|
cvs_client_set_sticky(char *data) |
cvs_client_set_sticky(char *data) |
{ |
{ |
FILE *fp; |
FILE *fp; |
char *dir, *tag, tagpath[MAXPATHLEN]; |
char *dir, *tag, tagpath[PATH_MAX]; |
|
|
if (data == NULL) |
if (data == NULL) |
fatal("Missing argument for Set-sticky"); |
fatal("Missing argument for Set-sticky"); |
|
|
|
|
client_check_directory(data, dir); |
client_check_directory(data, dir); |
|
|
(void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG); |
(void)xsnprintf(tagpath, PATH_MAX, "%s/%s", data, CVS_PATH_TAG); |
|
|
if ((fp = fopen(tagpath, "w+")) == NULL) { |
if ((fp = fopen(tagpath, "w+")) == NULL) { |
cvs_log(LP_ERRNO, "%s", tagpath); |
cvs_log(LP_ERRNO, "%s", tagpath); |
|
|
void |
void |
cvs_client_clear_sticky(char *data) |
cvs_client_clear_sticky(char *data) |
{ |
{ |
char *dir, tagpath[MAXPATHLEN]; |
char *dir, tagpath[PATH_MAX]; |
|
|
if (data == NULL) |
if (data == NULL) |
fatal("Missing argument for Clear-sticky"); |
fatal("Missing argument for Clear-sticky"); |
|
|
|
|
client_check_directory(data, dir); |
client_check_directory(data, dir); |
|
|
(void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG); |
(void)xsnprintf(tagpath, PATH_MAX, "%s/%s", data, CVS_PATH_TAG); |
(void)unlink(tagpath); |
(void)unlink(tagpath); |
|
|
xfree(dir); |
xfree(dir); |
|
|
cvs_client_initlog(void) |
cvs_client_initlog(void) |
{ |
{ |
u_int i; |
u_int i; |
char *env, *envdup, buf[MAXPATHLEN], fpath[MAXPATHLEN]; |
char *env, *envdup, buf[PATH_MAX], fpath[PATH_MAX]; |
char rpath[MAXPATHLEN], timebuf[CVS_TIME_BUFSZ], *s; |
char rpath[PATH_MAX], timebuf[CVS_TIME_BUFSZ], *s; |
struct stat st; |
struct stat st; |
time_t now; |
time_t now; |
struct passwd *pwd; |
struct passwd *pwd; |