diff --git a/package/hannes/fgetty/checkpassword.patch b/package/hannes/fgetty/checkpassword.patch new file mode 100644 index 000000000..8c6166208 --- /dev/null +++ b/package/hannes/fgetty/checkpassword.patch @@ -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) ; diff --git a/package/hannes/fgetty/fgetty.conf b/package/hannes/fgetty/fgetty.conf index 4406dd198..a40d4367e 100644 --- a/package/hannes/fgetty/fgetty.conf +++ b/package/hannes/fgetty/fgetty.conf @@ -20,4 +20,19 @@ # # --- ROCK-COPYRIGHT-NOTE-END --- +fgetty_no_diet="" + var_append makeinstopt ' ' "DESTDIR=$root/" +var_append makeopt ' ' "CROSS=" + +if [ "$stagelevel" -le 1 ] && [ "$ROCKCFG_CROSSBUILD" -eq 1 ]; then + fgetty_no_diet="1" +fi + +pkginstalled dietlibc || fgetty_no_diet="2" + +if [ -n "$fgetty_no_diet" ]; then + var_append patchfiles ' ' $confdir/no-diet-please.patch_noauto + var_append makeopt ' ' "DIET=" +fi + diff --git a/package/hannes/fgetty/fgetty.desc b/package/hannes/fgetty/fgetty.desc index 2ea4d5d18..008316c02 100644 --- a/package/hannes/fgetty/fgetty.desc +++ b/package/hannes/fgetty/fgetty.desc @@ -28,7 +28,7 @@ [U] http://www.fefe.de/fgetty/ [A] Felix von Leitner -[M] hannes +[M] Tobias Hintze [C] base/system [F] DIETLIBC @@ -36,6 +36,6 @@ [L] GPL [S] Stable [V] 0.6 -[P] X -?---5---9 201.500 +[P] X -X---5---9 201.500 [D] 2033114438 fgetty-0.6.tar.bz2 http://www.fefe.de/fgetty/ diff --git a/package/hannes/fgetty/makefile-head.patch b/package/hannes/fgetty/makefile-head.patch deleted file mode 100644 index f324ffb28..000000000 --- a/package/hannes/fgetty/makefile-head.patch +++ /dev/null @@ -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 diff --git a/package/hannes/fgetty/makefile.patch b/package/hannes/fgetty/makefile.patch new file mode 100644 index 000000000..3bf5952fc --- /dev/null +++ b/package/hannes/fgetty/makefile.patch @@ -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 diff --git a/package/hannes/fgetty/no-diet-please.patch_noauto b/package/hannes/fgetty/no-diet-please.patch_noauto new file mode 100644 index 000000000..2383256e0 --- /dev/null +++ b/package/hannes/fgetty/no-diet-please.patch_noauto @@ -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 + #include + #include ++#include + + #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 + #include + ++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 ++#include ++ ++#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