fix linux now :)

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@44 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Joshua Kwan 2004-01-02 21:00:54 +00:00
parent 3a2b0a7b0d
commit f35d803c74
2 changed files with 11 additions and 3 deletions

View File

@ -56,6 +56,11 @@
# include <libutil.h> # include <libutil.h>
#endif #endif
#ifdef __linux__
# include <pty.h>
#endif
#include <grp.h>
#include <time.h> #include <time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/ioctl.h> /* ttyrec */ #include <sys/ioctl.h> /* ttyrec */
@ -680,7 +685,7 @@ loginprompt ()
getnstr (pw_buf, 20); getnstr (pw_buf, 20);
echo (); echo ();
if (passwordgood (user_buf, pw_buf)) if (passwordgood (pw_buf))
{ {
loggedin = 1; loggedin = 1;
snprintf (rcfilename, 80, "%s%s.nethackrc", LOC_DGLDIR, me->username); snprintf (rcfilename, 80, "%s%s.nethackrc", LOC_DGLDIR, me->username);
@ -788,8 +793,11 @@ newuser ()
/* ************************************************************* */ /* ************************************************************* */
int int
passwordgood (char *cname, char *cpw) passwordgood (char *cpw)
{ {
if (me == NULL)
return 1;
if (!strncmp (crypt (cpw, cpw), me->password, 13)) if (!strncmp (crypt (cpw, cpw), me->password, 13))
return 1; return 1;
if (!strncmp (cpw, me->password, 20)) if (!strncmp (cpw, me->password, 20))

View File

@ -64,7 +64,7 @@ extern void initncurses (void);
extern struct dg_user *deep_copy (struct dg_user *src); extern struct dg_user *deep_copy (struct dg_user *src);
extern void loginprompt (void); extern void loginprompt (void);
extern void newuser (void); extern void newuser (void);
extern int passwordgood (char *cname, char *cpw); extern int passwordgood (char *cpw);
extern int readfile (int nolock); extern int readfile (int nolock);
extern int userexist (char *cname); extern int userexist (char *cname);
extern void write_canned_rcfile (char *target); extern void write_canned_rcfile (char *target);