summaryrefslogtreecommitdiff
path: root/lang/cli/files/patch-pal::unix::file::file.c
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2002-04-16 17:54:35 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2002-04-16 17:54:35 +0000
commit1b712c05fca0c9e382f975be9e67244aeeadfc03 (patch)
treecda27314b19651ac34b4d3066f1bf28f27812124 /lang/cli/files/patch-pal::unix::file::file.c
parentUpdate to CMUCL version 18d. Use bzip2 distfiles. (diff)
- Clean-up build system a bit;
- fix remaining two places where CFLAGS weren't respected; - use cpio(1) to copy hierarchies instead of tar(1), so that it is possible to build the port as ordinary user, but still have installed files be owned by root; - use slightly different solution for the problem with 777 permissions on directories created during the build. Instead of harcoding resulting prmission apply umask(2) to all mode arguments of [f]chmod() calls. Since Rotor has no notion of file-level security anyway this should be an optimal way to fix the problem. Submitted by: Patrick Backlund <pbacklun@cc.hut.fi> (cpio fix) sobomax (the rest)
Notes
Notes: svn path=/head/; revision=57762
Diffstat (limited to '')
-rw-r--r--lang/cli/files/patch-pal::unix::file::file.c61
1 files changed, 39 insertions, 22 deletions
diff --git a/lang/cli/files/patch-pal::unix::file::file.c b/lang/cli/files/patch-pal::unix::file::file.c
index 67013da52e2b..d962c7ad5113 100644
--- a/lang/cli/files/patch-pal::unix::file::file.c
+++ b/lang/cli/files/patch-pal::unix::file::file.c
@@ -1,25 +1,42 @@
$FreeBSD$
---- pal/unix/file/file.c 2002/04/09 22:17:33 1.1
-+++ pal/unix/file/file.c 2002/04/09 22:19:43
-@@ -2822,18 +2822,10 @@
- }
- else
- {
-- /* give write permission to anyone that has read permission */
-+ /* give write permission to owner if it has read permission */
- if ( new_mode & S_IRUSR )
- {
- new_mode |= S_IWUSR;
-- }
-- if ( new_mode & S_IRGRP )
-- {
-- new_mode |= S_IWGRP;
-- }
-- if ( new_mode & S_IROTH )
-- {
-- new_mode |= S_IWOTH;
- }
- }
- TRACE("new mode is 0x%lx\n", new_mode);
+--- pal/unix/file/file.c.orig Fri Mar 22 03:48:20 2002
++++ pal/unix/file/file.c Wed Apr 10 11:52:45 2002
+@@ -37,6 +37,9 @@
+ #include <sys/stat.h>
+ #include <errno.h>
+
++#define chmod( path, mode ) chmod( ( path ), ( mode ) & ~GetUmask() )
++#define fchmod( fd, mode ) fchmod( ( fd ), ( mode ) & ~GetUmask() )
++#define lchmod( path, mode ) lchmod( ( path ), ( mode ) & ~GetUmask() )
+
+ SET_DEFAULT_DEBUG_CHANNEL(FILE);
+
+@@ -44,6 +47,8 @@
+ static int FILECloseStdHandle( HOBJSTRUCT *handle_data);
+ static int FILEDuplicateHandle( HANDLE handle, HOBJSTRUCT *handle_data);
+
++static mode_t GetUmask( void );
++
+ static file *FILENewFileData( void );
+
+ static BOOL FILEAddNewLockedRgn(SHMFILELOCKS* fileLocks,
+@@ -2342,6 +2347,17 @@
+ HMGRUnlockHandle(handle,&file_data->handle_data);
+ }
+
++static mode_t GetUmask( void )
++{
++ mode_t mask;
++
++ /* XXX: Probably need to block signals to avoid race here */
++ mask = umask( 0 );
++ umask( mask );
++ /* XXX: Unblock here */
++
++ return mask;
++}
+
+ /*++
+ Function: