=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/client.c,v retrieving revision 1.123 retrieving revision 1.124 diff -c -r1.123 -r1.124 *** src/usr.bin/cvs/client.c 2010/09/29 18:14:52 1.123 --- src/usr.bin/cvs/client.c 2015/01/16 06:40:06 1.124 *************** *** 1,4 **** ! /* $OpenBSD: client.c,v 1.123 2010/09/29 18:14:52 nicm Exp $ */ /* * Copyright (c) 2006 Joris Vink * --- 1,4 ---- ! /* $OpenBSD: client.c,v 1.124 2015/01/16 06:40:06 deraadt Exp $ */ /* * Copyright (c) 2006 Joris Vink * *************** *** 15,21 **** * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ ! #include #include #include #include --- 15,21 ---- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ ! #include #include #include #include *************** *** 399,417 **** { struct stat st; int nb; ! char *d, *date, fpath[MAXPATHLEN], repo[MAXPATHLEN], *tag; d = NULL; if (lastdir != NULL && !strcmp(dir, lastdir)) return; ! cvs_get_repository_path(dir, repo, MAXPATHLEN); if (cvs_cmdop != CVS_OP_RLOG) cvs_client_send_request("Directory %s\n%s", dir, repo); ! (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", dir, CVS_PATH_STATICENTRIES); if (stat(fpath, &st) == 0 && (st.st_mode & (S_IRUSR|S_IRGRP|S_IROTH))) --- 399,417 ---- { struct stat st; int nb; ! char *d, *date, fpath[PATH_MAX], repo[PATH_MAX], *tag; d = NULL; if (lastdir != NULL && !strcmp(dir, lastdir)) return; ! cvs_get_repository_path(dir, repo, PATH_MAX); if (cvs_cmdop != CVS_OP_RLOG) cvs_client_send_request("Directory %s\n%s", dir, repo); ! (void)xsnprintf(fpath, PATH_MAX, "%s/%s", dir, CVS_PATH_STATICENTRIES); if (stat(fpath, &st) == 0 && (st.st_mode & (S_IRUSR|S_IRGRP|S_IROTH))) *************** *** 700,709 **** const char *errstr; struct tm datetm; struct timeval tv[2]; ! char repo[MAXPATHLEN], *entry; char timebuf[CVS_TIME_BUFSZ], revbuf[CVS_REV_BUFSZ]; char *en, *mode, *len, *rpath, *p; ! char sticky[CVS_ENT_MAXLINELEN], fpath[MAXPATHLEN]; if (data == NULL) fatal("Missing argument for Updated"); --- 700,709 ---- const char *errstr; struct tm datetm; struct timeval tv[2]; ! char repo[PATH_MAX], *entry; char timebuf[CVS_TIME_BUFSZ], revbuf[CVS_REV_BUFSZ]; char *en, *mode, *len, *rpath, *p; ! char sticky[CVS_ENT_MAXLINELEN], fpath[PATH_MAX]; if (data == NULL) fatal("Missing argument for Updated"); *************** *** 714,720 **** len = cvs_remote_input(); client_check_directory(data, rpath); ! cvs_get_repository_path(".", repo, MAXPATHLEN); STRIP_SLASH(repo); --- 714,720 ---- len = cvs_remote_input(); client_check_directory(data, rpath); ! cvs_get_repository_path(".", repo, PATH_MAX); STRIP_SLASH(repo); *************** *** 815,822 **** client_check_directory(data, rpath); ! repo = xmalloc(MAXPATHLEN); ! cvs_get_repository_path(".", repo, MAXPATHLEN); STRIP_SLASH(repo); --- 815,822 ---- client_check_directory(data, rpath); ! repo = xmalloc(PATH_MAX); ! cvs_get_repository_path(".", repo, PATH_MAX); STRIP_SLASH(repo); *************** *** 872,878 **** cvs_client_removed(char *data) { CVSENTRIES *entlist; ! char *rpath, *filename, fpath[MAXPATHLEN]; if (data == NULL) fatal("Missing argument for Removed"); --- 872,878 ---- cvs_client_removed(char *data) { CVSENTRIES *entlist; ! char *rpath, *filename, fpath[PATH_MAX]; if (data == NULL) fatal("Missing argument for Removed"); *************** *** 885,891 **** entlist = cvs_ent_open(data); cvs_ent_remove(entlist, filename); ! (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", data, filename); (void)unlink(fpath); xfree(rpath); --- 885,891 ---- entlist = cvs_ent_open(data); cvs_ent_remove(entlist, filename); ! (void)xsnprintf(fpath, PATH_MAX, "%s/%s", data, filename); (void)unlink(fpath); xfree(rpath); *************** *** 915,921 **** cvs_client_set_static_directory(char *data) { FILE *fp; ! char *dir, fpath[MAXPATHLEN]; if (data == NULL) fatal("Missing argument for Set-static-directory"); --- 915,921 ---- cvs_client_set_static_directory(char *data) { FILE *fp; ! char *dir, fpath[PATH_MAX]; if (data == NULL) fatal("Missing argument for Set-static-directory"); *************** *** 928,934 **** if (cvs_cmdop == CVS_OP_EXPORT) return; ! (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_STATICENTRIES); if ((fp = fopen(fpath, "w+")) == NULL) { --- 928,934 ---- if (cvs_cmdop == CVS_OP_EXPORT) return; ! (void)xsnprintf(fpath, PATH_MAX, "%s/%s", data, CVS_PATH_STATICENTRIES); if ((fp = fopen(fpath, "w+")) == NULL) { *************** *** 941,947 **** void cvs_client_clear_static_directory(char *data) { ! char *dir, fpath[MAXPATHLEN]; if (data == NULL) fatal("Missing argument for Clear-static-directory"); --- 941,947 ---- void cvs_client_clear_static_directory(char *data) { ! char *dir, fpath[PATH_MAX]; if (data == NULL) fatal("Missing argument for Clear-static-directory"); *************** *** 954,960 **** if (cvs_cmdop == CVS_OP_EXPORT) return; ! (void)xsnprintf(fpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_STATICENTRIES); (void)cvs_unlink(fpath); --- 954,960 ---- if (cvs_cmdop == CVS_OP_EXPORT) return; ! (void)xsnprintf(fpath, PATH_MAX, "%s/%s", data, CVS_PATH_STATICENTRIES); (void)cvs_unlink(fpath); *************** *** 964,970 **** cvs_client_set_sticky(char *data) { FILE *fp; ! char *dir, *tag, tagpath[MAXPATHLEN]; if (data == NULL) fatal("Missing argument for Set-sticky"); --- 964,970 ---- cvs_client_set_sticky(char *data) { FILE *fp; ! char *dir, *tag, tagpath[PATH_MAX]; if (data == NULL) fatal("Missing argument for Set-sticky"); *************** *** 979,985 **** client_check_directory(data, dir); ! (void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG); if ((fp = fopen(tagpath, "w+")) == NULL) { cvs_log(LP_ERRNO, "%s", tagpath); --- 979,985 ---- client_check_directory(data, dir); ! (void)xsnprintf(tagpath, PATH_MAX, "%s/%s", data, CVS_PATH_TAG); if ((fp = fopen(tagpath, "w+")) == NULL) { cvs_log(LP_ERRNO, "%s", tagpath); *************** *** 996,1002 **** void cvs_client_clear_sticky(char *data) { ! char *dir, tagpath[MAXPATHLEN]; if (data == NULL) fatal("Missing argument for Clear-sticky"); --- 996,1002 ---- void cvs_client_clear_sticky(char *data) { ! char *dir, tagpath[PATH_MAX]; if (data == NULL) fatal("Missing argument for Clear-sticky"); *************** *** 1012,1018 **** client_check_directory(data, dir); ! (void)xsnprintf(tagpath, MAXPATHLEN, "%s/%s", data, CVS_PATH_TAG); (void)unlink(tagpath); xfree(dir); --- 1012,1018 ---- client_check_directory(data, dir); ! (void)xsnprintf(tagpath, PATH_MAX, "%s/%s", data, CVS_PATH_TAG); (void)unlink(tagpath); xfree(dir); *************** *** 1031,1038 **** cvs_client_initlog(void) { u_int i; ! char *env, *envdup, buf[MAXPATHLEN], fpath[MAXPATHLEN]; ! char rpath[MAXPATHLEN], timebuf[CVS_TIME_BUFSZ], *s; struct stat st; time_t now; struct passwd *pwd; --- 1031,1038 ---- cvs_client_initlog(void) { u_int i; ! char *env, *envdup, buf[PATH_MAX], fpath[PATH_MAX]; ! char rpath[PATH_MAX], timebuf[CVS_TIME_BUFSZ], *s; struct stat st; time_t now; struct passwd *pwd;