gshadow.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /* Copyright (C) 2009-2020 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <https://www.gnu.org/licenses/>. */
  14. /* Declaration of types and functions for shadow group suite. */
  15. #ifndef _GSHADOW_H
  16. #define _GSHADOW_H 1
  17. #include <features.h>
  18. #include <paths.h>
  19. #include <bits/types/FILE.h>
  20. #define __need_size_t
  21. #include <stddef.h>
  22. /* Path to the user database files. */
  23. #define GSHADOW _PATH_GSHADOW
  24. __BEGIN_DECLS
  25. /* Structure of the group file. */
  26. struct sgrp
  27. {
  28. char *sg_namp; /* Group name. */
  29. char *sg_passwd; /* Encrypted password. */
  30. char **sg_adm; /* Group administrator list. */
  31. char **sg_mem; /* Group member list. */
  32. };
  33. /* Open database for reading.
  34. This function is not part of POSIX and therefore no official
  35. cancellation point. But due to similarity with an POSIX interface
  36. or due to the implementation it is a cancellation point and
  37. therefore not marked with __THROW. */
  38. extern void setsgent (void);
  39. /* Close database.
  40. This function is not part of POSIX and therefore no official
  41. cancellation point. But due to similarity with an POSIX interface
  42. or due to the implementation it is a cancellation point and
  43. therefore not marked with __THROW. */
  44. extern void endsgent (void);
  45. /* Get next entry from database, perhaps after opening the file.
  46. This function is not part of POSIX and therefore no official
  47. cancellation point. But due to similarity with an POSIX interface
  48. or due to the implementation it is a cancellation point and
  49. therefore not marked with __THROW. */
  50. extern struct sgrp *getsgent (void);
  51. /* Get shadow entry matching NAME.
  52. This function is not part of POSIX and therefore no official
  53. cancellation point. But due to similarity with an POSIX interface
  54. or due to the implementation it is a cancellation point and
  55. therefore not marked with __THROW. */
  56. extern struct sgrp *getsgnam (const char *__name);
  57. /* Read shadow entry from STRING.
  58. This function is not part of POSIX and therefore no official
  59. cancellation point. But due to similarity with an POSIX interface
  60. or due to the implementation it is a cancellation point and
  61. therefore not marked with __THROW. */
  62. extern struct sgrp *sgetsgent (const char *__string);
  63. /* Read next shadow entry from STREAM.
  64. This function is not part of POSIX and therefore no official
  65. cancellation point. But due to similarity with an POSIX interface
  66. or due to the implementation it is a cancellation point and
  67. therefore not marked with __THROW. */
  68. extern struct sgrp *fgetsgent (FILE *__stream);
  69. /* Write line containing shadow password entry to stream.
  70. This function is not part of POSIX and therefore no official
  71. cancellation point. But due to similarity with an POSIX interface
  72. or due to the implementation it is a cancellation point and
  73. therefore not marked with __THROW. */
  74. extern int putsgent (const struct sgrp *__g, FILE *__stream);
  75. #ifdef __USE_MISC
  76. /* Reentrant versions of some of the functions above.
  77. These functions are not part of POSIX and therefore no official
  78. cancellation point. But due to similarity with an POSIX interface
  79. or due to the implementation they are cancellation points and
  80. therefore not marked with __THROW. */
  81. extern int getsgent_r (struct sgrp *__result_buf, char *__buffer,
  82. size_t __buflen, struct sgrp **__result);
  83. extern int getsgnam_r (const char *__name, struct sgrp *__result_buf,
  84. char *__buffer, size_t __buflen,
  85. struct sgrp **__result);
  86. extern int sgetsgent_r (const char *__string, struct sgrp *__result_buf,
  87. char *__buffer, size_t __buflen,
  88. struct sgrp **__result);
  89. extern int fgetsgent_r (FILE *__stream, struct sgrp *__result_buf,
  90. char *__buffer, size_t __buflen,
  91. struct sgrp **__result);
  92. #endif /* misc */
  93. __END_DECLS
  94. #endif /* gshadow.h */