Merge from vendor branch TNF:
[pkgsrcv2.git] / devel / cvs / patches / patch-af
1 $NetBSD: patch-af,v 1.1 1999/01/18 21:11:48 bad Exp $
2
3 --- src/update.c.orig   Thu Jun 25 10:56:50 1998
4 +++ src/update.c        Wed Feb 23 01:28:45 2000
5 @@ -1039,7 +1039,8 @@
6             cvs_output (": Executing '", 0);
7             run_print (stdout);
8             cvs_output ("'\n", 0);
9 -           (void) run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL);
10 +           (void) run_exec (RUN_TTY, RUN_TTY, RUN_TTY,
11 +                            RUN_NORMAL | RUN_UNSETXID);
12         }
13         else if (ferror (fp))
14             error (0, errno, "cannot read %s", CVSADM_UPROG);
15 @@ -1304,11 +1305,18 @@
16                     xchmod (finfo->file, 1);
17                 else
18                 {
19 +                   mode_t oumask, writeaccess;
20 +
21                     /* We know that we are the server here, so
22                         although xchmod checks umask, we don't bother.  */
23 -                   mode |= (((mode & S_IRUSR) ? S_IWUSR : 0)
24 +                   /* Not bothering with the umask makes the files
25 +                      mode 0777 on old clients, though. -chb */
26 +                   oumask = umask(0);
27 +                   (void) umask(oumask);
28 +                   writeaccess = (((mode & S_IRUSR) ? S_IWUSR : 0)
29                              | ((mode & S_IRGRP) ? S_IWGRP : 0)
30                              | ((mode & S_IROTH) ? S_IWOTH : 0));
31 +                   mode |= (~oumask) & writeaccess;
32                 }
33             }
34