X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Flock.c;h=244eb0ba02b5f0b9d2f5d806f153c6305b01f8fb;hb=6edc84f12f15860a71430c45e8392a5e4ef8203c;hp=de8dd9fa0eed7bf696ce9d0e99a6d137800eb77a;hpb=65740e2a8dea3d6309ae6e8914a0fb79e993ada8;p=xscreensaver diff --git a/driver/lock.c b/driver/lock.c old mode 100755 new mode 100644 index de8dd9fa..244eb0ba --- a/driver/lock.c +++ b/driver/lock.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1993 Jamie Zawinski +/* xscreensaver, Copyright (c) 1993-1995 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -19,6 +19,7 @@ #include #endif +#include #include #include @@ -27,21 +28,14 @@ # define _NO_PROTO #endif -#include "xscreensaver.h" - -#ifndef NO_LOCKING - -#ifndef VMS -#include -#else -#include "pwd.h" -extern char *getenv(); -#endif - #include #include #include +#include "xscreensaver.h" + +#ifndef NO_LOCKING + Time passwd_timeout; extern char *screensaver_version; @@ -58,14 +52,14 @@ extern Widget passwd_text; extern Widget passwd_done; extern Widget passwd_cancel; -extern create_passwd_dialog (); +extern create_passwd_dialog P((Widget)); +extern void ungrab_keyboard_and_mouse P((void)); static enum { pw_read, pw_ok, pw_fail, pw_cancel, pw_time } passwd_state; static char typed_passwd [1024]; static char root_passwd [255]; static char user_passwd [255]; -static char * user_vms; #ifdef HAVE_SHADOW # define PWTYPE struct spwd * @@ -82,7 +76,6 @@ lock_init () { Bool ok = True; char *u; -#ifndef VMS PWTYPE p = GETPW ("root"); if (p && p->PWSLOT && p->PWSLOT[0] != '*') strcpy (root_passwd, p->PWSLOT); @@ -110,7 +103,6 @@ lock_init () #endif } - if (p && p->PWSLOT && /* p->PWSLOT[0] != '*' */ /* sensible */ (strlen (p->PWSLOT) > 4) /* solaris */ @@ -123,10 +115,6 @@ lock_init () ok = False; } return ok; -#else - return ok; -#endif /* VMS */ - } @@ -148,9 +136,7 @@ passwd_done_cb (button, client_data, call_data) Widget button; XtPointer client_data, call_data; { - if (passwd_state != pw_read) return; /* already done */ -#ifndef VMS if (!strcmp ((char *) crypt (typed_passwd, user_passwd), user_passwd)) passwd_state = pw_ok; /* do not allow root to have empty passwd */ @@ -159,13 +145,6 @@ passwd_done_cb (button, client_data, call_data) passwd_state = pw_ok; else passwd_state = pw_fail; -#else - user_vms = getenv("USER"); - if (validate_user(user_vms,typed_passwd) == 1 ) - passwd_state = pw_ok; - else - passwd_state = pw_fail; -#endif } #ifdef VERIFY_CALLBACK_WORKS @@ -403,11 +382,7 @@ make_passwd_dialog (parent) /* Another random thing necessary in 1.2.1 but not 1.1.5... */ XtVaSetValues (roger_label, XmNborderWidth, 2, 0); -#ifndef VMS pw = getpwuid (getuid ()); -#else - pw->pw_name = getenv("USER"); -#endif format_into_label (passwd_label3, (pw->pw_name ? pw->pw_name : "???")); format_into_label (passwd_label1, screensaver_version); }