D-Bus  1.13.16
dbus-userdb.c
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-userdb.c User database abstraction
3  *
4  * Copyright (C) 2003, 2004 Red Hat, Inc.
5  *
6  * Licensed under the Academic Free License version 2.1
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23 #include <config.h>
24 #define DBUS_USERDB_INCLUDES_PRIVATE 1
25 #include "dbus-userdb.h"
26 #include "dbus-hash.h"
27 #include "dbus-test.h"
28 #include "dbus-internals.h"
29 #include "dbus-protocol.h"
30 #include "dbus-credentials.h"
31 #include <string.h>
32 
33 /* It isn't obvious from its name, but this file is part of the Unix
34  * system-dependent part of libdbus. Windows has a parallel
35  * implementation of some of it in dbus-sysdeps-win.c. */
36 #if defined(DBUS_WIN) || !defined(DBUS_UNIX)
37 #error "This file only makes sense on Unix OSs"
38 #endif
39 
51 void
53 {
54  if (info == NULL) /* hash table will pass NULL */
55  return;
56 
57  _dbus_user_info_free (info);
58  dbus_free (info);
59 }
60 
67 void
69 {
70  if (info == NULL) /* hash table will pass NULL */
71  return;
72 
73  _dbus_group_info_free (info);
74  dbus_free (info);
75 }
76 
82 void
84 {
85  dbus_free (info->group_ids);
86  dbus_free (info->username);
87  dbus_free (info->homedir);
88 }
89 
95 void
97 {
98  dbus_free (info->groupname);
99 }
100 
111  unsigned long *num)
112 {
113  int end;
114 
115  if (_dbus_string_parse_uint (str, 0, num, &end) &&
116  end == _dbus_string_get_length (str))
117  return TRUE;
118  else
119  return FALSE;
120 }
121 
135 _dbus_user_database_lookup (DBusUserDatabase *db,
136  dbus_uid_t uid,
137  const DBusString *username,
138  DBusError *error)
139 {
140  DBusUserInfo *info;
141 
142  _DBUS_ASSERT_ERROR_IS_CLEAR (error);
143  _dbus_assert (uid != DBUS_UID_UNSET || username != NULL);
144 
145  /* See if the username is really a number */
146  if (uid == DBUS_UID_UNSET)
147  {
148  unsigned long n;
149 
150  if (_dbus_is_a_number (username, &n))
151  uid = n;
152  }
153 
154  if (uid != DBUS_UID_UNSET)
155  info = _dbus_hash_table_lookup_uintptr (db->users, uid);
156  else
157  info = _dbus_hash_table_lookup_string (db->users_by_name, _dbus_string_get_const_data (username));
158 
159  if (info)
160  {
161  _dbus_verbose ("Using cache for UID "DBUS_UID_FORMAT" information\n",
162  info->uid);
163  return info;
164  }
165  else
166  {
167  if (uid != DBUS_UID_UNSET)
168  _dbus_verbose ("No cache for UID "DBUS_UID_FORMAT"\n",
169  uid);
170  else
171  _dbus_verbose ("No cache for user \"%s\"\n",
172  _dbus_string_get_const_data (username));
173 
174  info = dbus_new0 (DBusUserInfo, 1);
175  if (info == NULL)
176  {
178  return NULL;
179  }
180 
181  if (uid != DBUS_UID_UNSET)
182  {
183  if (!_dbus_user_info_fill_uid (info, uid, error))
184  {
185  _DBUS_ASSERT_ERROR_IS_SET (error);
187  return NULL;
188  }
189  }
190  else
191  {
192  if (!_dbus_user_info_fill (info, username, error))
193  {
194  _DBUS_ASSERT_ERROR_IS_SET (error);
196  return NULL;
197  }
198  }
199 
200  /* be sure we don't use these after here */
201  uid = DBUS_UID_UNSET;
202  username = NULL;
203 
204  /* insert into hash */
205  if (!_dbus_hash_table_insert_uintptr (db->users, info->uid, info))
206  {
209  return NULL;
210  }
211 
212  if (!_dbus_hash_table_insert_string (db->users_by_name,
213  info->username,
214  info))
215  {
216  _dbus_hash_table_remove_uintptr (db->users, info->uid);
218  return NULL;
219  }
220 
221  return info;
222  }
223 }
224 
225 /* Protected by _DBUS_LOCK_system_users */
226 static dbus_bool_t database_locked = FALSE;
227 static DBusUserDatabase *system_db = NULL;
228 static DBusString process_username;
229 static DBusString process_homedir;
230 
231 static void
232 shutdown_system_db (void *data)
233 {
234  if (system_db != NULL)
235  _dbus_user_database_unref (system_db);
236  system_db = NULL;
237  _dbus_string_free (&process_username);
238  _dbus_string_free (&process_homedir);
239 }
240 
241 static dbus_bool_t
242 init_system_db (void)
243 {
244  _dbus_assert (database_locked);
245 
246  if (system_db == NULL)
247  {
248  DBusError error = DBUS_ERROR_INIT;
249  const DBusUserInfo *info;
250 
251  system_db = _dbus_user_database_new ();
252  if (system_db == NULL)
253  return FALSE;
254 
255  if (!_dbus_user_database_get_uid (system_db,
256  _dbus_getuid (),
257  &info,
258  &error))
259  {
260  _dbus_user_database_unref (system_db);
261  system_db = NULL;
262 
264  {
265  dbus_error_free (&error);
266  return FALSE;
267  }
268  else
269  {
270  /* This really should not happen. */
271  _dbus_warn ("Could not get password database information for UID of current process: %s",
272  error.message);
273  dbus_error_free (&error);
274  return FALSE;
275  }
276  }
277 
278  if (!_dbus_string_init (&process_username))
279  {
280  _dbus_user_database_unref (system_db);
281  system_db = NULL;
282  return FALSE;
283  }
284 
285  if (!_dbus_string_init (&process_homedir))
286  {
287  _dbus_string_free (&process_username);
288  _dbus_user_database_unref (system_db);
289  system_db = NULL;
290  return FALSE;
291  }
292 
293  if (!_dbus_string_append (&process_username,
294  info->username) ||
295  !_dbus_string_append (&process_homedir,
296  info->homedir) ||
297  !_dbus_register_shutdown_func (shutdown_system_db, NULL))
298  {
299  _dbus_string_free (&process_username);
300  _dbus_string_free (&process_homedir);
301  _dbus_user_database_unref (system_db);
302  system_db = NULL;
303  return FALSE;
304  }
305  }
306 
307  return TRUE;
308 }
309 
315 {
316  if (_DBUS_LOCK (system_users))
317  {
318  database_locked = TRUE;
319  return TRUE;
320  }
321  else
322  {
323  return FALSE;
324  }
325 }
326 
330 void
332 {
333  database_locked = FALSE;
334  _DBUS_UNLOCK (system_users);
335 }
336 
343 DBusUserDatabase*
345 {
346  _dbus_assert (database_locked);
347 
348  init_system_db ();
349 
350  return system_db;
351 }
352 
356 void
358 {
360  {
361  /* nothing to flush */
362  return;
363  }
364 
365  if (system_db != NULL)
366  _dbus_user_database_flush (system_db);
367 
369 }
370 
380 {
382  return FALSE;
383 
384  if (!init_system_db ())
385  {
387  return FALSE;
388  }
389  *username = &process_username;
391 
392  return TRUE;
393 }
394 
404 {
406  return FALSE;
407 
408  if (!init_system_db ())
409  {
411  return FALSE;
412  }
413  *homedir = &process_homedir;
415 
416  return TRUE;
417 }
418 
428  DBusString *homedir)
429 {
430  DBusUserDatabase *db;
431  const DBusUserInfo *info;
432 
433  if (uid == _dbus_getuid () && uid == _dbus_geteuid ())
434  {
435  const char *from_environment;
436 
437  from_environment = _dbus_getenv ("HOME");
438 
439  if (from_environment != NULL)
440  return _dbus_string_append (homedir, from_environment);
441  }
442 
443  /* FIXME: this can't distinguish ENOMEM from other errors */
445  return FALSE;
446 
448  if (db == NULL)
449  {
451  return FALSE;
452  }
453 
454  if (!_dbus_user_database_get_uid (db, uid,
455  &info, NULL))
456  {
458  return FALSE;
459  }
460 
461  if (!_dbus_string_append (homedir, info->homedir))
462  {
464  return FALSE;
465  }
466 
468  return TRUE;
469 }
470 
487  const DBusString *username,
488  DBusCredentialsAddFlags flags,
489  DBusError *error)
490 {
491  DBusUserDatabase *db;
492  const DBusUserInfo *info;
493  unsigned long uid = DBUS_UID_UNSET;
494 
495  /* Fast-path for the common case: if the "username" is all-numeric,
496  * then it's a Unix uid. This is true regardless of whether that uid
497  * exists in NSS or /etc/passwd or equivalent. */
498  if (_dbus_is_a_number (username, &uid))
499  {
500  _DBUS_STATIC_ASSERT (sizeof (uid) == sizeof (dbus_uid_t));
501 
503  {
504  return TRUE;
505  }
506  else
507  {
508  _DBUS_SET_OOM (error);
509  return FALSE;
510  }
511  }
512 
513  /* If we aren't allowed to look in NSS or /etc/passwd, fail now. */
514  if (!(flags & DBUS_CREDENTIALS_ADD_FLAGS_USER_DATABASE))
515  {
517  "Expected a numeric Unix uid");
518  return FALSE;
519  }
520 
522  {
523  _DBUS_SET_OOM (error);
524  return FALSE;
525  }
526 
528  if (db == NULL)
529  {
531  _DBUS_SET_OOM (error);
532  return FALSE;
533  }
534 
535  if (!_dbus_user_database_get_username (db, username,
536  &info, error))
537  {
539  return FALSE;
540  }
541 
543  {
545  _DBUS_SET_OOM (error);
546  return FALSE;
547  }
548 
550  return TRUE;
551 }
552 
558 DBusUserDatabase*
560 {
561  DBusUserDatabase *db;
562 
563  db = dbus_new0 (DBusUserDatabase, 1);
564  if (db == NULL)
565  return NULL;
566 
567  db->refcount = 1;
568 
571 
572  if (db->users == NULL)
573  goto failed;
574 
577 
578  if (db->groups == NULL)
579  goto failed;
580 
581  db->users_by_name = _dbus_hash_table_new (DBUS_HASH_STRING,
582  NULL, NULL);
583  if (db->users_by_name == NULL)
584  goto failed;
585 
586  db->groups_by_name = _dbus_hash_table_new (DBUS_HASH_STRING,
587  NULL, NULL);
588  if (db->groups_by_name == NULL)
589  goto failed;
590 
591  return db;
592 
593  failed:
595  return NULL;
596 }
597 
601 void
602 _dbus_user_database_flush (DBusUserDatabase *db)
603 {
604  _dbus_hash_table_remove_all(db->users_by_name);
605  _dbus_hash_table_remove_all(db->groups_by_name);
606  _dbus_hash_table_remove_all(db->users);
607  _dbus_hash_table_remove_all(db->groups);
608 }
609 
610 #ifdef DBUS_ENABLE_EMBEDDED_TESTS
611 
616 DBusUserDatabase *
617 _dbus_user_database_ref (DBusUserDatabase *db)
618 {
619  _dbus_assert (db->refcount > 0);
620 
621  db->refcount += 1;
622 
623  return db;
624 }
625 #endif /* DBUS_ENABLE_EMBEDDED_TESTS */
626 
631 void
632 _dbus_user_database_unref (DBusUserDatabase *db)
633 {
634  _dbus_assert (db->refcount > 0);
635 
636  db->refcount -= 1;
637  if (db->refcount == 0)
638  {
639  if (db->users)
640  _dbus_hash_table_unref (db->users);
641 
642  if (db->groups)
643  _dbus_hash_table_unref (db->groups);
644 
645  if (db->users_by_name)
646  _dbus_hash_table_unref (db->users_by_name);
647 
648  if (db->groups_by_name)
649  _dbus_hash_table_unref (db->groups_by_name);
650 
651  dbus_free (db);
652  }
653 }
654 
666 _dbus_user_database_get_uid (DBusUserDatabase *db,
667  dbus_uid_t uid,
668  const DBusUserInfo **info,
669  DBusError *error)
670 {
671  *info = _dbus_user_database_lookup (db, uid, NULL, error);
672  return *info != NULL;
673 }
674 
685 _dbus_user_database_get_username (DBusUserDatabase *db,
686  const DBusString *username,
687  const DBusUserInfo **info,
688  DBusError *error)
689 {
690  *info = _dbus_user_database_lookup (db, DBUS_UID_UNSET, username, error);
691  return *info != NULL;
692 }
693 
696 /* Tests in dbus-userdb-util.c */
_dbus_user_info_fill
dbus_bool_t _dbus_user_info_fill(DBusUserInfo *info, const DBusString *username, DBusError *error)
Gets user info for the given username.
Definition: dbus-sysdeps-unix.c:2884
DBusUserInfo::group_ids
dbus_gid_t * group_ids
Groups IDs, including above primary group.
Definition: dbus-sysdeps-unix.h:110
_dbus_hash_table_insert_uintptr
dbus_bool_t _dbus_hash_table_insert_uintptr(DBusHashTable *table, uintptr_t key, void *value)
Creates a hash entry with the given key and value.
Definition: dbus-hash.c:1352
_dbus_hash_table_unref
void _dbus_hash_table_unref(DBusHashTable *table)
Decrements the reference count for a hash table, freeing the hash table if the count reaches zero.
Definition: dbus-hash.c:367
_dbus_user_info_fill_uid
dbus_bool_t _dbus_user_info_fill_uid(DBusUserInfo *info, dbus_uid_t uid, DBusError *error)
Gets user info for the given user ID.
Definition: dbus-sysdeps-unix.c:2901
_dbus_user_database_get_uid
dbus_bool_t _dbus_user_database_get_uid(DBusUserDatabase *db, dbus_uid_t uid, const DBusUserInfo **info, DBusError *error)
Gets the user information for the given UID, returned user info should not be freed.
Definition: dbus-userdb.c:666
_dbus_getuid
dbus_uid_t _dbus_getuid(void)
Gets our UID.
Definition: dbus-sysdeps-unix.c:2973
_dbus_user_info_free_allocated
void _dbus_user_info_free_allocated(DBusUserInfo *info)
Frees the given DBusUserInfo's members with _dbus_user_info_free() and also calls dbus_free() on the ...
Definition: dbus-userdb.c:52
_dbus_user_database_unlock_system
void _dbus_user_database_unlock_system(void)
Unlocks global system user database.
Definition: dbus-userdb.c:331
_dbus_string_free
void _dbus_string_free(DBusString *str)
Frees a string created by _dbus_string_init(), and fills it with the same contents as #_DBUS_STRING_I...
Definition: dbus-string.c:271
_dbus_hash_table_lookup_string
void * _dbus_hash_table_lookup_string(DBusHashTable *table, const char *key)
Looks up the value for a given string in a hash table of type DBUS_HASH_STRING.
Definition: dbus-hash.c:1112
_dbus_user_database_unref
void _dbus_user_database_unref(DBusUserDatabase *db)
Decrements refcount of user database.
Definition: dbus-userdb.c:632
DBUS_UID_FORMAT
#define DBUS_UID_FORMAT
an appropriate printf format for dbus_uid_t
Definition: dbus-sysdeps.h:151
DBusFreeFunction
void(* DBusFreeFunction)(void *memory)
Definition: dbus-memory.h:63
_dbus_username_from_current_process
dbus_bool_t _dbus_username_from_current_process(const DBusString **username)
Gets username of user owning current process.
Definition: dbus-userdb.c:379
_dbus_user_database_flush
void _dbus_user_database_flush(DBusUserDatabase *db)
Flush all information out of the user database.
Definition: dbus-userdb.c:602
DBusGroupInfo
Information about a UNIX group.
Definition: dbus-sysdeps-unix.h:119
_dbus_credentials_add_from_user
dbus_bool_t _dbus_credentials_add_from_user(DBusCredentials *credentials, const DBusString *username, DBusCredentialsAddFlags flags, DBusError *error)
Adds the credentials corresponding to the given username.
Definition: dbus-userdb.c:486
DBusUserInfo::uid
dbus_uid_t uid
UID.
Definition: dbus-sysdeps-unix.h:108
_dbus_string_init
dbus_bool_t _dbus_string_init(DBusString *str)
Initializes a string.
Definition: dbus-string.c:182
_DBUS_LOCK
#define _DBUS_LOCK(name)
Definition: dbus-internals.h:412
_dbus_hash_table_new
DBusHashTable * _dbus_hash_table_new(DBusHashType type, DBusFreeFunction key_free_function, DBusFreeFunction value_free_function)
Constructs a new hash table.
Definition: dbus-hash.c:291
TRUE
#define TRUE
_dbus_user_info_free
void _dbus_user_info_free(DBusUserInfo *info)
Frees the members of info (but not info itself)
Definition: dbus-userdb.c:83
DBUS_HASH_STRING
@ DBUS_HASH_STRING
Hash keys are strings.
Definition: dbus-hash.h:69
_dbus_user_database_new
DBusUserDatabase * _dbus_user_database_new(void)
Creates a new user database object used to look up and cache user information.
Definition: dbus-userdb.c:559
dbus_error_has_name
dbus_bool_t dbus_error_has_name(const DBusError *error, const char *name)
Checks whether the error is set and has the given name.
Definition: dbus-errors.c:302
DBusUserInfo::username
char * username
Username.
Definition: dbus-sysdeps-unix.h:112
dbus_free
void dbus_free(void *memory)
Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().
Definition: dbus-memory.c:704
_dbus_user_database_lock_system
dbus_bool_t _dbus_user_database_lock_system(void)
Locks global system user database.
Definition: dbus-userdb.c:314
_dbus_register_shutdown_func
DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_register_shutdown_func(DBusShutdownFunction function, void *data)
Register a cleanup function to be called exactly once the next time dbus_shutdown() is called.
Definition: dbus-memory.c:813
DBusString
Definition: dbus-string.h:42
DBusUserInfo::homedir
char * homedir
Home directory.
Definition: dbus-sysdeps-unix.h:113
_dbus_group_info_free
void _dbus_group_info_free(DBusGroupInfo *info)
Frees the members of info (but not info itself).
Definition: dbus-userdb.c:96
DBusCredentials
Definition: dbus-credentials.c:49
_dbus_user_database_get_system
DBusUserDatabase * _dbus_user_database_get_system(void)
Gets the system global user database; must be called with lock held (_dbus_user_database_lock_system(...
Definition: dbus-userdb.c:344
dbus_uid_t
unsigned long dbus_uid_t
A user ID.
Definition: dbus-sysdeps.h:137
FALSE
#define FALSE
_dbus_hash_table_remove_all
void _dbus_hash_table_remove_all(DBusHashTable *table)
Removed all entries from a hash table.
Definition: dbus-hash.c:424
DBUS_ERROR_NO_MEMORY
#define DBUS_ERROR_NO_MEMORY
There was not enough memory to complete an operation.
Definition: dbus-protocol.h:361
_dbus_is_a_number
dbus_bool_t _dbus_is_a_number(const DBusString *str, unsigned long *num)
Checks if a given string is actually a number and converts it if it is.
Definition: dbus-userdb.c:110
DBUS_ERROR_INIT
#define DBUS_ERROR_INIT
Definition: dbus-errors.h:62
_dbus_hash_table_lookup_uintptr
void * _dbus_hash_table_lookup_uintptr(DBusHashTable *table, uintptr_t key)
Looks up the value for a given integer in a hash table of type DBUS_HASH_UINTPTR.
Definition: dbus-hash.c:1162
DBUS_UID_UNSET
#define DBUS_UID_UNSET
an invalid UID used to represent an uninitialized dbus_uid_t field
Definition: dbus-sysdeps.h:144
DBUS_HASH_UINTPTR
@ DBUS_HASH_UINTPTR
Hash keys are integer capable to hold a pointer.
Definition: dbus-hash.h:71
_dbus_user_database_lookup
DBusUserInfo * _dbus_user_database_lookup(DBusUserDatabase *db, dbus_uid_t uid, const DBusString *username, DBusError *error)
Looks up a uid or username in the user database.
Definition: dbus-userdb.c:135
_dbus_user_database_get_username
dbus_bool_t _dbus_user_database_get_username(DBusUserDatabase *db, const DBusString *username, const DBusUserInfo **info, DBusError *error)
Gets the user information for the given username.
Definition: dbus-userdb.c:685
DBUS_ERROR_INVALID_ARGS
#define DBUS_ERROR_INVALID_ARGS
Invalid arguments passed to a method call.
Definition: dbus-protocol.h:395
_dbus_assert
#define _dbus_assert(condition)
Definition: dbus-internals.h:153
dbus_error_free
void dbus_error_free(DBusError *error)
Frees an error that's been set (or just initialized), then reinitializes the error as in dbus_error_i...
Definition: dbus-errors.c:211
DBusUserInfo
Information about a UNIX user.
Definition: dbus-sysdeps-unix.h:106
_dbus_warn
void _dbus_warn(const char *format,...)
Prints a warning message to stderr.
Definition: dbus-internals.c:238
_dbus_geteuid
dbus_uid_t _dbus_geteuid(void)
Gets our effective UID.
Definition: dbus-sysdeps-unix.c:2982
_dbus_user_database_flush_system
void _dbus_user_database_flush_system(void)
Flushes the system global user database;.
Definition: dbus-userdb.c:357
_dbus_getenv
const char * _dbus_getenv(const char *varname)
Wrapper for getenv().
Definition: dbus-sysdeps.c:195
DBusError
Object representing an exception.
Definition: dbus-errors.h:48
_dbus_hash_table_remove_uintptr
dbus_bool_t _dbus_hash_table_remove_uintptr(DBusHashTable *table, uintptr_t key)
Removes the hash entry for the given key.
Definition: dbus-hash.c:1242
dbus_set_error
void dbus_set_error(DBusError *error, const char *name, const char *format,...)
Assigns an error name and message to a DBusError.
Definition: dbus-errors.c:354
_dbus_group_info_free_allocated
void _dbus_group_info_free_allocated(DBusGroupInfo *info)
Frees the given DBusGroupInfo's members with _dbus_group_info_free() and also calls dbus_free() on th...
Definition: dbus-userdb.c:68
_DBUS_UNLOCK
#define _DBUS_UNLOCK(name)
Definition: dbus-internals.h:413
_dbus_string_parse_uint
DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_parse_uint(const DBusString *str, int start, unsigned long *value_return, int *end_return)
Parses an unsigned integer contained in a DBusString.
Definition: dbus-sysdeps.c:483
DBusError::message
const char * message
public error message field
Definition: dbus-errors.h:51
_dbus_homedir_from_uid
dbus_bool_t _dbus_homedir_from_uid(dbus_uid_t uid, DBusString *homedir)
Gets the home directory for the given user.
Definition: dbus-userdb.c:427
dbus_new0
#define dbus_new0(type, count)
Definition: dbus-memory.h:58
_dbus_hash_table_insert_string
dbus_bool_t _dbus_hash_table_insert_string(DBusHashTable *table, char *key, void *value)
Creates a hash entry with the given key and value.
Definition: dbus-hash.c:1277
_dbus_homedir_from_current_process
dbus_bool_t _dbus_homedir_from_current_process(const DBusString **homedir)
Gets homedir of user owning current process.
Definition: dbus-userdb.c:403
_dbus_string_append
dbus_bool_t _dbus_string_append(DBusString *str, const char *buffer)
Appends a nul-terminated C-style string to a DBusString.
Definition: dbus-string.c:959
DBusGroupInfo::groupname
char * groupname
Group name.
Definition: dbus-sysdeps-unix.h:122
DBusTransport::credentials
DBusCredentials * credentials
Credentials of other end read from the socket.
Definition: dbus-transport-protected.h:92
dbus_bool_t
dbus_uint32_t dbus_bool_t
Definition: dbus-types.h:35
NULL
#define NULL
_dbus_credentials_add_unix_uid
dbus_bool_t _dbus_credentials_add_unix_uid(DBusCredentials *credentials, dbus_uid_t uid)
Add a UNIX user ID to the credentials.
Definition: dbus-credentials.c:173