@ -0,0 +1,20 @@ |
|||
allow empty passwords (shadow-lookup only when 'x' found.) |
|||
(patch thankfully copied from T2) |
|||
|
|||
|
|||
--- fgetty-0.6/checkpassword.c 2001-09-10 12:35:12.000000000 +0200
|
|||
+++ fgetty-0.6/checkpassword.c 2005-02-08 20:23:32.391861824 +0100
|
|||
@@ -36,9 +36,11 @@
|
|||
login=buf; |
|||
if ((pw=getpwnam(login))) { |
|||
passwd=pw->pw_passwd; |
|||
- if ((spw=getspnam(login)))
|
|||
+ if (!strcmp(passwd, "x") && (spw=getspnam(login)))
|
|||
passwd=spw->sp_pwdp; |
|||
- if (*passwd && !strcmp(crypt(ptr=login+strlen(login)+1,passwd),passwd)) {
|
|||
+ ptr=login+strlen(login)+1;
|
|||
+ if (*passwd == 0 || !strcmp(crypt(ptr,passwd),passwd)) {
|
|||
+ puts("password checked\n");
|
|||
char **env,**ep; |
|||
char buf[100]; |
|||
for (len=0; environ[len]; ++len) ; |
@ -1,30 +0,0 @@ |
|||
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
|||
# |
|||
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|||
# Please add additional copyright information _after_ the line containing |
|||
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
|||
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
|||
# |
|||
# ROCK Linux: rock-src/package/hannes/fgetty/makefile-head.patch |
|||
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf |
|||
# |
|||
# This patch file is dual-licensed. It is available under the license the |
|||
# patched project is licensed under, as long as it is an OpenSource license |
|||
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms |
|||
# of the GNU General Public License as published by the Free Software |
|||
# Foundation; either version 2 of the License, or (at your option) any later |
|||
# version. |
|||
# |
|||
# --- ROCK-COPYRIGHT-NOTE-END --- |
|||
|
|||
--- ./Makefile.orig 2004-09-12 02:53:24.459941776 +0200
|
|||
+++ ./Makefile 2004-09-12 02:53:33.201612840 +0200
|
|||
@@ -46,7 +46,7 @@
|
|||
%.sig: % |
|||
gpg --detach-sign $< |
|||
|
|||
-VERSION=fgetty-$(shell head -1 CHANGES|sed 's/://')
|
|||
+VERSION=fgetty-$(shell head -n 1 CHANGES|sed 's/://')
|
|||
CURNAME=$(notdir $(shell pwd)) |
|||
|
|||
tar: clean rename |
@ -0,0 +1,47 @@ |
|||
cleanup makefile - use CC and STRIP macros |
|||
|
|||
diff -Naur fgetty-0.6-orig/Makefile fgetty-0.6/Makefile
|
|||
--- fgetty-0.6-orig/Makefile 2002-01-24 02:35:22.000000000 +0100
|
|||
+++ fgetty-0.6/Makefile 2007-07-13 18:26:33.202255084 +0200
|
|||
@@ -5,18 +5,20 @@
|
|||
all: fgetty login login2 checkpassword |
|||
|
|||
DIET=diet |
|||
+CC=gcc
|
|||
+STRIP=strip
|
|||
#CROSS=arm-linux- |
|||
CROSS= |
|||
LDFLAGS=-s |
|||
|
|||
%.o: %.c |
|||
# gcc -march=i386 -mcpu=i386 -pipe -Os -fomit-frame-pointer -I../dietlibc/include -c $^ -DTEST |
|||
- $(DIET) $(CROSS)gcc -pipe -Os -fomit-frame-pointer -I../dietlibc/include -c $^ -DTEST
|
|||
+ $(DIET) $(CROSS)$(CC) -pipe -Os -fomit-frame-pointer -I../dietlibc/include -c $^ -DTEST
|
|||
# gcc -march=i386 -mcpu=i386 -pipe -g -I../dietlibc/include -DTEST -c $^ |
|||
- strip -x -R .comment -R .note $@
|
|||
+ $(CROSS)$(STRIP) -x -R .comment -R .note $@
|
|||
|
|||
%: %.o |
|||
- $(DIET) $(CROSS)gcc -nostdlib -o $@ $^ $(LDFLAGS)
|
|||
+ $(DIET) $(CROSS)$(CC) -nostdlib -o $@ $^ $(LDFLAGS)
|
|||
|
|||
fgetty: fgetty.o fmt_ulong.o |
|||
|
|||
@@ -25,7 +27,7 @@
|
|||
checkpassword: checkpassword.o |
|||
|
|||
debug: fgetty.c fmt_ulong.o |
|||
- gcc -g -o debug fgetty.c fmt_ulong.o -DDEBUG
|
|||
+ $(CROSS)$(CC) -g -o debug fgetty.c fmt_ulong.o -DDEBUG
|
|||
|
|||
install: |
|||
install -d $(DESTDIR)/bin $(DESTDIR)/sbin |
|||
@@ -46,7 +48,7 @@
|
|||
%.sig: % |
|||
gpg --detach-sign $< |
|||
|
|||
-VERSION=fgetty-$(shell head -1 CHANGES|sed 's/://')
|
|||
+VERSION=fgetty-$(shell head -n 1 CHANGES|sed 's/://')
|
|||
CURNAME=$(notdir $(shell pwd)) |
|||
|
|||
tar: clean rename |
@ -0,0 +1,101 @@ |
|||
some adaptions for building without dietlibc |
|||
(parts of this patch thankfully copied from T2) |
|||
|
|||
diff -Naur fgetty-0.6~/Makefile fgetty-0.6/Makefile |
|||
--- fgetty-0.6~/Makefile 2007-07-13 18:31:21.014218873 +0200 |
|||
+++ fgetty-0.6/Makefile 2007-07-13 18:31:26.784158037 +0200 |
|||
@@ -9,7 +9,7 @@ |
|||
STRIP=strip |
|||
#CROSS=arm-linux- |
|||
CROSS= |
|||
-LDFLAGS=-s |
|||
+LDFLAGS=-s -lcrypt |
|||
|
|||
%.o: %.c |
|||
# gcc -march=i386 -mcpu=i386 -pipe -Os -fomit-frame-pointer -I../dietlibc/include -c $^ -DTEST |
|||
@@ -18,11 +18,11 @@ |
|||
$(CROSS)$(STRIP) -x -R .comment -R .note $@ |
|||
|
|||
%: %.o |
|||
- $(DIET) $(CROSS)$(CC) -nostdlib -o $@ $^ $(LDFLAGS) |
|||
+ $(DIET) $(CROSS)$(CC) -o $@ $^ $(LDFLAGS) |
|||
|
|||
fgetty: fgetty.o fmt_ulong.o |
|||
|
|||
-login: login.o |
|||
+login: login.o ltostr.o |
|||
login2: login2.o |
|||
checkpassword: checkpassword.o |
|||
|
|||
diff -Naur fgetty-0.6~/fgetty.c fgetty-0.6/fgetty.c |
|||
--- fgetty-0.6~/fgetty.c 2007-07-13 18:31:21.013218883 +0200 |
|||
+++ fgetty-0.6/fgetty.c 2007-07-13 18:31:26.783158047 +0200 |
|||
@@ -10,6 +10,7 @@ |
|||
#include <sys/ioctl.h> |
|||
#include <errno.h> |
|||
#include <termios.h> |
|||
+#include <time.h> |
|||
|
|||
#include "fmt.h" |
|||
|
|||
diff -Naur fgetty-0.6~/login.c fgetty-0.6/login.c |
|||
--- fgetty-0.6~/login.c 2007-07-13 18:31:21.013218883 +0200 |
|||
+++ fgetty-0.6/login.c 2007-07-13 18:32:05.155753351 +0200 |
|||
@@ -36,6 +36,8 @@ |
|||
#include <fcntl.h> |
|||
#include <signal.h> |
|||
|
|||
+extern char **environ; |
|||
+ |
|||
void die(const char *message) { |
|||
write(2,message,strlen(message)); |
|||
write(2,"\n",1); |
|||
@@ -116,7 +118,7 @@ |
|||
int len; |
|||
len=strlen(username)+1; |
|||
strcpy(buf,username); |
|||
- strlcpy(buf+len,password,512-len); |
|||
+ strncpy(buf+len,password,512-len); |
|||
len+=strlen(password)+1; |
|||
/* buf[len++]='Y'; */ |
|||
len+=__ltostr(buf+len,512-len,time(0),10,0); |
|||
diff -Naur fgetty-0.6~/ltostr.c fgetty-0.6/ltostr.c |
|||
--- fgetty-0.6~/ltostr.c 1970-01-01 01:00:00.000000000 +0100 |
|||
+++ fgetty-0.6/ltostr.c 2007-07-13 18:31:26.784158037 +0200 |
|||
@@ -0,0 +1,36 @@ |
|||
+#include <string.h> |
|||
+#include <stdlib.h> |
|||
+ |
|||
+#ifndef __dietlibc__ |
|||
+ |
|||
+int __ltostr(char *s, unsigned int size, unsigned long i, unsigned int base, int UpCase) |
|||
+{ |
|||
+ char *tmp; |
|||
+ unsigned int j=0; |
|||
+ |
|||
+ s[--size]=0; |
|||
+ |
|||
+ tmp=s+size; |
|||
+ |
|||
+ if ((base==0)||(base>36)) base=10; |
|||
+ |
|||
+ j=0; |
|||
+ if (!i) |
|||
+ { |
|||
+ *(--tmp)='0'; |
|||
+ j=1; |
|||
+ } |
|||
+ |
|||
+ while((tmp>s)&&(i)) |
|||
+ { |
|||
+ tmp--; |
|||
+ if ((*tmp=i%base+'0')>'9') *tmp+=(UpCase?'A':'a')-'9'-1; |
|||
+ i=i/base; |
|||
+ j++; |
|||
+ } |
|||
+ memmove(s,tmp,j+1); |
|||
+ |
|||
+ return j; |
|||
+} |
|||
+ |
|||
+#endif |