| Current File : //usr/share/doc/dbus/api/dbus-credentials_8c_source.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>D-Bus: dbus-credentials.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">D-Bus
 <span id="projectnumber">1.8.20</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">dbus-credentials.c</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */</span>
<a name="l00002"></a>00002 <span class="comment">/* dbus-credentials.c Credentials provable through authentication</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2007 Red Hat Inc.</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * Licensed under the Academic Free License version 2.1</span>
<a name="l00007"></a>00007 <span class="comment"> * </span>
<a name="l00008"></a>00008 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
<a name="l00009"></a>00009 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
<a name="l00010"></a>00010 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00011"></a>00011 <span class="comment"> * (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
<a name="l00014"></a>00014 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<a name="l00016"></a>00016 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00017"></a>00017 <span class="comment"> * </span>
<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00019"></a>00019 <span class="comment"> * along with this program; if not, write to the Free Software</span>
<a name="l00020"></a>00020 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span>
<a name="l00021"></a>00021 <span class="comment"> *</span>
<a name="l00022"></a>00022 <span class="comment"> */</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include <config.h></span>
<a name="l00024"></a>00024 <span class="preprocessor">#include <string.h></span>
<a name="l00025"></a>00025 <span class="preprocessor">#include "dbus-credentials.h"</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include "dbus-internals.h"</span>
<a name="l00027"></a>00027
<a name="l00048"></a><a class="code" href="structDBusCredentials.html">00048</a> <span class="keyword">struct </span><a class="code" href="structDBusCredentials.html">DBusCredentials</a> {
<a name="l00049"></a>00049 <span class="keywordtype">int</span> refcount;
<a name="l00050"></a>00050 <a class="code" href="group__DBusSysdeps.html#ga186e987b700f9ddc6cea8aa0db82b151" title="A user ID.">dbus_uid_t</a> unix_uid;
<a name="l00051"></a>00051 <a class="code" href="group__DBusSysdeps.html#ga1eff6303266888ec466cddba6c03aa40" title="A process ID.">dbus_pid_t</a> pid;
<a name="l00052"></a>00052 <span class="keywordtype">char</span> *windows_sid;
<a name="l00053"></a>00053 <span class="keywordtype">void</span> *adt_audit_data;
<a name="l00054"></a>00054 <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> adt_audit_data_size;
<a name="l00055"></a>00055 };
<a name="l00056"></a>00056
<a name="l00069"></a>00069 <a class="code" href="structDBusCredentials.html">DBusCredentials</a>*
<a name="l00070"></a><a class="code" href="group__DBusCredentials.html#ga749dd398d725f37a7943d60074785844">00070</a> <a class="code" href="group__DBusCredentials.html#ga749dd398d725f37a7943d60074785844" title="Creates a new credentials object.">_dbus_credentials_new</a> (<span class="keywordtype">void</span>)
<a name="l00071"></a>00071 {
<a name="l00072"></a>00072 <a class="code" href="structDBusCredentials.html">DBusCredentials</a> *creds;
<a name="l00073"></a>00073
<a name="l00074"></a>00074 creds = <a class="code" href="group__DBusMemory.html#ga54ccb556e7964112a825a7f46c156ca0" title="Safe macro for using dbus_malloc().">dbus_new</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a>, 1);
<a name="l00075"></a>00075 <span class="keywordflow">if</span> (creds == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00076"></a>00076 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00077"></a>00077
<a name="l00078"></a>00078 creds->refcount = 1;
<a name="l00079"></a>00079 creds->unix_uid = <a class="code" href="group__DBusSysdeps.html#ga3d2f3fb32bb759cabe362ca2de383f7d" title="an invalid UID used to represent an uninitialized dbus_uid_t field">DBUS_UID_UNSET</a>;
<a name="l00080"></a>00080 creds->pid = <a class="code" href="group__DBusSysdeps.html#ga4eb5f05dd6ad89caa4b0340e1cf0b8d9" title="an invalid PID used to represent an uninitialized dbus_pid_t field">DBUS_PID_UNSET</a>;
<a name="l00081"></a>00081 creds->windows_sid = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00082"></a>00082 creds->adt_audit_data = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00083"></a>00083 creds->adt_audit_data_size = 0;
<a name="l00084"></a>00084
<a name="l00085"></a>00085 <span class="keywordflow">return</span> creds;
<a name="l00086"></a>00086 }
<a name="l00087"></a>00087
<a name="l00092"></a>00092 <a class="code" href="structDBusCredentials.html">DBusCredentials</a>*
<a name="l00093"></a><a class="code" href="group__DBusCredentials.html#ga63b2f88e91962510ed947bae98270818">00093</a> <a class="code" href="group__DBusCredentials.html#ga63b2f88e91962510ed947bae98270818" title="Creates a new object with credentials (user ID and process ID) from the current process.">_dbus_credentials_new_from_current_process</a> (<span class="keywordtype">void</span>)
<a name="l00094"></a>00094 {
<a name="l00095"></a>00095 <a class="code" href="structDBusCredentials.html">DBusCredentials</a> *creds;
<a name="l00096"></a>00096
<a name="l00097"></a>00097 creds = <a class="code" href="group__DBusCredentials.html#ga749dd398d725f37a7943d60074785844" title="Creates a new credentials object.">_dbus_credentials_new</a> ();
<a name="l00098"></a>00098 <span class="keywordflow">if</span> (creds == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00099"></a>00099 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00100"></a>00100
<a name="l00101"></a>00101 <span class="keywordflow">if</span> (!<a class="code" href="group__DBusSysdeps.html#ga9d5493f8bd1c5577060c8c6dce44d09f" title="Adds the credentials of the current process to the passed-in credentials object.">_dbus_credentials_add_from_current_process</a> (creds))
<a name="l00102"></a>00102 {
<a name="l00103"></a>00103 <a class="code" href="group__DBusCredentials.html#ga89913c830c3627cd006a50ca693af580" title="Decrement refcount on credentials.">_dbus_credentials_unref</a> (creds);
<a name="l00104"></a>00104 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00105"></a>00105 }
<a name="l00106"></a>00106
<a name="l00107"></a>00107 <span class="keywordflow">return</span> creds;
<a name="l00108"></a>00108 }
<a name="l00109"></a>00109
<a name="l00115"></a>00115 <span class="keywordtype">void</span>
<a name="l00116"></a><a class="code" href="group__DBusCredentials.html#ga09d375f124bddbbaa1aac62ef49078ac">00116</a> <a class="code" href="group__DBusCredentials.html#ga09d375f124bddbbaa1aac62ef49078ac" title="Increment refcount on credentials.">_dbus_credentials_ref</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials)
<a name="l00117"></a>00117 {
<a name="l00118"></a>00118 _dbus_assert (credentials->refcount > 0);
<a name="l00119"></a>00119 credentials->refcount += 1;
<a name="l00120"></a>00120 }
<a name="l00121"></a>00121
<a name="l00127"></a>00127 <span class="keywordtype">void</span>
<a name="l00128"></a><a class="code" href="group__DBusCredentials.html#ga89913c830c3627cd006a50ca693af580">00128</a> <a class="code" href="group__DBusCredentials.html#ga89913c830c3627cd006a50ca693af580" title="Decrement refcount on credentials.">_dbus_credentials_unref</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials)
<a name="l00129"></a>00129 {
<a name="l00130"></a>00130 _dbus_assert (credentials->refcount > 0);
<a name="l00131"></a>00131
<a name="l00132"></a>00132 credentials->refcount -= 1;
<a name="l00133"></a>00133 <span class="keywordflow">if</span> (credentials->refcount == 0)
<a name="l00134"></a>00134 {
<a name="l00135"></a>00135 <a class="code" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free</a> (credentials->windows_sid);
<a name="l00136"></a>00136 <a class="code" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free</a> (credentials->adt_audit_data);
<a name="l00137"></a>00137 <a class="code" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free</a> (credentials);
<a name="l00138"></a>00138 }
<a name="l00139"></a>00139 }
<a name="l00140"></a>00140
<a name="l00148"></a>00148 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00149"></a><a class="code" href="group__DBusCredentials.html#gaad133a8d06af2a447307266a8425a9f8">00149</a> <a class="code" href="group__DBusCredentials.html#gaad133a8d06af2a447307266a8425a9f8" title="Add a UNIX process ID to the credentials.">_dbus_credentials_add_pid</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials,
<a name="l00150"></a>00150 <a class="code" href="group__DBusSysdeps.html#ga1eff6303266888ec466cddba6c03aa40" title="A process ID.">dbus_pid_t</a> pid)
<a name="l00151"></a>00151 {
<a name="l00152"></a>00152 credentials->pid = pid;
<a name="l00153"></a>00153 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00154"></a>00154 }
<a name="l00155"></a>00155
<a name="l00163"></a>00163 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00164"></a><a class="code" href="group__DBusCredentials.html#ga9cec6da43e4be233d44f5bd60b071624">00164</a> <a class="code" href="group__DBusCredentials.html#ga9cec6da43e4be233d44f5bd60b071624" title="Add a UNIX user ID to the credentials.">_dbus_credentials_add_unix_uid</a>(<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials,
<a name="l00165"></a>00165 <a class="code" href="group__DBusSysdeps.html#ga186e987b700f9ddc6cea8aa0db82b151" title="A user ID.">dbus_uid_t</a> uid)
<a name="l00166"></a>00166 {
<a name="l00167"></a>00167 credentials->unix_uid = uid;
<a name="l00168"></a>00168 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00169"></a>00169
<a name="l00170"></a>00170 }
<a name="l00171"></a>00171
<a name="l00179"></a>00179 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00180"></a><a class="code" href="group__DBusCredentials.html#ga9d2186a4cfa8a421c552ae4592b400f5">00180</a> <a class="code" href="group__DBusCredentials.html#ga9d2186a4cfa8a421c552ae4592b400f5" title="Add a Windows user SID to the credentials.">_dbus_credentials_add_windows_sid</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials,
<a name="l00181"></a>00181 <span class="keyword">const</span> <span class="keywordtype">char</span> *windows_sid)
<a name="l00182"></a>00182 {
<a name="l00183"></a>00183 <span class="keywordtype">char</span> *copy;
<a name="l00184"></a>00184
<a name="l00185"></a>00185 copy = <a class="code" href="group__DBusInternalsUtils.html#ga9d00d77f6595b9d7ac1baf59d44bf58c" title="Duplicates a string.">_dbus_strdup</a> (windows_sid);
<a name="l00186"></a>00186 <span class="keywordflow">if</span> (copy == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00187"></a>00187 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00188"></a>00188
<a name="l00189"></a>00189 <a class="code" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free</a> (credentials->windows_sid);
<a name="l00190"></a>00190 credentials->windows_sid = copy;
<a name="l00191"></a>00191
<a name="l00192"></a>00192 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00193"></a>00193 }
<a name="l00194"></a>00194
<a name="l00203"></a>00203 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00204"></a><a class="code" href="group__DBusCredentials.html#gab26eb5cb8d05139806cf06e99c4ec5b0">00204</a> <a class="code" href="group__DBusCredentials.html#gab26eb5cb8d05139806cf06e99c4ec5b0" title="Add ADT audit data to the credentials.">_dbus_credentials_add_adt_audit_data</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials,
<a name="l00205"></a>00205 <span class="keywordtype">void</span> *audit_data,
<a name="l00206"></a>00206 <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> size)
<a name="l00207"></a>00207 {
<a name="l00208"></a>00208 <span class="keywordtype">void</span> *copy;
<a name="l00209"></a>00209 copy = <a class="code" href="group__DBusInternalsUtils.html#gaad95864dca5140b730bc143cb2d1b024" title="Duplicates a block of memory.">_dbus_memdup</a> (audit_data, size);
<a name="l00210"></a>00210 <span class="keywordflow">if</span> (copy == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00211"></a>00211 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00212"></a>00212
<a name="l00213"></a>00213 <a class="code" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free</a> (credentials->adt_audit_data);
<a name="l00214"></a>00214 credentials->adt_audit_data = copy;
<a name="l00215"></a>00215 credentials->adt_audit_data_size = size;
<a name="l00216"></a>00216
<a name="l00217"></a>00217 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00218"></a>00218 }
<a name="l00219"></a>00219
<a name="l00227"></a>00227 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00228"></a><a class="code" href="group__DBusCredentials.html#ga0fb8d13878e126ccc243c4a30fd8598c">00228</a> <a class="code" href="group__DBusCredentials.html#ga0fb8d13878e126ccc243c4a30fd8598c" title="Checks whether the given credential is present.">_dbus_credentials_include</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials,
<a name="l00229"></a>00229 DBusCredentialType type)
<a name="l00230"></a>00230 {
<a name="l00231"></a>00231 <span class="keywordflow">switch</span> (type)
<a name="l00232"></a>00232 {
<a name="l00233"></a>00233 <span class="keywordflow">case</span> DBUS_CREDENTIAL_UNIX_PROCESS_ID:
<a name="l00234"></a>00234 <span class="keywordflow">return</span> credentials->pid != <a class="code" href="group__DBusSysdeps.html#ga4eb5f05dd6ad89caa4b0340e1cf0b8d9" title="an invalid PID used to represent an uninitialized dbus_pid_t field">DBUS_PID_UNSET</a>;
<a name="l00235"></a>00235 <span class="keywordflow">case</span> DBUS_CREDENTIAL_UNIX_USER_ID:
<a name="l00236"></a>00236 <span class="keywordflow">return</span> credentials->unix_uid != <a class="code" href="group__DBusSysdeps.html#ga3d2f3fb32bb759cabe362ca2de383f7d" title="an invalid UID used to represent an uninitialized dbus_uid_t field">DBUS_UID_UNSET</a>;
<a name="l00237"></a>00237 <span class="keywordflow">case</span> DBUS_CREDENTIAL_WINDOWS_SID:
<a name="l00238"></a>00238 <span class="keywordflow">return</span> credentials->windows_sid != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00239"></a>00239 <span class="keywordflow">case</span> DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID:
<a name="l00240"></a>00240 <span class="keywordflow">return</span> credentials->adt_audit_data != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00241"></a>00241 }
<a name="l00242"></a>00242
<a name="l00243"></a>00243 _dbus_assert_not_reached (<span class="stringliteral">"Unknown credential enum value"</span>);
<a name="l00244"></a>00244 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00245"></a>00245 }
<a name="l00246"></a>00246
<a name="l00254"></a>00254 <a class="code" href="group__DBusSysdeps.html#ga1eff6303266888ec466cddba6c03aa40" title="A process ID.">dbus_pid_t</a>
<a name="l00255"></a><a class="code" href="group__DBusCredentials.html#gaafde142353288854a8a3969949d2e548">00255</a> <a class="code" href="group__DBusCredentials.html#gaafde142353288854a8a3969949d2e548" title="Gets the UNIX process ID in the credentials, or DBUS_PID_UNSET if the credentials object doesn't cont...">_dbus_credentials_get_pid</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials)
<a name="l00256"></a>00256 {
<a name="l00257"></a>00257 <span class="keywordflow">return</span> credentials->pid;
<a name="l00258"></a>00258 }
<a name="l00259"></a>00259
<a name="l00267"></a>00267 <a class="code" href="group__DBusSysdeps.html#ga186e987b700f9ddc6cea8aa0db82b151" title="A user ID.">dbus_uid_t</a>
<a name="l00268"></a><a class="code" href="group__DBusCredentials.html#ga462892f995f2932bf0eb3b843407e6d5">00268</a> <a class="code" href="group__DBusCredentials.html#ga462892f995f2932bf0eb3b843407e6d5" title="Gets the UNIX user ID in the credentials, or DBUS_UID_UNSET if the credentials object doesn't contain...">_dbus_credentials_get_unix_uid</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials)
<a name="l00269"></a>00269 {
<a name="l00270"></a>00270 <span class="keywordflow">return</span> credentials->unix_uid;
<a name="l00271"></a>00271 }
<a name="l00272"></a>00272
<a name="l00280"></a>00280 <span class="keyword">const</span> <span class="keywordtype">char</span>*
<a name="l00281"></a><a class="code" href="group__DBusCredentials.html#ga53680e02140559fb36efeec68d398ac0">00281</a> <a class="code" href="group__DBusCredentials.html#ga53680e02140559fb36efeec68d398ac0" title="Gets the Windows user SID in the credentials, or NULL if the credentials object doesn't contain a Win...">_dbus_credentials_get_windows_sid</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials)
<a name="l00282"></a>00282 {
<a name="l00283"></a>00283 <span class="keywordflow">return</span> credentials->windows_sid;
<a name="l00284"></a>00284 }
<a name="l00285"></a>00285
<a name="l00293"></a>00293 <span class="keywordtype">void</span> *
<a name="l00294"></a><a class="code" href="group__DBusCredentials.html#ga7a8e112e8ff3938e99ded65dd992ba05">00294</a> <a class="code" href="group__DBusCredentials.html#ga7a8e112e8ff3938e99ded65dd992ba05" title="Gets the ADT audit data in the credentials, or NULL if the credentials object doesn't contain ADT aud...">_dbus_credentials_get_adt_audit_data</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials)
<a name="l00295"></a>00295 {
<a name="l00296"></a>00296 <span class="keywordflow">return</span> credentials->adt_audit_data;
<a name="l00297"></a>00297 }
<a name="l00298"></a>00298
<a name="l00306"></a>00306 <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a>
<a name="l00307"></a><a class="code" href="group__DBusCredentials.html#gab3f338ba37ed9bfa1531e00b3a8a10ce">00307</a> <a class="code" href="group__DBusCredentials.html#gab3f338ba37ed9bfa1531e00b3a8a10ce" title="Gets the ADT audit data size in the credentials, or 0 if the credentials object doesn't contain ADT a...">_dbus_credentials_get_adt_audit_data_size</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials)
<a name="l00308"></a>00308 {
<a name="l00309"></a>00309 <span class="keywordflow">return</span> credentials->adt_audit_data_size;
<a name="l00310"></a>00310 }
<a name="l00311"></a>00311
<a name="l00320"></a>00320 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00321"></a><a class="code" href="group__DBusCredentials.html#ga1c6090c76e5151ae8a1efe9e84382934">00321</a> <a class="code" href="group__DBusCredentials.html#ga1c6090c76e5151ae8a1efe9e84382934" title="Checks whether the first credentials object contains all the credentials found in the second credenti...">_dbus_credentials_are_superset</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials,
<a name="l00322"></a>00322 <a class="code" href="structDBusCredentials.html">DBusCredentials</a> *possible_subset)
<a name="l00323"></a>00323 {
<a name="l00324"></a>00324 <span class="keywordflow">return</span>
<a name="l00325"></a>00325 (possible_subset->pid == <a class="code" href="group__DBusSysdeps.html#ga4eb5f05dd6ad89caa4b0340e1cf0b8d9" title="an invalid PID used to represent an uninitialized dbus_pid_t field">DBUS_PID_UNSET</a> ||
<a name="l00326"></a>00326 possible_subset->pid == credentials->pid) &&
<a name="l00327"></a>00327 (possible_subset->unix_uid == <a class="code" href="group__DBusSysdeps.html#ga3d2f3fb32bb759cabe362ca2de383f7d" title="an invalid UID used to represent an uninitialized dbus_uid_t field">DBUS_UID_UNSET</a> ||
<a name="l00328"></a>00328 possible_subset->unix_uid == credentials->unix_uid) &&
<a name="l00329"></a>00329 (possible_subset->windows_sid == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> ||
<a name="l00330"></a>00330 (credentials->windows_sid && strcmp (possible_subset->windows_sid,
<a name="l00331"></a>00331 credentials->windows_sid) == 0)) &&
<a name="l00332"></a>00332 (possible_subset->adt_audit_data == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> ||
<a name="l00333"></a>00333 (credentials->adt_audit_data && memcmp (possible_subset->adt_audit_data,
<a name="l00334"></a>00334 credentials->adt_audit_data,
<a name="l00335"></a>00335 credentials->adt_audit_data_size) == 0));
<a name="l00336"></a>00336 }
<a name="l00337"></a>00337
<a name="l00344"></a>00344 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00345"></a><a class="code" href="group__DBusCredentials.html#ga9aea1a288097b0820d1cd05c2448501d">00345</a> <a class="code" href="group__DBusCredentials.html#ga9aea1a288097b0820d1cd05c2448501d" title="Checks whether a credentials object contains anything.">_dbus_credentials_are_empty</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials)
<a name="l00346"></a>00346 {
<a name="l00347"></a>00347 <span class="keywordflow">return</span>
<a name="l00348"></a>00348 credentials->pid == <a class="code" href="group__DBusSysdeps.html#ga4eb5f05dd6ad89caa4b0340e1cf0b8d9" title="an invalid PID used to represent an uninitialized dbus_pid_t field">DBUS_PID_UNSET</a> &&
<a name="l00349"></a>00349 credentials->unix_uid == <a class="code" href="group__DBusSysdeps.html#ga3d2f3fb32bb759cabe362ca2de383f7d" title="an invalid UID used to represent an uninitialized dbus_uid_t field">DBUS_UID_UNSET</a> &&
<a name="l00350"></a>00350 credentials->windows_sid == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> &&
<a name="l00351"></a>00351 credentials->adt_audit_data == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00352"></a>00352 }
<a name="l00353"></a>00353
<a name="l00360"></a>00360 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00361"></a><a class="code" href="group__DBusCredentials.html#gabfd7a1f681a91b45ba2f4e7461131827">00361</a> <a class="code" href="group__DBusCredentials.html#gabfd7a1f681a91b45ba2f4e7461131827" title="Checks whether a credentials object contains a user identity.">_dbus_credentials_are_anonymous</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials)
<a name="l00362"></a>00362 {
<a name="l00363"></a>00363 <span class="keywordflow">return</span>
<a name="l00364"></a>00364 credentials->unix_uid == <a class="code" href="group__DBusSysdeps.html#ga3d2f3fb32bb759cabe362ca2de383f7d" title="an invalid UID used to represent an uninitialized dbus_uid_t field">DBUS_UID_UNSET</a> &&
<a name="l00365"></a>00365 credentials->windows_sid == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00366"></a>00366 }
<a name="l00367"></a>00367
<a name="l00376"></a>00376 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00377"></a><a class="code" href="group__DBusCredentials.html#ga6b6cab83ecaa05e765967c188f62dd05">00377</a> <a class="code" href="group__DBusCredentials.html#ga6b6cab83ecaa05e765967c188f62dd05" title="Merge all credentials found in the second object into the first object, overwriting the first object ...">_dbus_credentials_add_credentials</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials,
<a name="l00378"></a>00378 <a class="code" href="structDBusCredentials.html">DBusCredentials</a> *other_credentials)
<a name="l00379"></a>00379 {
<a name="l00380"></a>00380 <span class="keywordflow">return</span>
<a name="l00381"></a>00381 <a class="code" href="group__DBusCredentials.html#gabd5a6d038f1d35fd23af8b2e73bb7ef8" title="Merge the given credential found in the second object into the first object, overwriting the first ob...">_dbus_credentials_add_credential</a> (credentials,
<a name="l00382"></a>00382 DBUS_CREDENTIAL_UNIX_PROCESS_ID,
<a name="l00383"></a>00383 other_credentials) &&
<a name="l00384"></a>00384 <a class="code" href="group__DBusCredentials.html#gabd5a6d038f1d35fd23af8b2e73bb7ef8" title="Merge the given credential found in the second object into the first object, overwriting the first ob...">_dbus_credentials_add_credential</a> (credentials,
<a name="l00385"></a>00385 DBUS_CREDENTIAL_UNIX_USER_ID,
<a name="l00386"></a>00386 other_credentials) &&
<a name="l00387"></a>00387 <a class="code" href="group__DBusCredentials.html#gabd5a6d038f1d35fd23af8b2e73bb7ef8" title="Merge the given credential found in the second object into the first object, overwriting the first ob...">_dbus_credentials_add_credential</a> (credentials,
<a name="l00388"></a>00388 DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID,
<a name="l00389"></a>00389 other_credentials) &&
<a name="l00390"></a>00390 <a class="code" href="group__DBusCredentials.html#gabd5a6d038f1d35fd23af8b2e73bb7ef8" title="Merge the given credential found in the second object into the first object, overwriting the first ob...">_dbus_credentials_add_credential</a> (credentials,
<a name="l00391"></a>00391 DBUS_CREDENTIAL_WINDOWS_SID,
<a name="l00392"></a>00392 other_credentials);
<a name="l00393"></a>00393 }
<a name="l00394"></a>00394
<a name="l00407"></a>00407 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00408"></a><a class="code" href="group__DBusCredentials.html#gabd5a6d038f1d35fd23af8b2e73bb7ef8">00408</a> <a class="code" href="group__DBusCredentials.html#gabd5a6d038f1d35fd23af8b2e73bb7ef8" title="Merge the given credential found in the second object into the first object, overwriting the first ob...">_dbus_credentials_add_credential</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials,
<a name="l00409"></a>00409 DBusCredentialType which,
<a name="l00410"></a>00410 <a class="code" href="structDBusCredentials.html">DBusCredentials</a> *other_credentials)
<a name="l00411"></a>00411 {
<a name="l00412"></a>00412 <span class="keywordflow">if</span> (which == DBUS_CREDENTIAL_UNIX_PROCESS_ID &&
<a name="l00413"></a>00413 other_credentials->pid != <a class="code" href="group__DBusSysdeps.html#ga4eb5f05dd6ad89caa4b0340e1cf0b8d9" title="an invalid PID used to represent an uninitialized dbus_pid_t field">DBUS_PID_UNSET</a>)
<a name="l00414"></a>00414 {
<a name="l00415"></a>00415 <span class="keywordflow">if</span> (!<a class="code" href="group__DBusCredentials.html#gaad133a8d06af2a447307266a8425a9f8" title="Add a UNIX process ID to the credentials.">_dbus_credentials_add_pid</a> (credentials, other_credentials->pid))
<a name="l00416"></a>00416 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00417"></a>00417 }
<a name="l00418"></a>00418 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (which == DBUS_CREDENTIAL_UNIX_USER_ID &&
<a name="l00419"></a>00419 other_credentials->unix_uid != <a class="code" href="group__DBusSysdeps.html#ga3d2f3fb32bb759cabe362ca2de383f7d" title="an invalid UID used to represent an uninitialized dbus_uid_t field">DBUS_UID_UNSET</a>)
<a name="l00420"></a>00420 {
<a name="l00421"></a>00421 <span class="keywordflow">if</span> (!<a class="code" href="group__DBusCredentials.html#ga9cec6da43e4be233d44f5bd60b071624" title="Add a UNIX user ID to the credentials.">_dbus_credentials_add_unix_uid</a> (credentials, other_credentials->unix_uid))
<a name="l00422"></a>00422 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00423"></a>00423 }
<a name="l00424"></a>00424 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (which == DBUS_CREDENTIAL_WINDOWS_SID &&
<a name="l00425"></a>00425 other_credentials->windows_sid != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00426"></a>00426 {
<a name="l00427"></a>00427 <span class="keywordflow">if</span> (!<a class="code" href="group__DBusCredentials.html#ga9d2186a4cfa8a421c552ae4592b400f5" title="Add a Windows user SID to the credentials.">_dbus_credentials_add_windows_sid</a> (credentials, other_credentials->windows_sid))
<a name="l00428"></a>00428 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00429"></a>00429 }
<a name="l00430"></a>00430 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (which == DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID &&
<a name="l00431"></a>00431 other_credentials->adt_audit_data != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00432"></a>00432 {
<a name="l00433"></a>00433 <span class="keywordflow">if</span> (!<a class="code" href="group__DBusCredentials.html#gab26eb5cb8d05139806cf06e99c4ec5b0" title="Add ADT audit data to the credentials.">_dbus_credentials_add_adt_audit_data</a> (credentials, other_credentials->adt_audit_data, other_credentials->adt_audit_data_size))
<a name="l00434"></a>00434 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00435"></a>00435 }
<a name="l00436"></a>00436
<a name="l00437"></a>00437 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00438"></a>00438 }
<a name="l00439"></a>00439
<a name="l00445"></a>00445 <span class="keywordtype">void</span>
<a name="l00446"></a><a class="code" href="group__DBusCredentials.html#ga40a5c7e37b10419e233a473dc7173f3c">00446</a> <a class="code" href="group__DBusCredentials.html#ga40a5c7e37b10419e233a473dc7173f3c" title="Clear all credentials in the object.">_dbus_credentials_clear</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials)
<a name="l00447"></a>00447 {
<a name="l00448"></a>00448 credentials->pid = <a class="code" href="group__DBusSysdeps.html#ga4eb5f05dd6ad89caa4b0340e1cf0b8d9" title="an invalid PID used to represent an uninitialized dbus_pid_t field">DBUS_PID_UNSET</a>;
<a name="l00449"></a>00449 credentials->unix_uid = <a class="code" href="group__DBusSysdeps.html#ga3d2f3fb32bb759cabe362ca2de383f7d" title="an invalid UID used to represent an uninitialized dbus_uid_t field">DBUS_UID_UNSET</a>;
<a name="l00450"></a>00450 <a class="code" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free</a> (credentials->windows_sid);
<a name="l00451"></a>00451 credentials->windows_sid = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00452"></a>00452 <a class="code" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free</a> (credentials->adt_audit_data);
<a name="l00453"></a>00453 credentials->adt_audit_data = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00454"></a>00454 credentials->adt_audit_data_size = 0;
<a name="l00455"></a>00455 }
<a name="l00456"></a>00456
<a name="l00463"></a>00463 <a class="code" href="structDBusCredentials.html">DBusCredentials</a>*
<a name="l00464"></a><a class="code" href="group__DBusCredentials.html#ga416f5b9d174e672b63fdd2c11d567eb2">00464</a> <a class="code" href="group__DBusCredentials.html#ga416f5b9d174e672b63fdd2c11d567eb2" title="Copy a credentials object.">_dbus_credentials_copy</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials)
<a name="l00465"></a>00465 {
<a name="l00466"></a>00466 <a class="code" href="structDBusCredentials.html">DBusCredentials</a> *copy;
<a name="l00467"></a>00467
<a name="l00468"></a>00468 copy = <a class="code" href="group__DBusCredentials.html#ga749dd398d725f37a7943d60074785844" title="Creates a new credentials object.">_dbus_credentials_new</a> ();
<a name="l00469"></a>00469 <span class="keywordflow">if</span> (copy == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00470"></a>00470 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00471"></a>00471
<a name="l00472"></a>00472 <span class="keywordflow">if</span> (!<a class="code" href="group__DBusCredentials.html#ga6b6cab83ecaa05e765967c188f62dd05" title="Merge all credentials found in the second object into the first object, overwriting the first object ...">_dbus_credentials_add_credentials</a> (copy, credentials))
<a name="l00473"></a>00473 {
<a name="l00474"></a>00474 <a class="code" href="group__DBusCredentials.html#ga89913c830c3627cd006a50ca693af580" title="Decrement refcount on credentials.">_dbus_credentials_unref</a> (copy);
<a name="l00475"></a>00475 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00476"></a>00476 }
<a name="l00477"></a>00477
<a name="l00478"></a>00478 <span class="keywordflow">return</span> copy;
<a name="l00479"></a>00479 }
<a name="l00480"></a>00480
<a name="l00492"></a>00492 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00493"></a><a class="code" href="group__DBusCredentials.html#ga2f10263b80ff6611c15a78e8f6823dfa">00493</a> <a class="code" href="group__DBusCredentials.html#ga2f10263b80ff6611c15a78e8f6823dfa" title="Check whether the user-identifying credentials in two credentials objects are identical.">_dbus_credentials_same_user</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials,
<a name="l00494"></a>00494 <a class="code" href="structDBusCredentials.html">DBusCredentials</a> *other_credentials)
<a name="l00495"></a>00495 {
<a name="l00496"></a>00496 <span class="comment">/* both windows and unix user must be the same (though pretty much</span>
<a name="l00497"></a>00497 <span class="comment"> * in all conceivable cases, one will be unset)</span>
<a name="l00498"></a>00498 <span class="comment"> */</span>
<a name="l00499"></a>00499 <span class="keywordflow">return</span> credentials->unix_uid == other_credentials->unix_uid &&
<a name="l00500"></a>00500 ((!(credentials->windows_sid || other_credentials->windows_sid)) ||
<a name="l00501"></a>00501 (credentials->windows_sid && other_credentials->windows_sid &&
<a name="l00502"></a>00502 strcmp (credentials->windows_sid, other_credentials->windows_sid) == 0));
<a name="l00503"></a>00503 }
<a name="l00504"></a>00504
<a name="l00513"></a>00513 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00514"></a><a class="code" href="group__DBusCredentials.html#ga50047ecf44c85ecb0878a370592c1576">00514</a> <a class="code" href="group__DBusCredentials.html#ga50047ecf44c85ecb0878a370592c1576" title="Convert the credentials in this object to a human-readable string format, and append to the given str...">_dbus_credentials_to_string_append</a> (<a class="code" href="structDBusCredentials.html">DBusCredentials</a> *credentials,
<a name="l00515"></a>00515 <a class="code" href="structDBusString.html">DBusString</a> *<span class="keywordtype">string</span>)
<a name="l00516"></a>00516 {
<a name="l00517"></a>00517 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a> join;
<a name="l00518"></a>00518
<a name="l00519"></a>00519 join = <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00520"></a>00520 <span class="keywordflow">if</span> (credentials->unix_uid != <a class="code" href="group__DBusSysdeps.html#ga3d2f3fb32bb759cabe362ca2de383f7d" title="an invalid UID used to represent an uninitialized dbus_uid_t field">DBUS_UID_UNSET</a>)
<a name="l00521"></a>00521 {
<a name="l00522"></a>00522 <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#gab0078cf7e0e5bd784ec6d6e0cc3923a2" title="Appends a printf-style formatted string to the DBusString.">_dbus_string_append_printf</a> (<span class="keywordtype">string</span>, <span class="stringliteral">"uid="</span> <a class="code" href="group__DBusSysdeps.html#gab657f0434f01b463891942f373f7b4a1" title="an appropriate printf format for dbus_uid_t">DBUS_UID_FORMAT</a>, credentials->unix_uid))
<a name="l00523"></a>00523 <span class="keywordflow">goto</span> oom;
<a name="l00524"></a>00524 join = <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00525"></a>00525 }
<a name="l00526"></a>00526 <span class="keywordflow">if</span> (credentials->pid != <a class="code" href="group__DBusSysdeps.html#ga4eb5f05dd6ad89caa4b0340e1cf0b8d9" title="an invalid PID used to represent an uninitialized dbus_pid_t field">DBUS_PID_UNSET</a>)
<a name="l00527"></a>00527 {
<a name="l00528"></a>00528 <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#gab0078cf7e0e5bd784ec6d6e0cc3923a2" title="Appends a printf-style formatted string to the DBusString.">_dbus_string_append_printf</a> (<span class="keywordtype">string</span>, <span class="stringliteral">"%spid="</span> <a class="code" href="group__DBusSysdeps.html#gaf4553a43e3b8c0e43d9148a00dcc3fa4" title="an appropriate printf format for dbus_pid_t">DBUS_PID_FORMAT</a>, join ? <span class="stringliteral">" "</span> : <span class="stringliteral">""</span>, credentials->pid))
<a name="l00529"></a>00529 <span class="keywordflow">goto</span> oom;
<a name="l00530"></a>00530 join = <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00531"></a>00531 }
<a name="l00532"></a>00532 <span class="keywordflow">else</span>
<a name="l00533"></a>00533 join = <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00534"></a>00534 <span class="keywordflow">if</span> (credentials->windows_sid != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00535"></a>00535 {
<a name="l00536"></a>00536 <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#gab0078cf7e0e5bd784ec6d6e0cc3923a2" title="Appends a printf-style formatted string to the DBusString.">_dbus_string_append_printf</a> (<span class="keywordtype">string</span>, <span class="stringliteral">"%ssid=%s"</span>, join ? <span class="stringliteral">" "</span> : <span class="stringliteral">""</span>, credentials->windows_sid))
<a name="l00537"></a>00537 <span class="keywordflow">goto</span> oom;
<a name="l00538"></a>00538 join = <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00539"></a>00539 }
<a name="l00540"></a>00540 <span class="keywordflow">else</span>
<a name="l00541"></a>00541 join = <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00542"></a>00542
<a name="l00543"></a>00543 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>;
<a name="l00544"></a>00544 oom:
<a name="l00545"></a>00545 <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>;
<a name="l00546"></a>00546 }
<a name="l00547"></a>00547
<a name="l00550"></a>00550 <span class="comment">/* tests in dbus-credentials-util.c */</span>
</pre></div></div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 3 2016 17:50:30 for D-Bus by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>