home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / k95source / srpfltr.c < prev    next >
C/C++ Source or Header  |  2020-01-01  |  1KB  |  64 lines

  1. #include <windows.h>
  2. #include "t_pwd.h"
  3.  
  4. BOOLEAN WINAPI InitializeChangeNotify()
  5. {       
  6.     struct t_conf *tc;
  7.     struct t_confent *tcent;
  8.  
  9.     tc = t_openconf(NULL);
  10.     if ( tc == NULL )
  11.         return FALSE;
  12.  
  13.     tcent = t_getconflast(tc);
  14.     if ( tcent == NULL ) {
  15.         t_closeconf(tc);
  16.         return FALSE;
  17.     }
  18.  
  19.     return TRUE;
  20. }
  21.  
  22. BOOLEAN WINAPI PasswordFilter(PUNICODE_STRING AccountName,
  23.                         PUNICODE_STRING FullName,
  24.                         PUNICODE_STRING Password,
  25.                         BOOLEAN SetOperation)
  26. {
  27.     return TRUE;
  28. }
  29.  
  30.  
  31. NTSTATUS WINAPI PasswordChangeNotify( PUNICODE_STRING UserName,
  32.                                       ULONG RelativeId,
  33.                                       PUNICODE_STRING NewPassword)
  34. {
  35.     struct t_conf *tc;
  36.     struct t_confent *tcent;
  37.     struct t_pw eps_passwd;
  38.     FILE *passfp;
  39.  
  40.  
  41.  
  42.     tc = t_openconf(NULL);
  43.     tcent = t_getconflast(tc);
  44.     
  45.     t_makepwent (&eps_passwd, name, pass, NULL, tcent);
  46.  
  47.     if ((passfp = fopen( (char *)t_defaultpwd(), "rb+")) == NULL) {
  48.         int fh = creat ((char *)t_defaultpwd(), 0400);
  49.         if ( fc == -1 )
  50.             return STATUS_FAILURE;
  51.         close(fh);
  52.     } else
  53.         fclose (passfp);
  54.  
  55.     /* change the password */
  56.     t_changepw ((char *)t_defaultpwd(), &(eps_passwd.pebuf);
  57.  
  58.     t_closeconf(tc);
  59.     return STATUS_SUCCESS;
  60. }
  61.  
  62.  
  63.  
  64.