summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@suse.com>2023-01-24 10:08:30 +0100
committerDmitry V. Levin <ldv@strace.io>2023-01-24 18:00:00 +0000
commit76f1116c743fe98af674896c8692b6934c8bc16e (patch)
tree0180a793f2a446db284712655df76fe9cb5da6bd /modules
parentd71321e1124763eb738564fa0ff0d85120302299 (diff)
downloadlinux-pam-git-76f1116c743fe98af674896c8692b6934c8bc16e.tar.gz
pam_unix: regenerate yppasswd.h/yppasswd_xdr.c (#480)
Regenerate yppasswd.h and yppasswd_xdr.c from yppasswd.x (libnsl) to avoid GPL code in a PAM module. Link: https://github.com/thkukuk/libnsl/blob/master/src/rpcsvc/yppasswd.x
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_unix/yppasswd.h81
-rw-r--r--modules/pam_unix/yppasswd_xdr.c52
2 files changed, 72 insertions, 61 deletions
diff --git a/modules/pam_unix/yppasswd.h b/modules/pam_unix/yppasswd.h
index 5f947071..dc686cd7 100644
--- a/modules/pam_unix/yppasswd.h
+++ b/modules/pam_unix/yppasswd.h
@@ -1,28 +1,20 @@
/*
- * yppasswdd
- * Copyright 1994, 1995, 1996 Olaf Kirch, <okir@lst.de>
- *
- * This program is covered by the GNU General Public License, version 2
- * or later. It is provided in the hope that it is useful. However, the author
- * disclaims ALL WARRANTIES, expressed or implied. See the GPL for details.
- *
- * This file was generated automatically by rpcgen from yppasswd.x, and
- * editied manually.
+ * Please do not edit this file.
+ * It was generated using rpcgen.
*/
-#ifndef _YPPASSWD_H_
-#define _YPPASSWD_H_
+#ifndef _YPPASSWD_H_RPCGEN
+#define _YPPASSWD_H_RPCGEN
-#define YPPASSWDPROG ((u_long)100009)
-#define YPPASSWDVERS ((u_long)1)
-#define YPPASSWDPROC_UPDATE ((u_long)1)
+#include <rpc/rpc.h>
-/*
- * The password struct passed by the update call. I renamed it to
- * xpasswd to avoid a type clash with the one defined in <pwd.h>.
- */
-#ifndef __sgi
-typedef struct xpasswd {
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+struct xpasswd {
char *pw_name;
char *pw_passwd;
int pw_uid;
@@ -30,22 +22,45 @@ typedef struct xpasswd {
char *pw_gecos;
char *pw_dir;
char *pw_shell;
-} xpasswd;
-
-#else
-#include <pwd.h>
+};
typedef struct xpasswd xpasswd;
-#endif
-/* The updated password information, plus the old password.
- */
-typedef struct yppasswd {
+struct yppasswd {
char *oldpass;
xpasswd newpw;
-} yppasswd;
+};
+typedef struct yppasswd yppasswd;
-/* XDR encoding/decoding routines */
-bool_t xdr_xpasswd(XDR * xdrs, xpasswd * objp);
-bool_t xdr_yppasswd(XDR * xdrs, yppasswd * objp);
+#define YPPASSWDPROG 100009
+#define YPPASSWDVERS 1
+
+#if defined(__STDC__) || defined(__cplusplus)
+#define YPPASSWDPROC_UPDATE 1
+extern int * yppasswdproc_update_1(yppasswd *, CLIENT *);
+extern int * yppasswdproc_update_1_svc(yppasswd *, struct svc_req *);
+extern int yppasswdprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
+
+#else /* K&R C */
+#define YPPASSWDPROC_UPDATE 1
+extern int * yppasswdproc_update_1();
+extern int * yppasswdproc_update_1_svc();
+extern int yppasswdprog_1_freeresult ();
+#endif /* K&R C */
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern bool_t xdr_passwd (XDR *, xpasswd*);
+extern bool_t xdr_yppasswd (XDR *, yppasswd*);
+
+#else /* K&R C */
+extern bool_t xdr_passwd ();
+extern bool_t xdr_yppasswd ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
-#endif /* _YPPASSWD_H_ */
+#endif /* !_YPPASSWD_H_RPCGEN */
diff --git a/modules/pam_unix/yppasswd_xdr.c b/modules/pam_unix/yppasswd_xdr.c
index f2b86a56..0523d523 100644
--- a/modules/pam_unix/yppasswd_xdr.c
+++ b/modules/pam_unix/yppasswd_xdr.c
@@ -1,40 +1,36 @@
/*
- * yppasswdd
- * Copyright 1994, 1995, 1996 Olaf Kirch, <okir@lst.de>
- *
- * This program is covered by the GNU General Public License, version 2
- * or later. It is provided in the hope that it is useful. However, the author
- * disclaims ALL WARRANTIES, expressed or implied. See the GPL for details.
- *
- * This file was generated automatically by rpcgen from yppasswd.x, and
- * editied manually.
+ * Please do not edit this file.
+ * It was generated using rpcgen.
*/
-#include "config.h"
-
-#ifdef HAVE_RPC_RPC_H
-
-#include <rpc/rpc.h>
#include "yppasswd.h"
bool_t
-xdr_xpasswd(XDR * xdrs, xpasswd * objp)
+xdr_passwd (XDR *xdrs, xpasswd *objp)
{
- return xdr_string(xdrs, &objp->pw_name, ~0)
- && xdr_string(xdrs, &objp->pw_passwd, ~0)
- && xdr_int(xdrs, &objp->pw_uid)
- && xdr_int(xdrs, &objp->pw_gid)
- && xdr_string(xdrs, &objp->pw_gecos, ~0)
- && xdr_string(xdrs, &objp->pw_dir, ~0)
- && xdr_string(xdrs, &objp->pw_shell, ~0);
+ if (!xdr_string (xdrs, &objp->pw_name, ~0))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->pw_passwd, ~0))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->pw_uid))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->pw_gid))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->pw_gecos, ~0))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->pw_dir, ~0))
+ return FALSE;
+ if (!xdr_string (xdrs, &objp->pw_shell, ~0))
+ return FALSE;
+ return TRUE;
}
-
bool_t
-xdr_yppasswd(XDR * xdrs, yppasswd * objp)
+xdr_yppasswd (XDR *xdrs, yppasswd *objp)
{
- return xdr_string(xdrs, &objp->oldpass, ~0)
- && xdr_xpasswd(xdrs, &objp->newpw);
+ if (!xdr_string (xdrs, &objp->oldpass, ~0))
+ return FALSE;
+ if (!xdr_passwd (xdrs, &objp->newpw))
+ return FALSE;
+ return TRUE;
}
-
-#endif