Welcome to mirror list, hosted at ThFree Co, Russian Federation.

logon-funcs.xml « doc « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 31da4be5e124adfbd1f7d0d76e2bff34259467a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?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>

<refentry id="func-cygwin-logon_user">
  <refmeta>
    <refentrytitle>cygwin_logon_user</refentrytitle>
    <manvolnum>3</manvolnum>
    <refmiscinfo class="manual">Cygwin API Reference</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname>cygwin_logon_user</refname>
  </refnamediv>

  <refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>
#include &lt;sys/cygwin.h&gt;
</funcsynopsisinfo>
<funcprototype>
<funcdef>HANDLE
<function>cygwin_logon_user</function></funcdef>
<paramdef>const struct passwd *<parameter>passwd_entry</parameter></paramdef>
<paramdef>const char *<parameter>password</parameter></paramdef>
</funcprototype></funcsynopsis>
  </refsynopsisdiv>

  <refsect1 id="func-cygwin-logon_user-desc">
    <title>Description</title>
<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>
  </refsect1>

  <refsect1 id="func-cygwin-logon_user-also">
    <title>See also</title>
<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>
  </refsect1>
</refentry>

<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>

  <refnamediv>
    <refname>cygwin_set_impersonation_token</refname>
  </refnamediv>

  <refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>
#include &lt;sys/cygwin.h&gt;
</funcsynopsisinfo>
<funcprototype>
<funcdef>void
<function>cygwin_set_impersonation_token</function></funcdef>
<paramdef>const HANDLE <parameter>token</parameter></paramdef>
</funcprototype></funcsynopsis>
  </refsynopsisdiv>

  <refsect1 id="func-cygwin-set-impersonation-token-desc">
    <title>Description</title>
<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>
  </refsect1>

  <refsect1 id="func-cygwin-set-impersonation-token-also">
    <title>See also</title>
<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>
  </refsect1>

</refentry>

</sect1>