patch-tirpc_rpc_auth_h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. --- libtirpc-0.2.3.orig/tirpc/rpc/auth.h 2013-02-13 16:13:59.000000000 +0100
  2. +++ libtirpc-0.2.3/tirpc/rpc/auth.h 2014-03-22 13:20:52.000000000 +0100
  3. @@ -48,7 +48,6 @@
  4. #include <rpc/xdr.h>
  5. #include <rpc/clnt_stat.h>
  6. -#include <sys/cdefs.h>
  7. #include <sys/socket.h>
  8. #include <sys/types.h>
  9. #include <stdio.h>
  10. @@ -165,9 +164,13 @@ union des_block {
  11. char c[8];
  12. };
  13. typedef union des_block des_block;
  14. -__BEGIN_DECLS
  15. +#ifdef __cplusplus
  16. +extern "C" {
  17. +#endif
  18. extern bool_t xdr_des_block(XDR *, des_block *);
  19. -__END_DECLS
  20. +#ifdef __cplusplus
  21. +}
  22. +#endif
  23. /*
  24. * Authentication info. Opaque to client.
  25. @@ -288,9 +291,13 @@ auth_put(AUTH *auth)
  26. xfunc, xwhere))
  27. -__BEGIN_DECLS
  28. +#ifdef __cplusplus
  29. +extern "C" {
  30. +#endif
  31. extern struct opaque_auth _null_auth;
  32. -__END_DECLS
  33. +#ifdef __cplusplus
  34. +}
  35. +#endif
  36. /*
  37. * Any style authentication. These routines can be used by any
  38. @@ -311,11 +318,15 @@ int authany_wrap(void), authany_unwrap(v
  39. * int len;
  40. * int *aup_gids;
  41. */
  42. -__BEGIN_DECLS
  43. +#ifdef __cplusplus
  44. +extern "C" {
  45. +#endif
  46. extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *);
  47. extern AUTH *authunix_create_default(void); /* takes no parameters */
  48. extern AUTH *authnone_create(void); /* takes no parameters */
  49. -__END_DECLS
  50. +#ifdef __cplusplus
  51. +}
  52. +#endif
  53. /*
  54. * DES style authentication
  55. * AUTH *authsecdes_create(servername, window, timehost, ckey)
  56. @@ -324,15 +335,23 @@ __END_DECLS
  57. * const char *timehost; - optional hostname to sync with
  58. * des_block *ckey; - optional conversation key to use
  59. */
  60. -__BEGIN_DECLS
  61. +#ifdef __cplusplus
  62. +extern "C" {
  63. +#endif
  64. extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *);
  65. extern AUTH *authdes_seccreate (const char *, const u_int, const char *,
  66. const des_block *);
  67. -__END_DECLS
  68. +#ifdef __cplusplus
  69. +}
  70. +#endif
  71. -__BEGIN_DECLS
  72. +#ifdef __cplusplus
  73. +extern "C" {
  74. +#endif
  75. extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *);
  76. -__END_DECLS
  77. +#ifdef __cplusplus
  78. +}
  79. +#endif
  80. #define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
  81. #define authsys_create_default() authunix_create_default()
  82. @@ -340,36 +359,48 @@ __END_DECLS
  83. /*
  84. * Netname manipulation routines.
  85. */
  86. -__BEGIN_DECLS
  87. +#ifdef __cplusplus
  88. +extern "C" {
  89. +#endif
  90. extern int getnetname(char *);
  91. extern int host2netname(char *, const char *, const char *);
  92. extern int user2netname(char *, const uid_t, const char *);
  93. extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *);
  94. extern int netname2host(char *, char *, const int);
  95. extern void passwd2des ( char *, char * );
  96. -__END_DECLS
  97. +#ifdef __cplusplus
  98. +}
  99. +#endif
  100. /*
  101. *
  102. * These routines interface to the keyserv daemon
  103. *
  104. */
  105. -__BEGIN_DECLS
  106. +#ifdef __cplusplus
  107. +extern "C" {
  108. +#endif
  109. extern int key_decryptsession(const char *, des_block *);
  110. extern int key_encryptsession(const char *, des_block *);
  111. extern int key_gendes(des_block *);
  112. extern int key_setsecret(const char *);
  113. extern int key_secretkey_is_set(void);
  114. -__END_DECLS
  115. +#ifdef __cplusplus
  116. +}
  117. +#endif
  118. /*
  119. * Publickey routines.
  120. */
  121. -__BEGIN_DECLS
  122. +#ifdef __cplusplus
  123. +extern "C" {
  124. +#endif
  125. extern int getpublickey (const char *, char *);
  126. extern int getpublicandprivatekey (char *, char *);
  127. extern int getsecretkey (char *, char *, char *);
  128. -__END_DECLS
  129. +#ifdef __cplusplus
  130. +}
  131. +#endif
  132. #ifdef KERBEROS
  133. /*
  134. @@ -382,10 +413,14 @@ __END_DECLS
  135. * const char *timehost; - optional hostname to sync with
  136. * int *status; - kerberos status returned
  137. */
  138. -__BEGIN_DECLS
  139. +#ifdef __cplusplus
  140. +extern "C" {
  141. +#endif
  142. extern AUTH *authkerb_seccreate(const char *, const char *, const char *,
  143. const u_int, const char *, int *);
  144. -__END_DECLS
  145. +#ifdef __cplusplus
  146. +}
  147. +#endif
  148. /*
  149. * Map a kerberos credential into a unix cred.
  150. @@ -398,19 +433,27 @@ __END_DECLS
  151. * int *groups;
  152. *
  153. */
  154. -__BEGIN_DECLS
  155. +#ifdef __cplusplus
  156. +extern "C" {
  157. +#endif
  158. extern int authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *,
  159. short *, int * */);
  160. -__END_DECLS
  161. +#ifdef __cplusplus
  162. +}
  163. +#endif
  164. #endif /* KERBEROS */
  165. -__BEGIN_DECLS
  166. +#ifdef __cplusplus
  167. +extern "C" {
  168. +#endif
  169. struct svc_req;
  170. struct rpc_msg;
  171. enum auth_stat _svcauth_none (struct svc_req *, struct rpc_msg *);
  172. enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *);
  173. enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *);
  174. -__END_DECLS
  175. +#ifdef __cplusplus
  176. +}
  177. +#endif
  178. #define AUTH_NONE 0 /* no authentication */
  179. #define AUTH_NULL 0 /* backward compatibility */