port-aix.h revision 137015
1180740Sdes/* $Id: port-aix.h,v 1.21 2004/08/14 14:09:12 dtucker Exp $ */
2180740Sdes
3180740Sdes/*
4180740Sdes *
5180740Sdes * Copyright (c) 2001 Gert Doering.  All rights reserved.
6180740Sdes *
7180744Sdes * Redistribution and use in source and binary forms, with or without
8180740Sdes * modification, are permitted provided that the following conditions
9180740Sdes * are met:
10180740Sdes * 1. Redistributions of source code must retain the above copyright
11180740Sdes *    notice, this list of conditions and the following disclaimer.
12180740Sdes * 2. Redistributions in binary form must reproduce the above copyright
13180740Sdes *    notice, this list of conditions and the following disclaimer in the
14180740Sdes *    documentation and/or other materials provided with the distribution.
15180740Sdes *
16180740Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17180740Sdes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18180740Sdes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19180740Sdes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20180740Sdes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21180740Sdes * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22180740Sdes * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23180740Sdes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24180740Sdes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25180740Sdes * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26180740Sdes */
27180740Sdes
28180740Sdes#ifdef _AIX
29180740Sdes
30180740Sdes#ifdef WITH_AIXAUTHENTICATE
31180740Sdes# include <login.h>
32180740Sdes# include <userpw.h>
33180740Sdes# if defined(HAVE_SYS_AUDIT_H) && defined(AIX_LOGINFAILED_4ARG)
34180740Sdes#  include <sys/audit.h>
35180740Sdes# endif
36180740Sdes# include <usersec.h>
37180740Sdes#endif
38180740Sdes
39180740Sdes/* Some versions define r_type in the above headers, which causes a conflict */
40180740Sdes#ifdef r_type
41180740Sdes# undef r_type
42180740Sdes#endif
43180740Sdes
44180740Sdes/* AIX 4.2.x doesn't have nanosleep but does have nsleep which is equivalent */
45180740Sdes#if !defined(HAVE_NANOSLEEP) && defined(HAVE_NSLEEP)
46180740Sdes# define nanosleep(a,b) nsleep(a,b)
47180740Sdes#endif
48180740Sdes
49180740Sdes/* For struct timespec on AIX 4.2.x */
50180740Sdes#ifdef HAVE_SYS_TIMERS_H
51180740Sdes# include <sys/timers.h>
52180740Sdes#endif
53180740Sdes
54180740Sdes/*
55180740Sdes * According to the setauthdb man page, AIX password registries must be 15
56180740Sdes * chars or less plus terminating NUL.
57180740Sdes */
58180740Sdes#ifdef HAVE_SETAUTHDB
59180740Sdes# define REGISTRY_SIZE	16
60180740Sdes#endif
61180740Sdes
62180740Sdesvoid aix_usrinfo(struct passwd *);
63180740Sdes
64180740Sdes#ifdef WITH_AIXAUTHENTICATE
65180740Sdes# define CUSTOM_SYS_AUTH_PASSWD 1
66180740Sdes# define CUSTOM_SYS_AUTH_ALLOWED_USER 1
67180740Sdesint sys_auth_allowed_user(struct passwd *);
68180740Sdes# define CUSTOM_SYS_AUTH_RECORD_LOGIN 1
69180740Sdesint sys_auth_record_login(const char *, const char *, const char *);
70180740Sdes# define CUSTOM_FAILED_LOGIN 1
71180740Sdesvoid record_failed_login(const char *, const char *);
72180740Sdes#endif
73180740Sdes
74180740Sdesvoid aix_setauthdb(const char *);
75180740Sdesvoid aix_restoreauthdb(void);
76180740Sdesvoid aix_remove_embedded_newlines(char *);
77180740Sdes#endif /* _AIX */
78180740Sdes