gshadow.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /* Copyright (C) 2009 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, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. /* Declaration of types and functions for shadow group suite. */
  16. #ifndef _GSHADOW_H
  17. #define _GSHADOW_H 1
  18. #include <features.h>
  19. #include <paths.h>
  20. #define __need_FILE
  21. #include <stdio.h>
  22. #define __need_size_t
  23. #include <stddef.h>
  24. /* Path to the user database files. */
  25. #define GSHADOW _PATH_GSHADOW
  26. __BEGIN_DECLS
  27. /* Structure of the group file. */
  28. struct sgrp
  29. {
  30. char *sg_namp; /* Group name. */
  31. char *sg_passwd; /* Encrypted password. */
  32. char **sg_adm; /* Group administrator list. */
  33. char **sg_mem; /* Group member list. */
  34. };
  35. /* Open database for reading.
  36. This function is not part of POSIX and therefore no official
  37. cancellation point. But due to similarity with an POSIX interface
  38. or due to the implementation it is a cancellation point and
  39. therefore not marked with __THROW. */
  40. extern void setsgent (void);
  41. /* Close database.
  42. This function is not part of POSIX and therefore no official
  43. cancellation point. But due to similarity with an POSIX interface
  44. or due to the implementation it is a cancellation point and
  45. therefore not marked with __THROW. */
  46. extern void endsgent (void);
  47. /* Get next entry from database, perhaps after opening the file.
  48. This function is not part of POSIX and therefore no official
  49. cancellation point. But due to similarity with an POSIX interface
  50. or due to the implementation it is a cancellation point and
  51. therefore not marked with __THROW. */
  52. extern struct sgrp *getsgent (void);
  53. /* Get shadow entry matching NAME.
  54. This function is not part of POSIX and therefore no official
  55. cancellation point. But due to similarity with an POSIX interface
  56. or due to the implementation it is a cancellation point and
  57. therefore not marked with __THROW. */
  58. extern struct sgrp *getsgnam (__const char *__name);
  59. /* Read shadow entry from STRING.
  60. This function is not part of POSIX and therefore no official
  61. cancellation point. But due to similarity with an POSIX interface
  62. or due to the implementation it is a cancellation point and
  63. therefore not marked with __THROW. */
  64. extern struct sgrp *sgetsgent (__const char *__string);
  65. /* Read next shadow entry from STREAM.
  66. This function is not part of POSIX and therefore no official
  67. cancellation point. But due to similarity with an POSIX interface
  68. or due to the implementation it is a cancellation point and
  69. therefore not marked with __THROW. */
  70. extern struct sgrp *fgetsgent (FILE *__stream);
  71. /* Write line containing shadow password entry to stream.
  72. This function is not part of POSIX and therefore no official
  73. cancellation point. But due to similarity with an POSIX interface
  74. or due to the implementation it is a cancellation point and
  75. therefore not marked with __THROW. */
  76. extern int putsgent (__const struct sgrp *__g, FILE *__stream);
  77. #ifdef __USE_MISC
  78. /* Reentrant versions of some of the functions above.
  79. These functions are not part of POSIX and therefore no official
  80. cancellation point. But due to similarity with an POSIX interface
  81. or due to the implementation they are cancellation points and
  82. therefore not marked with __THROW. */
  83. extern int getsgent_r (struct sgrp *__result_buf, char *__buffer,
  84. size_t __buflen, struct sgrp **__result);
  85. extern int getsgnam_r (__const char *__name, struct sgrp *__result_buf,
  86. char *__buffer, size_t __buflen,
  87. struct sgrp **__result);
  88. extern int sgetsgent_r (__const char *__string, struct sgrp *__result_buf,
  89. char *__buffer, size_t __buflen,
  90. struct sgrp **__result);
  91. extern int fgetsgent_r (FILE *__stream, struct sgrp *__result_buf,
  92. char *__buffer, size_t __buflen,
  93. struct sgrp **__result);
  94. #endif /* misc */
  95. __END_DECLS
  96. #endif /* gshadow.h */