2014-08-14 22:15:49 +02:00
|
|
|
<?xml version="1.0" encoding='UTF-8'?>
|
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
|
|
|
|
|
|
|
|
<sect1 id="func-cygwin-login">
|
|
|
|
<title>Helper functions to change user context</title>
|
|
|
|
|
2015-06-16 19:52:37 +02:00
|
|
|
<refentry id="func-cygwin-logon_user">
|
|
|
|
<refmeta>
|
|
|
|
<refentrytitle>cygwin_logon_user</refentrytitle>
|
|
|
|
<manvolnum>3</manvolnum>
|
|
|
|
<refmiscinfo class="manual">Cygwin API Reference</refmiscinfo>
|
|
|
|
</refmeta>
|
2014-08-14 22:15:49 +02:00
|
|
|
|
2015-06-16 19:52:37 +02:00
|
|
|
<refnamediv>
|
|
|
|
<refname>cygwin_logon_user</refname>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcsynopsisinfo>
|
|
|
|
#include <sys/cygwin.h>
|
|
|
|
</funcsynopsisinfo>
|
|
|
|
<funcprototype>
|
|
|
|
<funcdef>HANDLE
|
2014-08-14 22:15:49 +02:00
|
|
|
<function>cygwin_logon_user</function></funcdef>
|
|
|
|
<paramdef>const struct passwd *<parameter>passwd_entry</parameter></paramdef>
|
|
|
|
<paramdef>const char *<parameter>password</parameter></paramdef>
|
|
|
|
</funcprototype></funcsynopsis>
|
2015-06-16 19:52:37 +02:00
|
|
|
</refsynopsisdiv>
|
2014-08-14 22:15:49 +02:00
|
|
|
|
2015-06-16 19:52:37 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
2014-08-14 22:15:49 +02:00
|
|
|
<para>Given a pointer to a passwd entry of a user and a cleartext password,
|
|
|
|
returns a HANDLE to an impersonation token for this user which can be used
|
|
|
|
in a subsequent call to <function>cygwin_set_impersonation_token</function>
|
|
|
|
to impersonate that user. This function can only be called from a process
|
|
|
|
which has the required NT user rights to perform a logon.</para>
|
2015-06-16 19:52:37 +02:00
|
|
|
</refsect1>
|
2014-08-14 22:15:49 +02:00
|
|
|
|
2015-06-16 19:52:37 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>See also</title>
|
2014-08-14 22:15:49 +02:00
|
|
|
<para>See also the chapter
|
|
|
|
<ulink url="../cygwin-ug-net/ntsec.html#ntsec-setuid-overview">Switching the user context</ulink>
|
|
|
|
in the Cygwin User's guide.</para>
|
|
|
|
|
|
|
|
<para>See also <link linkend="func-cygwin-set-impersonation-token">cygwin_set_impersonation_token</link></para>
|
2015-06-16 19:52:37 +02:00
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2014-08-14 22:15:49 +02:00
|
|
|
|
2015-06-16 19:52:37 +02:00
|
|
|
<refentry id="func-cygwin-set-impersonation-token">
|
|
|
|
<refmeta>
|
|
|
|
<refentrytitle>cygwin_set_impersonation_token</refentrytitle>
|
|
|
|
<manvolnum>3</manvolnum>
|
|
|
|
<refmiscinfo class="manual">Cygwin API Reference</refmiscinfo>
|
|
|
|
</refmeta>
|
2014-08-14 22:15:49 +02:00
|
|
|
|
2015-06-16 19:52:37 +02:00
|
|
|
<refnamediv>
|
|
|
|
<refname>cygwin_set_impersonation_token</refname>
|
|
|
|
</refnamediv>
|
2014-08-14 22:15:49 +02:00
|
|
|
|
2015-06-16 19:52:37 +02:00
|
|
|
<refsynopsisdiv>
|
|
|
|
<funcsynopsis>
|
|
|
|
<funcsynopsisinfo>
|
|
|
|
#include <sys/cygwin.h>
|
|
|
|
</funcsynopsisinfo>
|
|
|
|
<funcprototype>
|
|
|
|
<funcdef>void
|
2014-08-14 22:15:49 +02:00
|
|
|
<function>cygwin_set_impersonation_token</function></funcdef>
|
|
|
|
<paramdef>const HANDLE <parameter>token</parameter></paramdef>
|
|
|
|
</funcprototype></funcsynopsis>
|
2015-06-16 19:52:37 +02:00
|
|
|
</refsynopsisdiv>
|
2014-08-14 22:15:49 +02:00
|
|
|
|
2015-06-16 19:52:37 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
2014-08-14 22:15:49 +02:00
|
|
|
<para>Use this function to enable the token given as parameter as
|
|
|
|
impersonation token for the next call to <function>setuid</function> or
|
|
|
|
<function>seteuid</function>. Use
|
|
|
|
<function>cygwin_set_impersonation_token</function> together with
|
|
|
|
<function>cygwin_logon_user</function> to impersonate users using
|
|
|
|
password authentication.</para>
|
2015-06-16 19:52:37 +02:00
|
|
|
</refsect1>
|
2014-08-14 22:15:49 +02:00
|
|
|
|
2015-06-16 19:52:37 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>See also</title>
|
2014-08-14 22:15:49 +02:00
|
|
|
<para>See also the chapter
|
|
|
|
<ulink url="../cygwin-ug-net/ntsec.html#ntsec-setuid-overview">Switching the user context</ulink>
|
|
|
|
in the Cygwin User's guide.</para>
|
|
|
|
|
|
|
|
<para>See also <link linkend="func-cygwin-logon_user">cygwin_logon_user</link></para>
|
2015-06-16 19:52:37 +02:00
|
|
|
</refsect1>
|
2014-08-14 22:15:49 +02:00
|
|
|
|
2015-06-16 19:52:37 +02:00
|
|
|
</refentry>
|
2014-08-14 22:15:49 +02:00
|
|
|
|
|
|
|
</sect1>
|