1145b7b3cSmrg/* 2145b7b3cSmrg 3145b7b3cSmrgCopyright 1988, 1998 The Open Group 4145b7b3cSmrg 5145b7b3cSmrgPermission to use, copy, modify, distribute, and sell this software and its 6145b7b3cSmrgdocumentation for any purpose is hereby granted without fee, provided that 7145b7b3cSmrgthe above copyright notice appear in all copies and that both that 8145b7b3cSmrgcopyright notice and this permission notice appear in supporting 9145b7b3cSmrgdocumentation. 10145b7b3cSmrg 11145b7b3cSmrgThe above copyright notice and this permission notice shall be included 12145b7b3cSmrgin all copies or substantial portions of the Software. 13145b7b3cSmrg 14145b7b3cSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15145b7b3cSmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16145b7b3cSmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17145b7b3cSmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 18145b7b3cSmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19145b7b3cSmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20145b7b3cSmrgOTHER DEALINGS IN THE SOFTWARE. 21145b7b3cSmrg 22145b7b3cSmrgExcept as contained in this notice, the name of The Open Group shall 23145b7b3cSmrgnot be used in advertising or otherwise to promote the sale, use or 24145b7b3cSmrgother dealings in this Software without prior written authorization 25145b7b3cSmrgfrom The Open Group. 26145b7b3cSmrg 27145b7b3cSmrg*/ 285ffd6003Smrg/* 294901b09eSmrg * Copyright (c) 2006, Oracle and/or its affiliates. 30145b7b3cSmrg * 31145b7b3cSmrg * Permission is hereby granted, free of charge, to any person obtaining a 325ffd6003Smrg * copy of this software and associated documentation files (the "Software"), 335ffd6003Smrg * to deal in the Software without restriction, including without limitation 345ffd6003Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 355ffd6003Smrg * and/or sell copies of the Software, and to permit persons to whom the 365ffd6003Smrg * Software is furnished to do so, subject to the following conditions: 37145b7b3cSmrg * 385ffd6003Smrg * The above copyright notice and this permission notice (including the next 395ffd6003Smrg * paragraph) shall be included in all copies or substantial portions of the 405ffd6003Smrg * Software. 41145b7b3cSmrg * 425ffd6003Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 435ffd6003Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 445ffd6003Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 455ffd6003Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 465ffd6003Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 475ffd6003Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 485ffd6003Smrg * DEALINGS IN THE SOFTWARE. 49145b7b3cSmrg */ 50145b7b3cSmrg 51145b7b3cSmrg/* 52145b7b3cSmrg * xdm - display manager daemon 53145b7b3cSmrg * Author: Keith Packard, MIT X Consortium 54145b7b3cSmrg */ 55145b7b3cSmrg 56145b7b3cSmrg 57145b7b3cSmrg#ifndef _XtLogin_h 58578741aaSmrg# define _XtLogin_h 59145b7b3cSmrg 60145b7b3cSmrg/*********************************************************************** 61145b7b3cSmrg * 62145b7b3cSmrg * Login Widget 63145b7b3cSmrg * 64145b7b3cSmrg ***********************************************************************/ 65145b7b3cSmrg 66145b7b3cSmrg/* Parameters: 67145b7b3cSmrg 68145b7b3cSmrg Name Class RepType Default Value 69145b7b3cSmrg ---- ----- ------- ------------- 70145b7b3cSmrg background Background pixel White 71145b7b3cSmrg border BorderColor pixel Black 72145b7b3cSmrg borderWidth BorderWidth int 1 73145b7b3cSmrg foreground Foreground Pixel Black 74145b7b3cSmrg height Height int 120 75145b7b3cSmrg mappedWhenManaged MappedWhenManaged Boolean True 76145b7b3cSmrg width Width int 120 77145b7b3cSmrg x Position int 0 78145b7b3cSmrg y Position int 0 79145b7b3cSmrg 80145b7b3cSmrg*/ 81145b7b3cSmrg 82145b7b3cSmrg# define XtNgreeting "greeting" 83145b7b3cSmrg# define XtNunsecureGreeting "unsecureGreeting" 84145b7b3cSmrg# define XtNnamePrompt "namePrompt" 85145b7b3cSmrg# define XtNpasswdPrompt "passwdPrompt" 86145b7b3cSmrg# define XtNfail "fail" 87145b7b3cSmrg# define XtNnotifyDone "notifyDone" 88145b7b3cSmrg# define XtNpromptColor "promptColor" 89145b7b3cSmrg# define XtNgreetColor "greetColor" 90145b7b3cSmrg# define XtNfailColor "failColor" 91145b7b3cSmrg# define XtNpromptFont "promptFont" 92145b7b3cSmrg# define XtNgreetFont "greetFont" 93145b7b3cSmrg# define XtNfailFont "failFont" 94145b7b3cSmrg# define XtNpromptFace "promptFace" 95145b7b3cSmrg# define XtNgreetFace "greetFace" 96145b7b3cSmrg# define XtNfailFace "failFace" 97145b7b3cSmrg# define XtNfailTimeout "failTimeout" 98145b7b3cSmrg# define XtNsessionArgument "sessionArgument" 99145b7b3cSmrg# define XtNsecureSession "secureSession" 100145b7b3cSmrg# define XtNallowAccess "allowAccess" 101145b7b3cSmrg# define XtNallowNullPasswd "allowNullPasswd" 102145b7b3cSmrg# define XtNallowRootLogin "allowRootLogin" 1035ffd6003Smrg# define XtNechoPasswd "echoPasswd" 104629baa8cSmrg# define XtNechoPasswdChar "echoPasswdChar" 105145b7b3cSmrg 106145b7b3cSmrg# define XtNface "face" 107145b7b3cSmrg# define XtCFace "Face" 108145b7b3cSmrg# define XtRXftFont "XftFont" 109145b7b3cSmrg# define XtRXftColor "XftColor" 110145b7b3cSmrg 111145b7b3cSmrg/* added by Amit Margalit Oct 1996 */ 112145b7b3cSmrg# define XtNhiColor "hiColor" 113145b7b3cSmrg# define XtNshdColor "shdColor" 114b7d26471Smrg# define XtNinpColor "inpColor" 115145b7b3cSmrg# define XtNframeWidth "frameWidth" 116145b7b3cSmrg# define XtCFrameWidth "FrameWidth" 117145b7b3cSmrg# define XtNinnerFramesWidth "innerFramesWidth" 118145b7b3cSmrg# define XtNsepWidth "sepWidth" 119145b7b3cSmrg 120578741aaSmrg# ifdef DANCING 121145b7b3cSmrg/* caolan begin */ 122578741aaSmrg# define XtNlastEventTime "lastEventTime" 123578741aaSmrg# define XtCLastEventTime "LastEventTime" 124145b7b3cSmrg/* caolan end */ 125578741aaSmrg# endif /* DANCING */ 126145b7b3cSmrg 127578741aaSmrg# ifdef XPM 128578741aaSmrg# define XtNuseShape "useShape" 129578741aaSmrg# define XtCUseShape "UseShape" 130578741aaSmrg# define XtNlogoFileName "logoFileName" 131578741aaSmrg# define XtCLogoFileName "LogoFileName" 132578741aaSmrg# define XtNlogoPadding "logoPadding" 133578741aaSmrg# define XtCLogoPadding "LogoPadding" 134578741aaSmrg# endif /* XPM */ 135145b7b3cSmrg 136145b7b3cSmrg# define XtCGreeting "Greeting" 137145b7b3cSmrg# define XtCNamePrompt "NamePrompt" 138145b7b3cSmrg# define XtCPasswdPrompt "PasswdPrompt" 139145b7b3cSmrg# define XtCFail "Fail" 140145b7b3cSmrg# define XtCFailTimeout "FailTimeout" 141145b7b3cSmrg# define XtCSessionArgument "SessionArgument" 142145b7b3cSmrg# define XtCSecureSession "SecureSession" 143145b7b3cSmrg# define XtCAllowAccess "AllowAccess" 144145b7b3cSmrg# define XtCAllowNullPasswd "AllowNullPasswd" 145145b7b3cSmrg# define XtCAllowRootLogin "AllowRootLogin" 1465ffd6003Smrg# define XtCEchoPasswd "EchoPasswd" 147629baa8cSmrg# define XtCEchoPasswdChar "EchoPasswdChar" 148145b7b3cSmrg 149145b7b3cSmrg# define XtNchangePasswdMessage "changePasswdMessage" 150145b7b3cSmrg# define XtCChangePasswdMessage "ChangePasswdMessage" 151145b7b3cSmrg 152145b7b3cSmrg/* notifyDone interface definition */ 153145b7b3cSmrg 154578741aaSmrg# ifdef __OpenBSD__ 155578741aaSmrg# include <sys/param.h> 156578741aaSmrg# endif 157145b7b3cSmrg 158578741aaSmrg# include <pwd.h> 159578741aaSmrg# include <limits.h> 160145b7b3cSmrg 161578741aaSmrg# ifdef USE_PAM 162578741aaSmrg# define NAME_LEN PAM_MAX_RESP_SIZE 163578741aaSmrg# define PASSWORD_LEN PAM_MAX_RESP_SIZE 164578741aaSmrg# endif 165145b7b3cSmrg 166145b7b3cSmrg/* Defined to be in <limits.h> by SUSv2 */ 167578741aaSmrg# if !defined(PASSWORD_LEN) && defined(PASS_MAX) 168578741aaSmrg# define PASSWORD_LEN PASS_MAX 169578741aaSmrg# endif 170145b7b3cSmrg 171145b7b3cSmrg/* _PW_NAME_LEN is found in <pwd.h> on OpenBSD > 2.8 (200012) */ 172578741aaSmrg# if !defined(NAME_LEN) && defined(_PW_NAME_LEN) 173578741aaSmrg# define NAME_LEN (_PW_NAME_LEN + 2) 174578741aaSmrg# endif 175145b7b3cSmrg 176145b7b3cSmrg/* _PASSWORD_LEN appears to come from 4.4BSD-Lite <pwd.h> */ 177578741aaSmrg# if !defined(PASSWORD_LEN) && defined(_PASSWORD_LEN) 178578741aaSmrg# define PASSWORD_LEN (_PASSWORD_LEN + 2) 179578741aaSmrg# endif 180145b7b3cSmrg 181145b7b3cSmrg/* Fallbacks if no other definition found */ 182578741aaSmrg# ifndef NAME_LEN 183578741aaSmrg# define NAME_LEN 32 184578741aaSmrg# endif 185145b7b3cSmrg 186578741aaSmrg# ifndef PASSWORD_LEN 187578741aaSmrg# define PASSWORD_LEN 32 188578741aaSmrg# endif 189145b7b3cSmrg 190578741aaSmrgtypedef struct _LoginData { 191145b7b3cSmrg char name[NAME_LEN], passwd[PASSWORD_LEN]; 192145b7b3cSmrg} LoginData; 193145b7b3cSmrg 194145b7b3cSmrg# define NOTIFY_OK 0 195145b7b3cSmrg# define NOTIFY_ABORT 1 196145b7b3cSmrg# define NOTIFY_RESTART 2 197145b7b3cSmrg# define NOTIFY_ABORT_DISPLAY 3 198145b7b3cSmrg 199145b7b3cSmrgtypedef struct _LoginRec *LoginWidget; /* completely defined in LoginPrivate.h */ 200145b7b3cSmrgtypedef struct _LoginClassRec *LoginWidgetClass; /* completely defined in LoginPrivate.h */ 201145b7b3cSmrg 202145b7b3cSmrgextern WidgetClass loginWidgetClass; 203145b7b3cSmrg 204145b7b3cSmrgextern void ErrorMessage(Widget ctx, const char *message, Bool timeout); 205145b7b3cSmrgextern void ShowChangePasswdMessage(Widget ctx); 206145b7b3cSmrg 207145b7b3cSmrgtypedef enum { 208145b7b3cSmrg LOGIN_PROMPT_NOT_SHOWN, /* Neither prompt nor input shown */ 209145b7b3cSmrg LOGIN_PROMPT_ECHO_ON, /* Both prompt and input shown */ 210145b7b3cSmrg LOGIN_PROMPT_ECHO_OFF, /* Prompt shown, input accepted but not 211145b7b3cSmrg shown (bullets may be shown instead) */ 212145b7b3cSmrg LOGIN_TEXT_INFO /* Prompt shown, no input area */ 213145b7b3cSmrg} loginPromptState; 214145b7b3cSmrg 215145b7b3cSmrg/* Default prompt meanings for simple username/password auth systems */ 216578741aaSmrg# define LOGIN_PROMPT_USERNAME 0 217578741aaSmrg# define LOGIN_PROMPT_PASSWORD 1 218145b7b3cSmrg 219145b7b3cSmrgextern int SetPrompt(Widget ctx, int promptId, const char *message, 220145b7b3cSmrg loginPromptState state, Boolean minimumTime); 221145b7b3cSmrgextern const char *GetPrompt(Widget ctx, int promptId); 222145b7b3cSmrg 2234901b09eSmrgextern int SetValue(Widget ctx, int promptId, const char *value); 224145b7b3cSmrgextern const char *GetValue(Widget ctx, int promptId); 225145b7b3cSmrg 226145b7b3cSmrg#endif /* _XtLogin_h */ 227145b7b3cSmrg/* DON'T ADD STUFF AFTER THIS #endif */ 228