pkg://wine-20010131-3.src.rpm:4783077/wine-20001126-perm.patch
info downloads
--- wine/files/file.c.perm Sun Nov 26 15:17:12 2000
+++ wine/files/file.c Sun Nov 26 16:13:50 2000
@@ -1674,6 +1674,9 @@
BOOL WINAPI MoveFileExA( LPCSTR fn1, LPCSTR fn2, DWORD flag )
{
DOS_FULL_NAME full_name1, full_name2;
+#ifdef EXE_PERMS
+ struct stat fstat;
+#endif
TRACE("(%s,%s,%04lx)\n", fn1, fn2, flag);
@@ -1722,6 +1725,19 @@
FILE_SetDosError();
return FALSE;
}
+#ifdef EXE_PERMS
+ stat( full_name2.long_name, &fstat );
+ if (strlen( full_name2.long_name ) >= 4 &&
+ (!strcasecmp( full_name2.long_name
+ + strlen( full_name2.long_name )
+ - 4, ".exe" ) ||
+ !strcasecmp( full_name2.long_name
+ + strlen( full_name2.long_name )
+ -4, ".com" )))
+ chmod( full_name2.long_name, fstat.st_mode | 0111 );
+ else
+ chmod( full_name2.long_name, fstat.st_mode & ~0111 );
+#endif
return TRUE;
}
else /* fn2 == NULL means delete source */
@@ -1791,7 +1807,23 @@
FILE_SetDosError();
return FALSE;
}
- else return TRUE;
+ else
+ {
+#ifdef EXE_PERMS
+ stat( full_name2.long_name, &fstat );
+ if (strlen( full_name2.long_name ) >= 4 &&
+ (!strcasecmp( full_name2.long_name
+ + strlen( full_name2.long_name )
+ - 4, ".exe" ) ||
+ !strcasecmp( full_name2.long_name
+ + strlen( full_name2.long_name )
+ -4, ".com" )))
+ chmod( full_name2.long_name, fstat.st_mode | 0111 );
+ else
+ chmod( full_name2.long_name, fstat.st_mode & ~0111 );
+#endif
+ return TRUE;
+ }
else /*copy */ {
if (stat( full_name1.long_name, &fstat ))
{
--- wine/include/acconfig.h.perm Sun Sep 24 21:42:11 2000
+++ wine/include/acconfig.h Sun Nov 26 16:13:50 2000
@@ -63,6 +63,9 @@
/* Define if TRACE messages are to be compiled out */
#undef NO_TRACE_MSGS
+/* Define if you want to make .exe and .com files executable */
+#undef EXE_PERMS
+
/* Define if the struct statfs has the member bavail */
#undef STATFS_HAS_BAVAIL
--- wine/include/config.h.in.perm Sun Nov 26 16:15:04 2000
+++ wine/include/config.h.in Sun Nov 26 16:15:24 2000
@@ -107,6 +107,9 @@
/* Define if TRACE messages are to be compiled out */
#undef NO_TRACE_MSGS
+/* Define if you want to make .exe and .com files executable */
+#undef EXE_PERMS
+
/* Define if the struct statfs has the member bavail */
#undef STATFS_HAS_BAVAIL
--- wine/server/file.c.perm Sun Nov 26 15:24:39 2000
+++ wine/server/file.c Sun Nov 26 16:13:50 2000
@@ -127,6 +127,7 @@
struct stat st;
char *name;
int fd = -1;
+ mode_t mode;
if (!(name = mem_alloc( len + 1 ))) return NULL;
memcpy( name, nameptr, len );
@@ -153,9 +154,15 @@
case GENERIC_READ|GENERIC_WRITE: flags |= O_RDWR; break;
}
+ mode = (attrs & FILE_ATTRIBUTE_READONLY) ? 0444 : 0666;
+#ifdef EXE_PERMS
+ if(strlen(name)>=4 &&
+ (!strcasecmp( name + strlen( name ) - 4, ".exe") ||
+ !strcasecmp( name + strlen( name ) - 4, ".com")))
+ mode |= 0111;
+#endif
/* FIXME: should set error to STATUS_OBJECT_NAME_COLLISION if file existed before */
- if ((fd = open( name, flags | O_NONBLOCK,
- (attrs & FILE_ATTRIBUTE_READONLY) ? 0444 : 0666 )) == -1)
+ if ((fd = open( name, flags | O_NONBLOCK, mode )) == -1)
goto file_error;
/* refuse to open a directory */
if (fstat( fd, &st ) == -1) goto file_error;
--- wine/configure.in.perm Sun Nov 26 15:34:13 2000
+++ wine/configure.in Sun Nov 26 16:13:50 2000
@@ -27,6 +27,10 @@
[ --disable-trace compile out TRACE messages],
[if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
+AC_ARG_ENABLE(exeperms,
+[ --enable-exeperms create .exe and .com files with execute permissions],
+[if test "$enableval" = "yes"; then EXE_PERMS="yes"; fi])
+
AC_ARG_WITH(curses,
[ --without-curses do not use curses],
[if test "$withval" = "no"; then CURSES="no"; fi])
@@ -45,6 +49,10 @@
then
AC_DEFINE(NO_TRACE_MSGS)
fi
+fi
+
+if test "$EXE_PERMS" = "yes"; then
+ AC_DEFINE(EXE_PERMS)
fi
dnl **** Check for some programs ****