Dash:
[t2.git] / package / base / fgetty / checkpassword.patch
blob56207cd8cf56f946b737affccf7dc4c53bb2527c
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../fgetty/checkpassword.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 Only use shadow passwords if the passsword is marked with an x and allow
18 empty passwords. (So PDA users do not need to log in ...)
20 - Rene Rebe <rene@exactcode.de>
22 --- fgetty-0.6/checkpassword.c 2001-09-10 12:35:12.000000000 +0200
23 +++ fgetty-0.6/checkpassword.c 2005-02-08 20:23:32.391861824 +0100
24 @@ -36,9 +36,11 @@
25 login=buf;
26 if ((pw=getpwnam(login))) {
27 passwd=pw->pw_passwd;
28 - if ((spw=getspnam(login)))
29 + if (!strcmp(passwd, "x") && (spw=getspnam(login)))
30 passwd=spw->sp_pwdp;
31 - if (*passwd && !strcmp(crypt(ptr=login+strlen(login)+1,passwd),passwd)) {
32 + ptr=login+strlen(login)+1;
33 + if (*passwd == 0 || !strcmp(crypt(ptr,passwd),passwd)) {
34 + puts("password checked\n");
35 char **env,**ep;
36 char buf[100];
37 for (len=0; environ[len]; ++len) ;