Debian Codegraph @

doc/html/appdev/refs/api/krb5_sname_to_principal.html

raw
1 <!DOCTYPE html>
2
3 <html lang="en" data-content_root="../../../">
4 <head>
5 <meta charset="utf-8" />
6 <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
7
8 <title>krb5_sname_to_principal - Generate a full principal name from a service name. &#8212; MIT Kerberos Documentation</title>
9 <link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=fa44fd50" />
10 <link rel="stylesheet" type="text/css" href="../../../_static/agogo.css?v=879f3c71" />
11 <link rel="stylesheet" type="text/css" href="../../../_static/kerb.css?v=6a0b3979" />
12 <script src="../../../_static/documentation_options.js?v=6dbce55c"></script>
13 <script src="../../../_static/doctools.js?v=888ff710"></script>
14 <script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
15 <link rel="author" title="About these documents" href="../../../about.html" />
16 <link rel="index" title="Index" href="../../../genindex.html" />
17 <link rel="search" title="Search" href="../../../search.html" />
18 <link rel="copyright" title="Copyright" href="../../../copyright.html" />
19 <link rel="next" title="krb5_unparse_name - Convert a krb5_principal structure to a string representation." href="krb5_unparse_name.html" />
20 <link rel="prev" title="krb5_sname_match - Test whether a principal matches a matching principal." href="krb5_sname_match.html" />
21 </head><body>
22 <div class="header-wrapper">
23 <div class="header">
24
25
26 <h1><a href="../../../index.html">MIT Kerberos Documentation</a></h1>
27
28 <div class="rel">
29
30 <a href="../../../index.html" title="Full Table of Contents"
31 accesskey="C">Contents</a> |
32 <a href="krb5_sname_match.html" title="krb5_sname_match - Test whether a principal matches a matching principal."
33 accesskey="P">previous</a> |
34 <a href="krb5_unparse_name.html" title="krb5_unparse_name - Convert a krb5_principal structure to a string representation."
35 accesskey="N">next</a> |
36 <a href="../../../genindex.html" title="General Index"
37 accesskey="I">index</a> |
38 <a href="../../../search.html" title="Enter search criteria"
39 accesskey="S">Search</a> |
40 <a href="mailto:[email protected]?subject=Documentation__krb5_sname_to_principal - Generate a full principal name from a service name.">feedback</a>
41 </div>
42 </div>
43 </div>
44
45 <div class="content-wrapper">
46 <div class="content">
47 <div class="document">
48
49 <div class="documentwrapper">
50 <div class="bodywrapper">
51 <div class="body" role="main">
52
53 <section id="krb5-sname-to-principal-generate-a-full-principal-name-from-a-service-name">
54 <h1>krb5_sname_to_principal - Generate a full principal name from a service name.<a class="headerlink" href="#krb5-sname-to-principal-generate-a-full-principal-name-from-a-service-name" title="Link to this heading">¶</a></h1>
55 <dl class="c function">
56 <dt class="sig sig-object c" id="c.krb5_sname_to_principal">
57 <a class="reference internal" href="../types/krb5_error_code.html#c.krb5_error_code" title="krb5_error_code"><span class="n"><span class="pre">krb5_error_code</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">krb5_sname_to_principal</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="../types/krb5_context.html#c.krb5_context" title="krb5_context"><span class="n"><span class="pre">krb5_context</span></span></a><span class="w"> </span><span class="n"><span class="pre">context</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">hostname</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">sname</span></span>, <a class="reference internal" href="../types/krb5_int32.html#c.krb5_int32" title="krb5_int32"><span class="n"><span class="pre">krb5_int32</span></span></a><span class="w"> </span><span class="n"><span class="pre">type</span></span>, <a class="reference internal" href="../types/krb5_principal.html#c.krb5_principal" title="krb5_principal"><span class="n"><span class="pre">krb5_principal</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">ret_princ</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.krb5_sname_to_principal" title="Link to this definition">¶</a><br /></dt>
58 <dd></dd></dl>
59
60 <dl class="field-list">
61 <dt class="field-odd">param<span class="colon">:</span></dt>
62 <dd class="field-odd"><p><strong>[in]</strong> <strong>context</strong> - Library context</p>
63 <p><strong>[in]</strong> <strong>hostname</strong> - Host name, or NULL to use local host</p>
64 <p><strong>[in]</strong> <strong>sname</strong> - Service name, or NULL to use <strong>“host”</strong></p>
65 <p><strong>[in]</strong> <strong>type</strong> - Principal type</p>
66 <p><strong>[out]</strong> <strong>ret_princ</strong> - Generated principal</p>
67 </dd>
68 </dl>
69 <dl class="field-list simple">
70 <dt class="field-odd">retval<span class="colon">:</span></dt>
71 <dd class="field-odd"><ul class="simple">
72 <li><p>0 Success</p></li>
73 </ul>
74 </dd>
75 <dt class="field-even">return<span class="colon">:</span></dt>
76 <dd class="field-even"><ul class="simple">
77 <li><p>Kerberos error codes</p></li>
78 </ul>
79 </dd>
80 </dl>
81 <p>This function converts a <em>hostname</em> and <em>sname</em> into <em>krb5_principal</em> structure <em>ret_princ</em> . The returned principal will be of the form <em>sname/hostname&#64;REALM</em> where REALM is determined by krb5_get_host_realm(). In some cases this may be the referral (empty) realm.</p>
82 <p>The <em>type</em> can be one of the following:</p>
83 <blockquote>
84 <div><blockquote>
85 <div><ul class="simple">
86 <li><p>KRB5_NT_SRV_HST canonicalizes the host name before looking up the realm and generating the principal.</p></li>
87 <li><p>KRB5_NT_UNKNOWN accepts the hostname as given, and does not canonicalize it.</p></li>
88 </ul>
89 </div></blockquote>
90 <p>Use krb5_free_principal to free <em>ret_princ</em> when it is no longer needed.</p>
91 </div></blockquote>
92 </section>
93
94
95 <div class="clearer"></div>
96 </div>
97 </div>
98 </div>
99 </div>
100 <div class="sidebar">
101
102 <h2>On this page</h2>
103 <ul>
104 <li><a class="reference internal" href="#">krb5_sname_to_principal - Generate a full principal name from a service name.</a></li>
105 </ul>
106
107 <br/>
108 <h2>Table of contents</h2>
109 <ul class="current">
110 <li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">For users</a></li>
111 <li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">For administrators</a></li>
112 <li class="toctree-l1 current"><a class="reference internal" href="../../index.html">For application developers</a><ul class="current">
113 <li class="toctree-l2"><a class="reference internal" href="../../gssapi.html">Developing with GSSAPI</a></li>
114 <li class="toctree-l2"><a class="reference internal" href="../../y2038.html">Year 2038 considerations for uses of krb5_timestamp</a></li>
115 <li class="toctree-l2"><a class="reference internal" href="../../h5l_mit_apidiff.html">Differences between Heimdal and MIT Kerberos API</a></li>
116 <li class="toctree-l2"><a class="reference internal" href="../../init_creds.html">Initial credentials</a></li>
117 <li class="toctree-l2"><a class="reference internal" href="../../princ_handle.html">Principal manipulation and parsing</a></li>
118 <li class="toctree-l2 current"><a class="reference internal" href="../index.html">Complete reference - API and datatypes</a><ul class="current">
119 <li class="toctree-l3 current"><a class="reference internal" href="index.html">krb5 API</a></li>
120 <li class="toctree-l3"><a class="reference internal" href="../types/index.html">krb5 types and structures</a></li>
121 <li class="toctree-l3"><a class="reference internal" href="../macros/index.html">krb5 simple macros</a></li>
122 </ul>
123 </li>
124 </ul>
125 </li>
126 <li class="toctree-l1"><a class="reference internal" href="../../../plugindev/index.html">For plugin module developers</a></li>
127 <li class="toctree-l1"><a class="reference internal" href="../../../build/index.html">Building Kerberos V5</a></li>
128 <li class="toctree-l1"><a class="reference internal" href="../../../basic/index.html">Kerberos V5 concepts</a></li>
129 <li class="toctree-l1"><a class="reference internal" href="../../../formats/index.html">Protocols and file formats</a></li>
130 <li class="toctree-l1"><a class="reference internal" href="../../../mitK5features.html">MIT Kerberos features</a></li>
131 <li class="toctree-l1"><a class="reference internal" href="../../../build_this.html">How to build this documentation from the source</a></li>
132 <li class="toctree-l1"><a class="reference internal" href="../../../about.html">Contributing to the MIT Kerberos Documentation</a></li>
133 <li class="toctree-l1"><a class="reference internal" href="../../../resources.html">Resources</a></li>
134 </ul>
135
136 <br/>
137 <h4><a href="../../../index.html">Full Table of Contents</a></h4>
138 <h4>Search</h4>
139 <form class="search" action="../../../search.html" method="get">
140 <input type="text" name="q" size="18" />
141 <input type="submit" value="Go" />
142 <input type="hidden" name="check_keywords" value="yes" />
143 <input type="hidden" name="area" value="default" />
144 </form>
145
146 </div>
147 <div class="clearer"></div>
148 </div>
149 </div>
150
151 <div class="footer-wrapper">
152 <div class="footer" >
153 <div class="right" ><i>Release: 1.22.1</i><br />
154 &copy; <a href="../../../copyright.html">Copyright</a> 1985-2025, MIT.
155 </div>
156 <div class="left">
157
158 <a href="../../../index.html" title="Full Table of Contents"
159 >Contents</a> |
160 <a href="krb5_sname_match.html" title="krb5_sname_match - Test whether a principal matches a matching principal."
161 >previous</a> |
162 <a href="krb5_unparse_name.html" title="krb5_unparse_name - Convert a krb5_principal structure to a string representation."
163 >next</a> |
164 <a href="../../../genindex.html" title="General Index"
165 >index</a> |
166 <a href="../../../search.html" title="Enter search criteria"
167 >Search</a> |
168 <a href="mailto:[email protected]?subject=Documentation__krb5_sname_to_principal - Generate a full principal name from a service name.">feedback</a>
169 </div>
170 </div>
171 </div>
172
173 </body>
174 </html>