[Pkg-shadow-devel] Patch for failure.[ch] - UTMPX
Nicolas François
nicolas.francois@centraliens.net
Fri, 10 Jun 2005 19:33:46 +0200
--SLDf9lqlvOQaIe6s
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Fri, Jun 10, 2005 at 07:05:05AM +0200, Christian Perrier wrote:
> Quoting Nicolas Fran=E7ois (nicolas.francois@centraliens.net):
> > Hello Tomasz,
> >=20
> > I don't really understand this one.
> > It look nice because there are other reference to UTMPX in your CVS.
> > But I don't know what is utmpx, and don't know if the failure must b=
e
> > recorded in (utmp or utmpx) or (utmp and utmpx).
> >=20
> > So this patch may need a review.
>=20
>=20
> But you actually forgot to attach it..:-)
Here it is.
--=20
Nekral
--SLDf9lqlvOQaIe6s
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=006_libmisc_failure_UTMPX
Index: libmisc/failure.c
===================================================================
RCS file: /cvsroot/shadow/libmisc/failure.c,v
retrieving revision 1.13
diff -u -r1.13 failure.c
--- libmisc/failure.c 25 May 2005 19:31:50 -0000 1.13
+++ libmisc/failure.c 10 Jun 2005 17:31:35 -0000
@@ -241,7 +241,13 @@
* maintains a record of all login failures.
*/
-void failtmp (const struct utmp *failent)
+void failtmp (
+#ifdef HAVE_UTMPX_H
+ const struct utmpx *failent
+#else
+ const struct utmp *failent
+#endif
+)
{
char *ftmp;
int fd;
Index: libmisc/failure.h
===================================================================
RCS file: /cvsroot/shadow/libmisc/failure.h,v
retrieving revision 1.3
diff -u -r1.3 failure.h
--- libmisc/failure.h 31 Mar 2005 05:14:50 -0000 1.3
+++ libmisc/failure.h 10 Jun 2005 17:31:35 -0000
@@ -4,7 +4,11 @@
#include "defines.h"
#include "faillog.h"
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#else
#include <utmp.h>
+#endif
/*
* failure - make failure entry
@@ -38,6 +42,10 @@
* failtmp updates the (struct utmp) formatted failure log which
* maintains a record of all login failures.
*/
+#ifdef HAVE_UTMPX_H
+extern void failtmp(const struct utmpx *);
+#else
extern void failtmp (const struct utmp *);
+#endif
#endif
--SLDf9lqlvOQaIe6s--