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

Diff for /src/usr.bin/cvs/server.c between version 1.50 and 1.51

version 1.50, 2007/01/18 16:45:52 version 1.51, 2007/01/25 18:56:33
Line 220 
Line 220 
 cvs_server_static_directory(char *data)  cvs_server_static_directory(char *data)
 {  {
         FILE *fp;          FILE *fp;
         char *fpath;          char fpath[MAXPATHLEN];
   
         fpath = xmalloc(MAXPATHLEN);  
         if (cvs_path_cat(server_currentdir, CVS_PATH_STATICENTRIES, fpath,          if (cvs_path_cat(server_currentdir, CVS_PATH_STATICENTRIES, fpath,
             MAXPATHLEN) >= MAXPATHLEN)              MAXPATHLEN) >= MAXPATHLEN)
                 fatal("cvs_server_static_directory: truncation");                  fatal("cvs_server_static_directory: truncation");
   
         if ((fp = fopen(fpath, "w+")) == NULL) {          if ((fp = fopen(fpath, "w+")) == NULL) {
                 cvs_log(LP_ERRNO, "%s", fpath);                  cvs_log(LP_ERRNO, "%s", fpath);
                 goto out;                  return;
         }          }
         (void)fclose(fp);          (void)fclose(fp);
 out:  
         xfree(fpath);  
 }  }
   
 void  void
 cvs_server_sticky(char *data)  cvs_server_sticky(char *data)
 {  {
         FILE *fp;          FILE *fp;
         char *tagpath;          char tagpath[MAXPATHLEN];
   
         tagpath = xmalloc(MAXPATHLEN);  
         if (cvs_path_cat(server_currentdir, CVS_PATH_TAG, tagpath,          if (cvs_path_cat(server_currentdir, CVS_PATH_TAG, tagpath,
             MAXPATHLEN) >= MAXPATHLEN)              MAXPATHLEN) >= MAXPATHLEN)
                 fatal("cvs_server_sticky: truncation");                  fatal("cvs_server_sticky: truncation");
   
         if ((fp = fopen(tagpath, "w+")) == NULL) {          if ((fp = fopen(tagpath, "w+")) == NULL) {
                 cvs_log(LP_ERRNO, "%s", tagpath);                  cvs_log(LP_ERRNO, "%s", tagpath);
                 goto out;                  return;
         }          }
   
         (void)fprintf(fp, "%s\n", data);          (void)fprintf(fp, "%s\n", data);
         (void)fclose(fp);          (void)fclose(fp);
 out:  
         xfree(tagpath);  
 }  }
   
 void  void
Line 299 
Line 293 
 {  {
         int l;          int l;
         CVSENTRIES *entlist;          CVSENTRIES *entlist;
         char *dir, *repo, *parent, *entry, *dirn, *p;          char *dir, *repo, *parent, entry[CVS_ENT_MAXLINELEN], *dirn, *p;
   
         dir = cvs_remote_input();          dir = cvs_remote_input();
         STRIP_SLASH(dir);          STRIP_SLASH(dir);
Line 331 
Line 325 
   
         if (strcmp(parent, ".")) {          if (strcmp(parent, ".")) {
                 entlist = cvs_ent_open(parent);                  entlist = cvs_ent_open(parent);
                 entry = xmalloc(CVS_ENT_MAXLINELEN);  
                 l = snprintf(entry, CVS_ENT_MAXLINELEN, "D/%s////", dirn);                  l = snprintf(entry, CVS_ENT_MAXLINELEN, "D/%s////", dirn);
                 if (l == -1 || l >= CVS_ENT_MAXLINELEN)                  if (l == -1 || l >= CVS_ENT_MAXLINELEN)
                         fatal("cvs_server_directory: overflow");                          fatal("cvs_server_directory: overflow");
   
                 cvs_ent_add(entlist, entry);                  cvs_ent_add(entlist, entry);
                 cvs_ent_close(entlist, ENT_SYNC);                  cvs_ent_close(entlist, ENT_SYNC);
                 xfree(entry);  
         }          }
   
         if (server_currentdir != NULL)          if (server_currentdir != NULL)
Line 366 
Line 358 
         size_t flen;          size_t flen;
         mode_t fmode;          mode_t fmode;
         const char *errstr;          const char *errstr;
         char *mode, *len, *fpath;          char *mode, *len, fpath[MAXPATHLEN];
   
         mode = cvs_remote_input();          mode = cvs_remote_input();
         len = cvs_remote_input();          len = cvs_remote_input();
Line 379 
Line 371 
                 fatal("cvs_server_modified: %s", errstr);                  fatal("cvs_server_modified: %s", errstr);
         xfree(len);          xfree(len);
   
         fpath = xmalloc(MAXPATHLEN);  
         if (cvs_path_cat(server_currentdir, data, fpath, MAXPATHLEN) >=          if (cvs_path_cat(server_currentdir, data, fpath, MAXPATHLEN) >=
             MAXPATHLEN)              MAXPATHLEN)
                 fatal("cvs_server_modified: truncation");                  fatal("cvs_server_modified: truncation");
Line 392 
Line 383 
         if (fchmod(fd, 0600) == -1)          if (fchmod(fd, 0600) == -1)
                 fatal("cvs_server_modified: failed to set file mode");                  fatal("cvs_server_modified: failed to set file mode");
   
         xfree(fpath);  
         (void)close(fd);          (void)close(fd);
 }  }
   
Line 405 
Line 395 
 cvs_server_unchanged(char *data)  cvs_server_unchanged(char *data)
 {  {
         int fd;          int fd;
         char *fpath;          char fpath[MAXPATHLEN];
         CVSENTRIES *entlist;          CVSENTRIES *entlist;
         struct cvs_ent *ent;          struct cvs_ent *ent;
         struct timeval tv[2];          struct timeval tv[2];
   
         fpath = xmalloc(MAXPATHLEN);  
         if (cvs_path_cat(server_currentdir, data, fpath, MAXPATHLEN) >=          if (cvs_path_cat(server_currentdir, data, fpath, MAXPATHLEN) >=
             MAXPATHLEN)              MAXPATHLEN)
                 fatal("cvs_server_unchanged: truncation");                  fatal("cvs_server_unchanged: truncation");
Line 434 
Line 423 
                 fatal("cvs_server_unchanged: failed to set mode");                  fatal("cvs_server_unchanged: failed to set mode");
   
         cvs_ent_free(ent);          cvs_ent_free(ent);
         xfree(fpath);  
         (void)close(fd);          (void)close(fd);
 }  }
   
Line 624 
Line 612 
 cvs_server_update_entry(const char *resp, struct cvs_file *cf)  cvs_server_update_entry(const char *resp, struct cvs_file *cf)
 {  {
         int l;          int l;
         char *p, *response;          char *p, response[MAXPATHLEN];
   
         if ((p = strrchr(cf->file_rpath, ',')) != NULL)          if ((p = strrchr(cf->file_rpath, ',')) != NULL)
                 *p = '\0';                  *p = '\0';
   
         response = xmalloc(MAXPATHLEN);  
         l = snprintf(response, MAXPATHLEN, "%s %s/", resp, cf->file_wd);          l = snprintf(response, MAXPATHLEN, "%s %s/", resp, cf->file_wd);
         if (l == -1 || l >= MAXPATHLEN)          if (l == -1 || l >= MAXPATHLEN)
                 fatal("cvs_server_update_entry: overflow");                  fatal("cvs_server_update_entry: overflow");
Line 639 
Line 626 
   
         if (p != NULL)          if (p != NULL)
                 *p = ',';                  *p = ',';
   
         xfree(response);  
 }  }

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51