summaryrefslogtreecommitdiff
path: root/greeter
AgeCommit message (Collapse)AuthorFilesLines
2020-11-01Greeter: add parens to DRAW_STRING & TEXT_WIDTH macros for safetyAlan Coopersmith1-2/+2
Oracle Parfait static analyser points out it wasn't clear if cast or arithmetic operation in arguments at lines 410, 416, 431, & 433 was intended to be done first, so we'll make it explicit. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-07-21Fix spelling/wording issuesAlan Coopersmith1-1/+1
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-12-21Remove AIXV3, SCO, Unixware, OS/2 supportMatthieu Herrb1-96/+1
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-03-15Allow the greeter to set the input fields bg colorMatthieu Herrb3-6/+23
A new 'inpColor' resource is added for that. Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-02-23Link libXdmGreet with -no-undefined libtool flagJon TURNEY1-1/+1
"Use -no-undefined to assure libtool that the library has no unresolved symbols at link time, so that libtool will build a shared library on platforms that require that all symbols are resolved when the library is linked." With a recent libtool (since 2.4.5 or so), "can't build <target> shared library unless -no-undefined is specified" is an error, rather than a warning, if ./configure'd --enable-shared. http://tinderbox.x.org/builds/2015-02-22-0009/logs/app-xdm/#build Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-07-08Use appropriate format string.Thomas Klausner1-1/+1
Fixes clang warning: format specifies type 'int' but the argument has type 'unsigned long' Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-06-07Handle NULL returns from glibc 2.17+ crypt().mancha1-1/+4
Starting with glibc 2.17 (eglibc 2.17), crypt() fails with EINVAL (w/ NULL return) if the salt violates specifications. Additionally, on FIPS-140 enabled Linux systems, DES/MD5-encrypted passwords passed to crypt() fail with EPERM (w/ NULL return). If using glibc's crypt(), check return value to avoid a possible NULL pointer dereference. Reviewed-by: Matthieu Herrb <matthieu@herrb.eu> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Notes: Fixes CVE-2013-2179
2013-01-24Look for pam in both pam/ and security/ pathsJeremy Huddleston Sequoia1-1/+0
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2011-12-15replace <varargs.h> by <stdarg.h>. Spotted my Marco Peereboom with clang.Matthieu Herrb1-1/+1
Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-10-22greeter: link against -lXrender if xft is enabledJulien Cristau1-0/+4
XmuCvtStringToXftColor uses XRenderParseColor, so require xrender for the xft option, and link against it. Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-28Mark some chars as const to fix gcc -Wwrite-strings warningsAlan Coopersmith2-5/+5
Can't fix all the warnings, due to the Xt API, but can fix a bunch. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-20fix whitespace issuesAlan Coopersmith4-29/+29
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' find * -type f | xargs perl -i -p -e 's{^[ ]+\t}{\t}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-07Simplify FailedLogin codeAlan Coopersmith1-27/+23
Relies on username going out of scope to discard the pointer returned by pam_get_item that pam_end frees at the bottom of the loop. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07Stop using username retrieved from PAM before pam_end frees it.Alan Coopersmith1-0/+4
The first time a failed login message was syslogged it had the right username, but subsequent ones kept reusing that pointer, even though PAM had freed it and it may have been reused and filled with something else, resulting in garbage user names for the later login failures. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07Use C99 named initializers for XSetWindowAttributes structureAlan Coopersmith1-4/+4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-07Bug 13455: allowNullPasswd: true doesn't work until the second login attemptAlan Coopersmith1-4/+9
Assign allow_null_passwd and allow_root_login variables' values before call to pam_authenticate() https://bugs.freedesktop.org/show_bug.cgi?id=13455 Based on a fix suggested by: Tim Shumakov <ars_1@mail.ru> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-27On Solaris, make sure PAM_TTY is only ever set to an actual /dev pathAlan Coopersmith1-2/+19
Solaris PAM & auditing insist this is a device file that can be found in the filesystem, so we can't use the display name (":0") like we've been doing (and continue to do on other OS'es). Fixes Solaris bug 6960231: xdm login fails with: pam_unix_cred: cannot load ttyname with c2audit loaded Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-21greeter: Make sure cursor stays in bounds tooAlan Coopersmith1-2/+9
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-21greeter: Replace several #ifdef XPM blocks with LOGO_W macroAlan Coopersmith1-26/+13
Refactor code assuming compiler is smart enough to optimize out any that reduce to + 0 or - 0 if building without XPM defined. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-21greeter: Make sure text input areas stay inside the linesAlan Coopersmith1-6/+3
Regression introduced by f8585c60831a8e5ddebce18bdd7e78d217a822c5 broke bounds checking for text displayed in input fields. Since this makes each TEXT_WIDTH value only be used once, just use them directly instead of storing the result in a variable. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-21greeter: Add echoPasswdChar resource to set character to displayAlan Coopersmith3-12/+18
Stop hardcoding it to '*'. Allows setting a resource with no value to to advance the cursor without drawing text (as was previously the default). Resolves https://bugs.freedesktop.org/show_bug.cgi?id=32794 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-21greeter: inline valueMask for xpm window to avoid shadowing argumentAlan Coopersmith1-2/+1
The Realize function names one of its arguments valueMask, and the valueMask variable in the inner scope is just used as a static set of mask flags, so just pass them directly to the function to reduce confusion and clear the gcc -Wshadow warning: Login.c: In function `Realize': Login.c:1901: warning: declaration of 'valueMask' shadows a parameter Login.c:1871: warning: shadowed declaration is here Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-21greeter: Remove unused extern dpy that is shadowed by local variablesAlan Coopersmith1-2/+0
Resolves these warnings from gcc -Wshadow: greet.c: In function `InitGreet': greet.c:244: warning: declaration of 'dpy' shadows a global declaration greet.c:146: warning: shadowed declaration is here greet.c: In function `CloseGreet': greet.c:326: warning: declaration of 'dpy' shadows a global declaration greet.c:146: warning: shadowed declaration is here greet.c: At top level: greet.c:431: warning: declaration of 'dpy' shadows a global declaration greet.c:146: warning: shadowed declaration is here Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2010-11-24config: move common headers into the include directoryGaetan Nadon1-1/+2
They provide interfaces to multiple executables Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-10-26config: use AC_CHECK_FUNCS for mkstemp, getifaddrs and getspnamGaetan Nadon2-6/+6
Using AC_CHECK_FUNCS defines HAVE_xxx macro in config.h following a consistent naming convention. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-08-31greeter: transfer -DGREET_LIB from configure.ac to Makefile.amGaetan Nadon1-1/+1
It does not depend on module configuration. It should not mixed with flags required by dependencies. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-08-31greeter: only build the shared library versionGaetan Nadon2-7/+2
There is no evidence that the static version is needed since monolith as hinted by the comment in configure.ac. The greeter code is now all managed by the greeter Makefile. The configure option enable-dynamic-greeter no longer needed. GREET_USER_STATIC is no longer needed. GREET_LIB is still needed in greet.h as it is compiled with both session.c for xdm execuatable and greeter shared lib. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2010-04-12s/Sun/Oracle/gAlan Coopersmith4-4/+4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-12Check for allowRootLogin on PAM and non-OpenBSD passwd authentication backendsAlan Coopersmith2-6/+12
http://bugs.freedesktop.org/show_bug.cgi?id=25112 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-03-16Reject PAM conversation calls after login dialog is closedAlan Coopersmith1-0/+7
Based on patch suggested by Bjoern A. Zeeb <bzeeb+patch@zabbadoz.net> to fix http://bugs.freedesktop.org/show_bug.cgi?id=10522 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-03-16Make sure username is not NULL when calling syslog from FailedLogin()Alan Coopersmith1-1/+6
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-03-15echo_passwd should key off PAM no-echo state, not prompt positionAlan Coopersmith1-4/+4
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-03-15Adding an option to show stars instead of the password itself.Georgy A. Shepelev4-10/+54
The behaviour can be controlled via 'xlogin*echoPasswd' option in Xresource file. The default option value is 'false'. Signed-off-by: Georgy A. Shepelev <shepelev.georgy@googlemail.com> Tested-by: Georgy A. Shepelev <shepelev.georgy@googlemail.com> [Reformatted to match existing code style by Alan Coopersmith] Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-01-15Update Sun license notices to current X.Org standard formAlan Coopersmith4-88/+68
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-01-12greeter: fix logging of failed login attemptsDmitry V. Levin1-1/+1
When PAM rejects a login attempt, the "username" variable remains uninitialized, which results to garbage being syslogged instead of login name. Explicit initialization helps to avoid this issue. Fixes FreeDesktop Bug #26015 <https://bugs.freedesktop.org/show_bug.cgi?id=26015> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2010-01-12Remove workaround for X11R3 server bugAlan Coopersmith1-14/+2
The comment promised 'compatibility until at least R4', so we're 20 years past due for removing this. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-01-12Call openlog(3) earlyDmitry V. Levin1-3/+0
Before this change, openlog(3) used to be called by greeter which could be built as a dynamically loadable plugin. In the latter case, the ident string passed to openlog(3) resides in a dynamically mapped memory region that is unmapped later when the plugin is unloaded. This can cause fatal problems in some environments. For example, in any GNU/Linux system with PAM support enabled an implicit syslog(3) call made by a PAM module after plugin unload causes attempt to access already unmapped memory, followed by instant crash. It is a common practice to call openlog(3) before the first syslog(3) call, including implicit calls that could be made e.g. by PAM. Also, openlog(3) LOG_ODELAY flag is redundant. Fixes ALT Linux Bug #22362 <https://bugzilla.altlinux.org/show_bug.cgi?id=22362> Fixes FreeDesktop Bug #24589 <https://bugs.freedesktop.org/show_bug.cgi?id=24589> Reported-by: Martin Mokrejš <mmokrejs@ribosome.natur.cuni.cz> Reported-by: Denis Kirienko <dk@altlinux.org> Patch-by: Oleg Zenin <tt@compas.ihep.su> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-10-22.gitignore: use common defaults with custom section # 24239Gaetan Nadon1-7/+0
Using common defaults will reduce errors and maintenance. Only the very small or inexistent custom section need periodic maintenance when the structure of the component changes. Do not edit defaults.
2009-09-22Debian bug 525596: "Login incorrect" only partially cleared on next loginMartin Dickopp1-2/+2
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525596 Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-22The whole widget borders width could not be set to zero.Georgy A. Shepelev1-2/+2
Signed-off-by: Georgy A. Shepelev <shepelev.georgy@googlemail.com> Tested-by: Georgy A. Shepelev <shepelev.georgy@googlemail.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-17Refactor & constify error logging codeAlan Coopersmith1-3/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-09-11Update to using xorg-macros 1.3, including XORG_DEFAULT_OPTIONSAlan Coopersmith1-3/+2
Also move CWARNFLAGS addition to CFLAGS from configure.ac to Makefile.am's Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-07-28Do a better job of getting user name for failed login log when using PAMAlan Coopersmith1-1/+10
Check to see if username is filled in before calling FailedError, and fill it in if it's not. Call FailedError before calling pam_end, so we don't reference a username that may have been freed already. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-07-17Use xdm's _SysErrorMsg() function instead of merely printing errnoBranden Robinson1-1/+1
2009-07-17Use imdent to show cpp macro nesting more clearlyAlan Coopersmith5-302/+302
Also strip trailing whitespace to make git happier. While many lines are changes, "git diff -w" shows no changes other than pure whitespace. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-07-17sprintf -> snprintf/asprintf conversionsAlan Coopersmith1-1/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-07-17Replace FORCE_CURSOR_FLASH code with simpler cursor update for passwd fieldAlan Coopersmith1-35/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-07-16Remove RCS IdsAlan Coopersmith6-16/+0
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-01-20Ansification and compile warning fixes.Paulo Cesar Pereira de Andrade2-3/+6
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects make distcheck and most gcc 4.3 and sparse warnings. Remaining warning is due to passing read or write as function pointers in the format ssize_t (*)(int, void *, size_t), as it is const for write, but not for read.
2008-09-09Add support for syslog on more than openbsd.Julien Cristau1-6/+11
Also use LOG_AUTHPRIV by default, if that exists.