summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/environ.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-04-30 21:19:42 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-04-30 21:19:42 +0000
commit57ff940dd40a53ec03e5f2b079239b41bd9c2859 (patch)
tree4de2380c00e04343fe81f4113a9142540901c4d4 /winsup/cygwin/environ.cc
parent965cecdfca617f99b5fab536e6f960201b12b2a4 (diff)
downloadcygnal-57ff940dd40a53ec03e5f2b079239b41bd9c2859.tar.gz
cygnal-57ff940dd40a53ec03e5f2b079239b41bd9c2859.tar.bz2
cygnal-57ff940dd40a53ec03e5f2b079239b41bd9c2859.zip
* autoload.cc: Add LoadDLLinitfunc for secur32.dll.
Add LoadDLLfuncEx statements for AllocateLocallyUniqueId@4, DuplicateTokenEx@24, LsaNtStatusToWinError@4, LsaDeregisterLogonProcess@4, LsaFreeReturnBuffer@4, LsaLogonUser@56, LsaLookupAuthenticationPackage@12, LsaRegisterLogonProcess@12, * environ.cc: Add extern declaration for `subauth_id'. (subauth_id_init): New function for setting `subauth_id'. (struct parse_thing): Add entry for `subauth_id'. * fork.cc (fork_parent): Call `RevertToSelf' and `ImpersonateLoggedOnUser' instead of `seteuid'. * security.cc: Define global variable `subauth_id'. (extract_nt_dom_user): New function. (cygwin_logon_user): Call `extract_nt_dom_user' now. (str2lsa): New static function. (str2buf2lsa): Ditto. (str2buf2uni): Ditto. (subauth): Ditto. * security.h: Add prototype for `subauth'. * spawn.cc (spawn_guts): Use cygheap->user.token only if impersonated. Use `cygsid' type. Remove impersonation before allowing access to workstation/desktop to everyone. Call `RevertToSelf' and `ImpersonateLoggedOnUser' instead of `seteuid'. * syscalls.cc (seteuid): Rearranged to allow using subauthentication to retrieve user tokens when needed.
Diffstat (limited to 'winsup/cygwin/environ.cc')
-rw-r--r--winsup/cygwin/environ.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 25985e614..cf2e75930 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -35,6 +35,7 @@ extern BOOL allow_winsymlinks;
extern BOOL strip_title_path;
extern int pcheck_case;
extern DWORD chunksize;
+extern int subauth_id;
BOOL reset_com = TRUE;
static BOOL envcache = TRUE;
@@ -446,6 +447,19 @@ codepage_init (const char *buf)
}
}
+static void
+subauth_id_init (const char *buf)
+{
+ if (!buf || !*buf)
+ return;
+
+ int i = strtol (buf, NULL, 0);
+
+ /* 0..127 are reserved by Microsoft, 132 is IIS subauthentication. */
+ if (i > 127 && i != 132 && i <= 255)
+ subauth_id = i;
+}
+
/* The structure below is used to set up an array which is used to
parse the CYGWIN environment variable or, if enabled, options from
the registry. */
@@ -482,6 +496,7 @@ struct parse_thing
{"smbntsec", {&allow_smbntsec}, justset, NULL, {{FALSE}, {TRUE}}},
{"reset_com", {&reset_com}, justset, NULL, {{FALSE}, {TRUE}}},
{"strip_title", {&strip_title_path}, justset, NULL, {{FALSE}, {TRUE}}},
+ {"subauth_id", {func: &subauth_id_init}, isfunc, NULL, {{0}, {0}}},
{"title", {&display_title}, justset, NULL, {{FALSE}, {TRUE}}},
{"tty", {NULL}, set_process_state, NULL, {{0}, {PID_USETTY}}},
{"winsymlinks", {&allow_winsymlinks}, justset, NULL, {{FALSE}, {TRUE}}},