Files
pkgsrc-ng/devel/scmcvs/patches/patch-af
2013-09-26 17:14:40 +02:00

25 lines
787 B
Plaintext

$NetBSD: patch-af,v 1.2 2011/09/22 15:16:26 ryoon Exp $
--- src/update.c.orig 2008-05-07 15:57:34.000000000 +0000
+++ src/update.c
@@ -1341,11 +1341,18 @@ VERS: ", 0);
xchmod (finfo->file, 1);
else
{
+ mode_t oumask, writeaccess;
+
/* We know that we are the server here, so
although xchmod checks umask, we don't bother. */
- mode |= (((mode & S_IRUSR) ? S_IWUSR : 0)
+ /* Not bothering with the umask makes the files
+ mode 0777 on old clients, though. -chb */
+ oumask = umask(0);
+ (void) umask(oumask);
+ writeaccess = (((mode & S_IRUSR) ? S_IWUSR : 0)
| ((mode & S_IRGRP) ? S_IWGRP : 0)
| ((mode & S_IROTH) ? S_IWOTH : 0));
+ mode |= (~oumask) & writeaccess;
}
}