From c4548efce3cdaf3de7fc4b52822ec1b64bfb01fc Mon Sep 17 00:00:00 2001 From: mathias Date: Tue, 19 Sep 2006 21:54:40 +0000 Subject: [PATCH] * fixed #3, builtsystem didnt use 'shadow' --HG-- extra : convert_revision : svn%3Aeebe1cee-a9af-4fe4-bd26-ad572b19c5ab/trunk%4055 --- CHANGELOG.txt | 4 ++++ Makefile | 15 +++++++++++++-- configure | 1 + src/auth_passwd.c | 24 ++++++++++++------------ 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ede059e..74c911f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ Version 1.0 ---------------------------------------------------------------------- +2006-09-19: + * fixed #3, buildsystem doesnt built with shadow-support + * added missing xcursors, updated docs + 2006-09-18: * fixed #2, missing includes in Xrender check * fixed --enable-imlib2 wasnt implying --enable-xrender diff --git a/Makefile b/Makefile index c985ac4..b188b13 100644 --- a/Makefile +++ b/Makefile @@ -36,12 +36,23 @@ install : alock $(DESTDIR)$(prefix)/share/alock/bitmaps/ chmod 444 $(DESTDIR)$(prefix)/share/alock/xcursors/* chmod 444 $(DESTDIR)$(prefix)/share/alock/bitmaps/* - cp -fv README LICENSE CHANGELOG \ + cp -fv README.txt LICENSE.txt CHANGELOG.txt \ $(DESTDIR)$(prefix)/share/alock/ chmod 444 $(DESTDIR)$(prefix)/share/alock/README.txt chmod 444 $(DESTDIR)$(prefix)/share/alock/LICENSE.txt chmod 444 $(DESTDIR)$(prefix)/share/alock/CHANGELOG.txt - + @if `src/alock -auth list | grep passwd > /dev/null`; then \ + echo ",-------------------------------------------------,"; \ + echo "| it seems that you have compiled 'alock' with |"; \ + echo "| 'shadow' support. to use that binary you have |"; \ + echo "| set the 'suid' - bit, something like: |"; \ + echo "| |"; \ + echo "| $$> chown root:root \$$prefix/bin/alock |";\ + echo "| $$> chmod 4111 \$$prefix/bin/alock |";\ + echo "| |"; \ + echo "| if not you ll get 'permission denied' problems. |"; \ + echo "\`-------------------------------------------------'";\ + fi alock : $(MAKE) -C src diff --git a/configure b/configure index 5c8c984..a7eede7 100755 --- a/configure +++ b/configure @@ -266,6 +266,7 @@ check_passwd() { echo "configure for passwd." echo "#_______________________" >&4 echo "WITH_PASSWD:=1" >&4 + echo "CFLAGS_PASSWD:=-DHAVE_SHADOW" >&4 echo "LIBS_PASSWD=-lcrypt" >&4 echo "" >&4 } diff --git a/src/auth_passwd.c b/src/auth_passwd.c index 05cead5..9b28638 100644 --- a/src/auth_passwd.c +++ b/src/auth_passwd.c @@ -35,9 +35,9 @@ #include #include -#ifdef SHADOW_PWD +#ifdef HAVE_SHADOW # include -#endif /* SHADOW_PWD */ +#endif /* HAVE_SHADOW */ #include "alock.h" @@ -48,10 +48,6 @@ static struct passwd* pwd_entry = NULL; static int alock_auth_passwd_init(const char* args) { -#ifdef SHADOW_PWD - struct spwd* sp = NULL; -#endif - errno = 0; pwd_entry = getpwuid(getuid()); if (!pwd_entry) { @@ -59,11 +55,15 @@ static int alock_auth_passwd_init(const char* args) { return 0; } -#ifdef SHADOW_PWD - sp = getspnam(pwd_entry->pw_name); - if (sp) - pwd_entry->pw_passwd = sp->sp_pwdp; - endspent(); +#ifdef HAVE_SHADOW + { + struct spwd* sp = NULL; + + sp = getspnam(pwd_entry->pw_name); + if (sp) + pwd_entry->pw_passwd = sp->sp_pwdp; + + } #endif /* we can be installed setuid root to support shadow passwords, @@ -74,7 +74,7 @@ static int alock_auth_passwd_init(const char* args) { perror("password entry has no pwd\n"); return 0; } - + return 1; }