mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-22 00:38:06 +08:00
* mkvers.sh: Avoid "-dontuse" tags.
* path.cc (path_conv::check): Set exec state based on known situations. * path.cc (mount_item::fnmunge): New function. (mount_item::build_win32): New function. (mount_info::conv_to_win32_path): Use build_win32 to build windows path. * path.h (mount_item::fnmunge): Declare new function. (mount_item::build_win32): Ditto. * sys/mount.h (MOUNT_ENC): Define.
This commit is contained in:
parent
72c1470d67
commit
b666c2eb34
@ -1,3 +1,17 @@
|
|||||||
|
2003-05-28 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* mkvers.sh: Avoid "-dontuse" tags.
|
||||||
|
|
||||||
|
* path.cc (path_conv::check): Set exec state based on known situations.
|
||||||
|
|
||||||
|
* path.cc (mount_item::fnmunge): New function.
|
||||||
|
(mount_item::build_win32): New function.
|
||||||
|
(mount_info::conv_to_win32_path): Use build_win32 to build windows
|
||||||
|
path.
|
||||||
|
* path.h (mount_item::fnmunge): Declare new function.
|
||||||
|
(mount_item::build_win32): Ditto.
|
||||||
|
* sys/mount.h (MOUNT_ENC): Define.
|
||||||
|
|
||||||
2003-05-28 Corinna Vinschen <corinna@vinschen.de>
|
2003-05-28 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_socket.cc (fhandler_socket::dup): If running impersonated,
|
* fhandler_socket.cc (fhandler_socket::dup): If running impersonated,
|
||||||
|
@ -28,7 +28,8 @@ enum
|
|||||||
not yet implemented */
|
not yet implemented */
|
||||||
MOUNT_NOTEXEC = 0x100, /* don't check files for executable magic */
|
MOUNT_NOTEXEC = 0x100, /* don't check files for executable magic */
|
||||||
MOUNT_DEVFS = 0x200, /* /device "filesystem" */
|
MOUNT_DEVFS = 0x200, /* /device "filesystem" */
|
||||||
MOUNT_PROC = 0x400 /* /proc "filesystem" */
|
MOUNT_PROC = 0x400, /* /proc "filesystem" */
|
||||||
|
MOUNT_ENC = 0x800 /* encode special characters */
|
||||||
};
|
};
|
||||||
|
|
||||||
int mount (const char *, const char *, unsigned __flags);
|
int mount (const char *, const char *, unsigned __flags);
|
||||||
|
@ -84,7 +84,7 @@ fn=`basename $incfile`
|
|||||||
# if it exists, will contain the name of the sticky tag associated with
|
# if it exists, will contain the name of the sticky tag associated with
|
||||||
# the current build. Save that for output later.
|
# the current build. Save that for output later.
|
||||||
#
|
#
|
||||||
cvs_tag="`sed 's%^.\(.*\)%\1%' $dir/CVS/Tag 2>/dev/null`"
|
cvs_tag="`sed -e '/dontuse/d' -e 's%^.\(.*\)%\1%' $dir/CVS/Tag 2>/dev/null`"
|
||||||
|
|
||||||
wv_cvs_tag="$cvs_tag"
|
wv_cvs_tag="$cvs_tag"
|
||||||
[ -n "$cvs_tag" ] && cvs_tag=" CVS tag"'
|
[ -n "$cvs_tag" ] && cvs_tag=" CVS tag"'
|
||||||
|
@ -793,7 +793,17 @@ out:
|
|||||||
if (!allow_smbntsec && fs.is_remote_drive)
|
if (!allow_smbntsec && fs.is_remote_drive)
|
||||||
set_has_acls (false);
|
set_has_acls (false);
|
||||||
else
|
else
|
||||||
set_has_acls (fs.flags & FS_PERSISTENT_ACLS);
|
{
|
||||||
|
set_has_acls (fs.flags & FS_PERSISTENT_ACLS);
|
||||||
|
if (exec_state () != dont_know_if_executable)
|
||||||
|
/* ok */;
|
||||||
|
else if (isdir ())
|
||||||
|
set_exec (1);
|
||||||
|
else if (issymlink () || issocket ()
|
||||||
|
|| allow_ntsec && wincap.has_security ())
|
||||||
|
set_exec (0);
|
||||||
|
|
||||||
|
}
|
||||||
/* Known file systems with buggy open calls. Further explanation
|
/* Known file systems with buggy open calls. Further explanation
|
||||||
in fhandler.cc (fhandler_disk_file::open). */
|
in fhandler.cc (fhandler_disk_file::open). */
|
||||||
set_has_buggy_open (strcmp (fs.name, "SUNWNFS") == 0);
|
set_has_buggy_open (strcmp (fs.name, "SUNWNFS") == 0);
|
||||||
@ -1379,6 +1389,41 @@ set_flags (unsigned *flags, unsigned val)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mount_item::fnmunge (char *dst, const char *src)
|
||||||
|
{
|
||||||
|
strcpy (dst, src);
|
||||||
|
backslashify (dst, dst, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mount_item::build_win32 (char *dst, const char *src, unsigned *outflags, unsigned chroot_pathlen)
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
const char *real_native_path;
|
||||||
|
int real_posix_pathlen;
|
||||||
|
set_flags (outflags, (unsigned) flags);
|
||||||
|
if (!cygheap->root.exists () || posix_pathlen != 1 || posix_path[0] != '/')
|
||||||
|
{
|
||||||
|
n = native_pathlen;
|
||||||
|
real_native_path = native_path;
|
||||||
|
real_posix_pathlen = chroot_pathlen ?: posix_pathlen;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
n = cygheap->root.native_length ();
|
||||||
|
real_native_path = cygheap->root.native_path ();
|
||||||
|
real_posix_pathlen = posix_pathlen;
|
||||||
|
}
|
||||||
|
memcpy (dst, real_native_path, n + 1);
|
||||||
|
const char *p = src + real_posix_pathlen;
|
||||||
|
if (*p == '/')
|
||||||
|
/* nothing */;
|
||||||
|
else if ((isdrive (dst) && !dst[2]) || *p)
|
||||||
|
dst[n++] = '\\';
|
||||||
|
fnmunge (dst + n, p);
|
||||||
|
}
|
||||||
|
|
||||||
/* conv_to_win32_path: Ensure src_path is a pure Win32 path and store
|
/* conv_to_win32_path: Ensure src_path is a pure Win32 path and store
|
||||||
the result in win32_path.
|
the result in win32_path.
|
||||||
|
|
||||||
@ -1405,7 +1450,6 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst,
|
|||||||
int src_path_len = strlen (src_path);
|
int src_path_len = strlen (src_path);
|
||||||
MALLOC_CHECK;
|
MALLOC_CHECK;
|
||||||
unsigned dummy_flags;
|
unsigned dummy_flags;
|
||||||
int chroot_ok = !cygheap->root.exists ();
|
|
||||||
|
|
||||||
devn = FH_BAD;
|
devn = FH_BAD;
|
||||||
unit = 0;
|
unit = 0;
|
||||||
@ -1511,8 +1555,8 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst,
|
|||||||
return ENOENT;
|
return ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
int chrooted_path_len;
|
int chroot_pathlen;
|
||||||
chrooted_path_len = 0;
|
chroot_pathlen = 0;
|
||||||
/* Check the mount table for prefix matches. */
|
/* Check the mount table for prefix matches. */
|
||||||
for (i = 0; i < nmounts; i++)
|
for (i = 0; i < nmounts; i++)
|
||||||
{
|
{
|
||||||
@ -1529,11 +1573,11 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst,
|
|||||||
else if (cygheap->root.posix_ok (mi->posix_path))
|
else if (cygheap->root.posix_ok (mi->posix_path))
|
||||||
{
|
{
|
||||||
path = cygheap->root.unchroot (mi->posix_path);
|
path = cygheap->root.unchroot (mi->posix_path);
|
||||||
chrooted_path_len = len = strlen (path);
|
chroot_pathlen = len = strlen (path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
chrooted_path_len = 0;
|
chroot_pathlen = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1541,40 +1585,18 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool chroot_ok;
|
||||||
|
chroot_ok = false; // sigh. stop gcc warning
|
||||||
if (i >= nmounts)
|
if (i >= nmounts)
|
||||||
{
|
{
|
||||||
backslashify (pathbuf, dst, 0); /* just convert */
|
backslashify (pathbuf, dst, 0); /* just convert */
|
||||||
set_flags (flags, PATH_BINARY);
|
set_flags (flags, PATH_BINARY);
|
||||||
|
chroot_ok = !cygheap->root.exists ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int n;
|
mi->build_win32 (dst, pathbuf, flags, chroot_pathlen);
|
||||||
const char *native_path;
|
chroot_ok = true;
|
||||||
int posix_pathlen;
|
|
||||||
if (chroot_ok || chrooted_path_len || mi->posix_pathlen != 1
|
|
||||||
|| mi->posix_path[0] != '/')
|
|
||||||
{
|
|
||||||
n = mi->native_pathlen;
|
|
||||||
native_path = mi->native_path;
|
|
||||||
posix_pathlen = chrooted_path_len ?: mi->posix_pathlen;
|
|
||||||
chroot_ok = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
n = cygheap->root.native_length ();
|
|
||||||
native_path = cygheap->root.native_path ();
|
|
||||||
posix_pathlen = mi->posix_pathlen;
|
|
||||||
chroot_ok = 1;
|
|
||||||
}
|
|
||||||
memcpy (dst, native_path, n + 1);
|
|
||||||
const char *p = pathbuf + posix_pathlen;
|
|
||||||
if (*p == '/')
|
|
||||||
/* nothing */;
|
|
||||||
else if ((isdrive (dst) && !dst[2]) || *p)
|
|
||||||
dst[n++] = '\\';
|
|
||||||
strcpy (dst + n, p);
|
|
||||||
backslashify (dst, dst, 0);
|
|
||||||
set_flags (flags, (unsigned) mi->flags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isvirtual_dev (devn))
|
if (!isvirtual_dev (devn))
|
||||||
|
@ -31,6 +31,8 @@ class mount_item
|
|||||||
void init (const char *dev, const char *path, unsigned flags);
|
void init (const char *dev, const char *path, unsigned flags);
|
||||||
|
|
||||||
struct mntent *getmntent ();
|
struct mntent *getmntent ();
|
||||||
|
void fnmunge (char *, const char *);
|
||||||
|
void build_win32 (char *, const char *, unsigned *, unsigned);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Warning: Decreasing this value will cause cygwin.dll to ignore existing
|
/* Warning: Decreasing this value will cause cygwin.dll to ignore existing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user