patch-tirpc_rpc_auth_h 4.4 KB

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