[prev in list] [next in list] [prev in thread] [next in thread]
List: uclinux-dev
Subject: [uClinux-dev] [PATCH] Using shadow passwords in Tinylogin with ftpd
From: Peter Turczak <peter () turczak ! de>
Date: 2008-09-28 8:17:01
Message-ID: 6DEA711E-7E49-480F-B317-40F8CCE3AB29 () turczak ! de
[Download RAW message or body]
Hi,
while experimenting with the ftpd and telnetd shipped with uclinux-
dist-2008... i found a strange situation appears when enabling
tinylogin with shadow support. After setting up a new user using
adduser and setting its password, telnetd would allow me to log in
using this new user, whereas ftpd would always return "530 Login
incorrect.".
After fiddeling a litte around it seems that there was a quirk in the
user/ftp/config.h, it would enable the header for shadow passwords
(#define HAVE_SHADOW_H) but would disable getspnam (#undef
HAVE_GETSPNAM) which is needed in auth.c to use shadow passwords.
Please find attached a patch for this problem, hope it is correct.
Feedback is welcome.
Greetings
Peter
["ftpd_shadow.patch" (ftpd_shadow.patch)]
? user/ftpd/.sgbuilt_user
? user/ftpd/ftpd
? user/ftpd/ftpd.gdb
Index: user/ftpd/auth.c
===================================================================
RCS file: /home/cvsroot/E004S001uclinux/user/ftpd/auth.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 auth.c
--- user/ftpd/auth.c 26 Jun 2008 08:53:03 -0000 1.1.1.1
+++ user/ftpd/auth.c 28 Sep 2008 08:14:25 -0000
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <pwd.h>
#include "crypt.h"
+#include <string.h>
#ifdef HAVE_SHADOW_H
#include <shadow.h>
#endif
Index: user/ftpd/config.h
===================================================================
RCS file: /home/cvsroot/E004S001uclinux/user/ftpd/config.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 config.h
--- user/ftpd/config.h 26 Jun 2008 08:53:03 -0000 1.1.1.1
+++ user/ftpd/config.h 28 Sep 2008 08:14:26 -0000
@@ -183,12 +183,13 @@
#define HAVE_GETPASS 1
/* Define to 1 if you have the `getspnam' function. */
-#ifdef __uClinux__
-#undef HAVE_GETSPNAM
-#else
+#if defined(CONFIG_USER_TINYLOGIN_SHADOWPASSWDS) || defined(CONFIG_USER_SHADOW_UTILS)
#define HAVE_GETSPNAM 1
+#else
+#undef HAVE_GETSPNAM
#endif
+
/* Define to 1 if you have the `getusershell' function. */
#ifdef __uClinux__
#undef HAVE_GETUSERSHELL
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic