* environ.cc (dos_file_warning): Declare.
(parse_thing): Add "dosfilewarning". Alphabetize. * path.cc (normalize_posix_path): Return -1 when MS-DOS path detected. (warn_msdos): New function. (path_conv::check): Call if !PC_NOWARN and MS-DOS path detected. (cygwin_conv_to_win32_path): Set PC_NOWARN when calling path_conv. (cygwin_conv_to_full_win32_path): Ditto. * path.h (pathconv_arg::PC_NOWARN): Define. * shared_info.h (user_info::warned_msdos): New field. (CURR_USER_MAGIC): Reset.
This commit is contained in:
parent
a121349405
commit
01bbb24d15
|
@ -1,3 +1,16 @@
|
||||||
|
2006-08-01 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* environ.cc (dos_file_warning): Declare.
|
||||||
|
(parse_thing): Add "dosfilewarning". Alphabetize.
|
||||||
|
* path.cc (normalize_posix_path): Return -1 when MS-DOS path detected.
|
||||||
|
(warn_msdos): New function.
|
||||||
|
(path_conv::check): Call if !PC_NOWARN and MS-DOS path detected.
|
||||||
|
(cygwin_conv_to_win32_path): Set PC_NOWARN when calling path_conv.
|
||||||
|
(cygwin_conv_to_full_win32_path): Ditto.
|
||||||
|
* path.h (pathconv_arg::PC_NOWARN): Define.
|
||||||
|
* shared_info.h (user_info::warned_msdos): New field.
|
||||||
|
(CURR_USER_MAGIC): Reset.
|
||||||
|
|
||||||
2006-07-31 Corinna Vinschen <corinna@vinschen.de>
|
2006-07-31 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_socket.cc (fhandler_socket::recv_internal): Fix a problem
|
* fhandler_socket.cc (fhandler_socket::recv_internal): Fix a problem
|
||||||
|
|
|
@ -28,6 +28,7 @@ details. */
|
||||||
#include "environ.h"
|
#include "environ.h"
|
||||||
#include "child_info.h"
|
#include "child_info.h"
|
||||||
|
|
||||||
|
extern bool dos_file_warning;
|
||||||
extern bool allow_glob;
|
extern bool allow_glob;
|
||||||
extern bool ignore_case_with_glob;
|
extern bool ignore_case_with_glob;
|
||||||
extern bool allow_winsymlinks;
|
extern bool allow_winsymlinks;
|
||||||
|
@ -593,6 +594,7 @@ static struct parse_thing
|
||||||
{"binmode", {x: &binmode}, justset, NULL, {{O_TEXT}, {O_BINARY}}},
|
{"binmode", {x: &binmode}, justset, NULL, {{O_TEXT}, {O_BINARY}}},
|
||||||
{"check_case", {func: &check_case_init}, isfunc, NULL, {{0}, {0}}},
|
{"check_case", {func: &check_case_init}, isfunc, NULL, {{0}, {0}}},
|
||||||
{"codepage", {func: &codepage_init}, isfunc, NULL, {{0}, {0}}},
|
{"codepage", {func: &codepage_init}, isfunc, NULL, {{0}, {0}}},
|
||||||
|
{"dosfilewarning", {&dos_file_warning}, justset, NULL, {{false}, {true}}},
|
||||||
{"envcache", {&envcache}, justset, NULL, {{true}, {false}}},
|
{"envcache", {&envcache}, justset, NULL, {{true}, {false}}},
|
||||||
{"error_start", {func: &error_start_init}, isfunc, NULL, {{0}, {0}}},
|
{"error_start", {func: &error_start_init}, isfunc, NULL, {{0}, {0}}},
|
||||||
{"export", {&export_settings}, justset, NULL, {{false}, {true}}},
|
{"export", {&export_settings}, justset, NULL, {{false}, {true}}},
|
||||||
|
@ -600,7 +602,7 @@ static struct parse_thing
|
||||||
{"glob", {func: &glob_init}, isfunc, NULL, {{0}, {s: "normal"}}},
|
{"glob", {func: &glob_init}, isfunc, NULL, {{0}, {s: "normal"}}},
|
||||||
{"ntea", {func: set_ntea}, isfunc, NULL, {{0}, {s: "yes"}}},
|
{"ntea", {func: set_ntea}, isfunc, NULL, {{0}, {s: "yes"}}},
|
||||||
{"ntsec", {func: set_ntsec}, isfunc, NULL, {{0}, {s: "yes"}}},
|
{"ntsec", {func: set_ntsec}, isfunc, NULL, {{0}, {s: "yes"}}},
|
||||||
{"traverse", {func: set_traverse}, isfunc, NULL, {{0}, {s: "yes"}}},
|
{"proc_retry", {func: set_proc_retry}, isfunc, NULL, {{0}, {5}}},
|
||||||
{"reset_com", {&reset_com}, justset, NULL, {{false}, {true}}},
|
{"reset_com", {&reset_com}, justset, NULL, {{false}, {true}}},
|
||||||
#ifdef USE_SERVER
|
#ifdef USE_SERVER
|
||||||
{"server", {&allow_server}, justset, NULL, {{false}, {true}}},
|
{"server", {&allow_server}, justset, NULL, {{false}, {true}}},
|
||||||
|
@ -609,10 +611,10 @@ static struct parse_thing
|
||||||
{"strip_title", {&strip_title_path}, justset, NULL, {{false}, {true}}},
|
{"strip_title", {&strip_title_path}, justset, NULL, {{false}, {true}}},
|
||||||
{"subauth_id", {func: &subauth_id_init}, isfunc, NULL, {{0}, {0}}},
|
{"subauth_id", {func: &subauth_id_init}, isfunc, NULL, {{0}, {0}}},
|
||||||
{"title", {&display_title}, justset, NULL, {{false}, {true}}},
|
{"title", {&display_title}, justset, NULL, {{false}, {true}}},
|
||||||
|
{"traverse", {func: set_traverse}, isfunc, NULL, {{0}, {s: "yes"}}},
|
||||||
{"tty", {NULL}, set_process_state, NULL, {{0}, {PID_USETTY}}},
|
{"tty", {NULL}, set_process_state, NULL, {{0}, {PID_USETTY}}},
|
||||||
{"winsymlinks", {&allow_winsymlinks}, justset, NULL, {{false}, {true}}},
|
{"winsymlinks", {&allow_winsymlinks}, justset, NULL, {{false}, {true}}},
|
||||||
{"transparent_exe", {&transparent_exe}, justset, NULL, {{false}, {true}}},
|
{"transparent_exe", {&transparent_exe}, justset, NULL, {{false}, {true}}},
|
||||||
{"proc_retry", {func: set_proc_retry}, isfunc, NULL, {{0}, {5}}},
|
|
||||||
{NULL, {0}, justset, 0, {{0}, {0}}}
|
{NULL, {0}, justset, 0, {{0}, {0}}}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ details. */
|
||||||
#include "cygtls.h"
|
#include "cygtls.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
bool dos_file_warning = true;
|
||||||
static int normalize_win32_path (const char *, char *, char *&);
|
static int normalize_win32_path (const char *, char *, char *&);
|
||||||
static void slashify (const char *, char *, int);
|
static void slashify (const char *, char *, int);
|
||||||
static void backslashify (const char *, char *, int);
|
static void backslashify (const char *, char *, int);
|
||||||
|
@ -208,8 +209,7 @@ pathmatch (const char *path1, const char *path2)
|
||||||
|
|
||||||
/* TODO: This function is used in mkdir and rmdir to generate correct
|
/* TODO: This function is used in mkdir and rmdir to generate correct
|
||||||
error messages in case of paths ending in /. or /.. components.
|
error messages in case of paths ending in /. or /.. components.
|
||||||
This test should eventually end up in path_conv::check in one way
|
Right now, normalize_posix_path will just normalize
|
||||||
or another. Right now, normalize_posix_path will just normalize
|
|
||||||
those components away, which changes the semantics. */
|
those components away, which changes the semantics. */
|
||||||
bool
|
bool
|
||||||
has_dot_last_component (const char *dir)
|
has_dot_last_component (const char *dir)
|
||||||
|
@ -322,7 +322,7 @@ win32_path:
|
||||||
if (!err)
|
if (!err)
|
||||||
for (char *p = dst; (p = strchr (p, '\\')); p++)
|
for (char *p = dst; (p = strchr (p, '\\')); p++)
|
||||||
*p = '/';
|
*p = '/';
|
||||||
return err;
|
return err ?: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
|
@ -539,6 +539,26 @@ path_conv::get_nt_native_path (UNICODE_STRING &upath)
|
||||||
return &upath;
|
return &upath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
warn_msdos (const char *src)
|
||||||
|
{
|
||||||
|
if (user_shared->warned_msdos || !dos_file_warning)
|
||||||
|
return;
|
||||||
|
char posix_path[CYG_MAX_PATH];
|
||||||
|
small_printf ("cygwin warning:\n");
|
||||||
|
if (cygwin_conv_to_full_posix_path (src, posix_path))
|
||||||
|
small_printf (" MS-DOS style path detected: %s\n POSIX equivalent preferred.\n",
|
||||||
|
src);
|
||||||
|
else
|
||||||
|
small_printf (" MS-DOS style path detected: %s\n Preferred POSIX equivalent is: %s\n",
|
||||||
|
src, posix_path);
|
||||||
|
small_printf (" CYGWIN environment variable option \"nodosfilewarning\" turns off this warning.\n"
|
||||||
|
" Consult the user's guide for more details about POSIX paths:\n"
|
||||||
|
" http://cygwin.com/cygwin-ug-net/using.html#using-pathnames\n");
|
||||||
|
|
||||||
|
user_shared->warned_msdos = true;
|
||||||
|
}
|
||||||
|
|
||||||
/* Convert an arbitrary path SRC to a pure Win32 path, suitable for
|
/* Convert an arbitrary path SRC to a pure Win32 path, suitable for
|
||||||
passing to Win32 API routines.
|
passing to Win32 API routines.
|
||||||
|
|
||||||
|
@ -602,6 +622,7 @@ path_conv::check (const char *src, unsigned opt,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_msdos = false;
|
||||||
/* This loop handles symlink expansion. */
|
/* This loop handles symlink expansion. */
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
@ -610,8 +631,14 @@ path_conv::check (const char *src, unsigned opt,
|
||||||
|
|
||||||
is_relpath = !isabspath (src);
|
is_relpath = !isabspath (src);
|
||||||
error = normalize_posix_path (src, path_copy, tail);
|
error = normalize_posix_path (src, path_copy, tail);
|
||||||
if (error)
|
if (error > 0)
|
||||||
return;
|
return;
|
||||||
|
if (error < 0)
|
||||||
|
{
|
||||||
|
if (component == 0)
|
||||||
|
is_msdos = true;
|
||||||
|
error = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Detect if the user was looking for a directory. We have to strip the
|
/* Detect if the user was looking for a directory. We have to strip the
|
||||||
trailing slash initially while trying to add extensions but take it
|
trailing slash initially while trying to add extensions but take it
|
||||||
|
@ -1059,6 +1086,8 @@ out:
|
||||||
if (tail < path_end && tail > path_copy + 1)
|
if (tail < path_end && tail > path_copy + 1)
|
||||||
*tail = '/';
|
*tail = '/';
|
||||||
set_normalized_path (path_copy, strip_tail);
|
set_normalized_path (path_copy, strip_tail);
|
||||||
|
if (is_msdos && !(opt & PC_NOWARN))
|
||||||
|
warn_msdos (src);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -3646,7 +3675,7 @@ fchdir (int fd)
|
||||||
extern "C" int
|
extern "C" int
|
||||||
cygwin_conv_to_win32_path (const char *path, char *win32_path)
|
cygwin_conv_to_win32_path (const char *path, char *win32_path)
|
||||||
{
|
{
|
||||||
path_conv p (path, PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK | PC_NOFULL);
|
path_conv p (path, PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK | PC_NOFULL | PC_NOWARN);
|
||||||
if (p.error)
|
if (p.error)
|
||||||
{
|
{
|
||||||
win32_path[0] = '\0';
|
win32_path[0] = '\0';
|
||||||
|
@ -3662,7 +3691,7 @@ cygwin_conv_to_win32_path (const char *path, char *win32_path)
|
||||||
extern "C" int
|
extern "C" int
|
||||||
cygwin_conv_to_full_win32_path (const char *path, char *win32_path)
|
cygwin_conv_to_full_win32_path (const char *path, char *win32_path)
|
||||||
{
|
{
|
||||||
path_conv p (path, PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK);
|
path_conv p (path, PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK | PC_NOWARN);
|
||||||
if (p.error)
|
if (p.error)
|
||||||
{
|
{
|
||||||
win32_path[0] = '\0';
|
win32_path[0] = '\0';
|
||||||
|
|
|
@ -47,6 +47,7 @@ enum pathconv_arg
|
||||||
PC_NULLEMPTY = 0x0020,
|
PC_NULLEMPTY = 0x0020,
|
||||||
PC_CHECK_EA = 0x0040,
|
PC_CHECK_EA = 0x0040,
|
||||||
PC_POSIX = 0x0080,
|
PC_POSIX = 0x0080,
|
||||||
|
PC_NOWARN = 0x0100,
|
||||||
PC_NO_ACCESS_CHECK = 0x00800000
|
PC_NO_ACCESS_CHECK = 0x00800000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ class mount_item
|
||||||
|
|
||||||
#define USER_VERSION 1 // increment when mount table changes and
|
#define USER_VERSION 1 // increment when mount table changes and
|
||||||
#define USER_VERSION_MAGIC CYGWIN_VERSION_MAGIC (USER_MAGIC, USER_VERSION)
|
#define USER_VERSION_MAGIC CYGWIN_VERSION_MAGIC (USER_MAGIC, USER_VERSION)
|
||||||
#define CURR_USER_MAGIC 0x8dc7b1d5U
|
#define CURR_USER_MAGIC 0x38edd704U
|
||||||
|
|
||||||
class reg_key;
|
class reg_key;
|
||||||
struct device;
|
struct device;
|
||||||
|
@ -133,6 +133,7 @@ public:
|
||||||
DWORD version;
|
DWORD version;
|
||||||
DWORD cb;
|
DWORD cb;
|
||||||
delqueue_list delqueue;
|
delqueue_list delqueue;
|
||||||
|
bool warned_msdos;
|
||||||
mount_info mountinfo;
|
mount_info mountinfo;
|
||||||
};
|
};
|
||||||
/******** Shared Info ********/
|
/******** Shared Info ********/
|
||||||
|
@ -197,4 +198,3 @@ void *__stdcall open_shared (const char *name, int n, HANDLE &shared_h, DWORD si
|
||||||
shared_locations&, PSECURITY_ATTRIBUTES psa = &sec_all,
|
shared_locations&, PSECURITY_ATTRIBUTES psa = &sec_all,
|
||||||
DWORD access = FILE_MAP_READ | FILE_MAP_WRITE);
|
DWORD access = FILE_MAP_READ | FILE_MAP_WRITE);
|
||||||
extern void user_shared_initialize (bool reinit);
|
extern void user_shared_initialize (bool reinit);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue