diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-05-23 18:23:01 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-05-23 18:23:01 +0400 |
commit | 33cb946e7ee09ba7725b383e55bbdc1ca441e62f (patch) | |
tree | 96c0abe3462ff0093987639d75191948e6474938 /winsup/cygwin/environ.cc | |
parent | 08fd0f6438765e1cfa1c31bc21072273bb90cc51 (diff) |
* environ.cc (set_winsymlinks): Handle "winsymlinks:nativestrict"
option. On pre-Vista warn the user if the "winsymlinks:native*" option
is set.
* globals.cc (enum winsym_t): Add WSYM_nativestrict.
* path.cc (symlink_native): Don't create native symlink if target
does not exist. Explain why. Improve comments.
(symlink_worker): Change AFS symlink handling to WSYM_nativestrict.
Handle WSYM_nativestrict throughout. Change condition for bail out
to wsym_type == WSYM_nativestrict. Add comment. Fix formatting.
* shared_info.h (CURR_USER_MAGIC): Change to reflect change in
class user_info.
(class user_info): Add member warned_nonativesyms.
Diffstat (limited to 'winsup/cygwin/environ.cc')
-rw-r--r-- | winsup/cygwin/environ.cc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 175c516ed..f73c232c9 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -97,9 +97,22 @@ set_winsymlinks (const char *buf) else if (ascii_strncasematch (buf, "lnk", 3)) allow_winsymlinks = WSYM_lnk; /* Make sure to try native symlinks only on systems supporting them. */ - else if (ascii_strncasematch (buf, "native", 6) - && wincap.max_sys_priv () >= SE_CREATE_SYMBOLIC_LINK_PRIVILEGE) - allow_winsymlinks = WSYM_native; + else if (ascii_strncasematch (buf, "native", 6)) + { + if (wincap.max_sys_priv () < SE_CREATE_SYMBOLIC_LINK_PRIVILEGE) + { + if (!user_shared->warned_nonativesyms) + { + small_printf ("\"winsymlinks:%s\" option detected in CYGWIN environment variable.\n" + "Native symlinks are not supported on Windows versions prior to\n" + "Windows Vista/Server 2008. This option will be ignored.\n", buf); + user_shared->warned_nonativesyms = 1; + } + } + else + allow_winsymlinks = ascii_strcasematch (buf + 6, "strict") + ? WSYM_nativestrict : WSYM_native; + } } /* The structure below is used to set up an array which is used to |