Patches from pkgsrc-WIP
[oweals/cde.git] / cde / programs / dtlogin / solaris.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: solaris.h /main/7 1996/10/30 11:12:37 drk $ */
24 /*******************************************************************************
25 **
26 **  solaris.h 1.9 95/09/10 
27 **
28 **  Copyright 1993, 1994, 1995 Sun Microsystems, Inc.  All rights reserved.
29 **
30 **  This file contains header info specific to Sun Solaris login
31 *******************************************************************************/
32 /*                                                                      *
33  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
34  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
35  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
36  * (c) Copyright 1993, 1994 Novell, Inc.                                *
37  */
38 /*******************************************************************************
39 **
40 **  RESTRICTED CONFIDENTIAL INFORMATION:
41 **
42 **  The information in this document is subject to special
43 **  restrictions in a confidential disclosure agreement between
44 **  HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
45 **  document outside HP, IBM, Sun, USL, SCO, or Univel without
46 **  Sun's specific written approval.  This document and all copies
47 **  and derivative works thereof must be returned or destroyed at
48 **  Sun's request.
49 **
50 **  Copyright 1994 Sun Microsystems, Inc.  All rights reserved.
51 **
52 *******************************************************************************/
53
54
55 #ifndef _DTLOGIN_SOLARIS_H
56 #define _DTLOGIN_SOLARIS_H
57
58 #include <sys/types.h>
59
60 #ifdef PAM
61 #include    <security/pam_appl.h>
62 #define SOLARIS_SUCCESS PAM_SUCCESS
63 #endif
64
65 #ifdef SUNAUTH
66 #include    <security/ia_appl.h>
67 #define SOALRIS_SUCCESS IA_SUCCESS
68 #endif
69
70
71 /* Solaris utmp mgt flags */
72
73 #define SOLARIS_UPDATE_ENTRY    1       /* Update an existing entry */
74 #define SOLARIS_NOLOG           2       /* Don't log the new session */
75 #define SOLARIS_LOGIN           4       /* login type entry (sigh...) */
76  
77 /* Errors returned by solaris_setutmp_mgmt/solaris_reset_utmp_mgmt() */
78 #define SOLARIS_NOENTRY         27      /* No entry found */
79 #define SOLARIS_ENTRYFAIL       28      /* Couldn't edit the entry */
80
81 /* user credential UID/GID erros */ 
82 #define SOLARIS_BAD_GID         29      /* Invalid Group ID */
83 #define SOLARIS_INITGROUP_FAIL  30      /* group IDs init failed */
84 #define SOLARIS_BAD_UID         31      /* Invaid User ID */
85 #define SOLARIS_SETGROUP_FAIL   32      /* Set of group IDs failed */
86
87 /*
88  *      External procedure declarations
89  */
90
91
92 extern int solaris_authentication(char*, char*, char*, char*, char*);
93 extern int solaris_accounting(char*, char*, char[], char*, 
94                               char*, pid_t, int, int);
95 extern int solaris_setcred(char*, char *, uid_t, gid_t);
96 extern int solaris_setdevperm(char *, uid_t, gid_t);
97 extern int solaris_resetdevperm(char *);
98
99 extern int audit_login_save_host(char *host);
100 extern int audit_login_save_ttyn(char *ttyn);
101 extern int audit_login_save_port(void);
102 extern int audit_login_success(void);
103 extern int audit_login_save_pw(struct passwd *pwd);
104 extern int audit_login_bad_pw(void);
105 extern int audit_login_maxtrys(void);
106
107
108 #endif /* _DTLOGIN_SOLARIS_H */