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

Diff for /src/usr.bin/rcs/co.c between version 1.98 and 1.99

version 1.98, 2006/10/12 17:20:12 version 1.99, 2006/11/09 21:47:52
Line 235 
Line 235 
         u_int i;          u_int i;
         int fd, lcount;          int fd, lcount;
         char buf[16];          char buf[16];
         mode_t mode = 0444;          mode_t mode = DEFFILEMODE;
         struct stat st;          struct stat st;
         struct rcs_delta *rdp;          struct rcs_delta *rdp;
         struct rcs_lock *lkp;          struct rcs_lock *lkp;
Line 363 
Line 363 
                         }                          }
                 }                  }
   
                 /* Strip all write bits from mode */                  /* File should only be writable by owner. */
                 if (file->rf_fd != -1) {                  mode &= ~(S_IWGRP|S_IWOTH);
                         mode = st.st_mode &  
                             (S_IXUSR|S_IXGRP|S_IXOTH|S_IRUSR|S_IRGRP|S_IROTH);  
                 }  
   
                 mode |= S_IWUSR;                  mode |= S_IWUSR;
   
                 if (file->rf_ndelta != 0) {                  if (file->rf_ndelta != 0) {
Line 385 
Line 381 
                 }                  }
   
                 /* Strip all write bits from mode */                  /* Strip all write bits from mode */
                 if (file->rf_fd != -1) {                  mode &= ~(S_IWUSR|S_IWGRP|S_IWOTH);
                         mode = st.st_mode &  
                             (S_IXUSR|S_IXGRP|S_IXOTH|S_IRUSR|S_IRGRP|S_IROTH);  
                 }  
   
                 if (file->rf_ndelta != 0) {                  if (file->rf_ndelta != 0) {
                         if (!(flags & QUIET) && !(flags & NEWFILE) &&                          if (!(flags & QUIET) && !(flags & NEWFILE) &&
Line 435 
Line 428 
                     (getuid() == st.st_uid) ? "" :                      (getuid() == st.st_uid) ? "" :
                     ", and you do not own it");                      ", and you do not own it");
                 (void)fprintf(stderr, "remove it? [ny](n): ");                  (void)fprintf(stderr, "remove it? [ny](n): ");
                 /* default is n */                  if (rcs_yesno('n') == 'n') {
                 if (rcs_yesno() == -1) {  
                         if (!(flags & QUIET) && isatty(STDIN_FILENO))                          if (!(flags & QUIET) && isatty(STDIN_FILENO))
                                 warnx("writable %s exists; "                                  warnx("%s%s exists; checkout aborted",
                                     "checkout aborted", dst);                                      (st.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) ?
                                       "writable " : "", dst);
                         else                          else
                                 warnx("checkout aborted");                                  warnx("checkout aborted");
                         return (-1);                          return (-1);

Legend:
Removed from v.1.98  
changed lines
  Added in v.1.99