home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / protocol / kerberos / 988 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  3.9 KB

  1. Path: sparky!uunet!spool.mu.edu!enterpoop.mit.edu!senator-bedfellow.mit.edu!athena.mit.edu!jik
  2. From: jik@athena.mit.edu (Jonathan I. Kamens)
  3. Newsgroups: comp.protocols.kerberos
  4. Subject: V5 beta: make popper work
  5. Date: 6 Jan 1993 21:37:16 GMT
  6. Organization: Massachusetts Institute of Technology
  7. Lines: 161
  8. Distribution: world
  9. Message-ID: <1ifjecINNslp@senator-bedfellow.MIT.EDU>
  10. NNTP-Posting-Host: pit-manager.mit.edu
  11.  
  12. The following patches, to be applied in appl/popper, make it work (it wouldn't
  13. even compile as shippped).
  14.  
  15. In more detail, they make the following changes:
  16.  
  17. pop_enter.c:
  18.  
  19. 1) Fix a reversed "if" statement.
  20. 2) Use "com_err" to report errors.
  21.  
  22. pop_init.c:
  23.  
  24. In general, fix it and make it work.
  25.  
  26. pop_updt.c:
  27.  
  28. Fix it to recognize the "From " line format produced by SunOS /bin/mail.
  29.  
  30. *** 1.1    1992/12/03 21:58:05
  31. --- pop_enter.c    1992/12/03 22:19:17
  32. ***************
  33. *** 10,16 ****
  34.   #include <sys/stat.h>
  35.   #include <sys/file.h>
  36.   #include <mit-copyright.h>
  37.   #ifdef ZEPHYR
  38.   #include <zephyr/zephyr.h>
  39.   
  40. --- 10,17 ----
  41.   #include <sys/stat.h>
  42.   #include <sys/file.h>
  43.   #include <mit-copyright.h>
  44. ! #include <com_err.h>
  45. !      
  46.   #ifdef ZEPHYR
  47.   #include <zephyr/zephyr.h>
  48.   
  49. ***************
  50. *** 43,49 ****
  51.   
  52.     while (--argc > 0) 
  53.       {
  54. !       if(open_drop(argv[i]) < 0)
  55.       {
  56.         lseek(newmail, 0, L_SET);
  57.         if(new_message(maildrop, newmail) < 0)
  58. --- 44,50 ----
  59.   
  60.     while (--argc > 0) 
  61.       {
  62. !       if(open_drop(argv[i]) != -1)
  63.       {
  64.         lseek(newmail, 0, L_SET);
  65.         if(new_message(maildrop, newmail) < 0)
  66. ***************
  67. *** 51,58 ****
  68.         if(close(maildrop) < 0)
  69.           {
  70.             status = 1;
  71. !           sprintf(buffer, "%s: error on close", argv[i]);
  72. !           error(buffer, errno);
  73.           }
  74.         notify_recipient(argv[i]);
  75.       }
  76. --- 52,58 ----
  77.         if(close(maildrop) < 0)
  78.           {
  79.             status = 1;
  80. !           com_err(argv[i], errno, "error on close");
  81.           }
  82.         notify_recipient(argv[i]);
  83.       }
  84. *** 1.1    1992/11/16 20:06:57
  85. --- pop_init.c    1992/12/17 20:49:44
  86. ***************
  87. *** 24,29 ****
  88. --- 24,34 ----
  89.   #include "popper.h"
  90.   
  91.   #ifdef KERBEROS
  92. + #ifndef KRB4
  93. + #ifndef KRB5
  94. +  #error you must use one of KRB4, KRB5 if KERBEROS is enabled
  95. + #endif /* ! KRB5 */
  96. + #endif /* ! KRB4 */
  97.   #ifdef KRB4
  98.   #ifdef KRB5
  99.    #error you can only use one of KRB4, KRB5
  100. ***************
  101. *** 302,310 ****
  102.   
  103.       strcpy(p->user, kdata.pname);
  104.   
  105.       krb5_init_ets();
  106.   
  107. !     if (retval = krb5_sname_to_principal(p->myhost, "pop", TRUE, &server)) {
  108.       pop_msg(p, POP_FAILURE,
  109.           "server mis-configured, can't get principal--%s",
  110.           error_message(retval));
  111. --- 307,322 ----
  112.   
  113.       strcpy(p->user, kdata.pname);
  114.   
  115. + #else /* must be krb5 */
  116. +     int retval;
  117. +     int sock = 0;
  118. +     krb5_principal server;
  119. +     krb5_data *tmpdata;
  120.       krb5_init_ets();
  121.   
  122. !     if (retval = krb5_sname_to_principal(p->myhost, "pop", KRB5_NT_SRV_HST,
  123. !                      &server)) {
  124.       pop_msg(p, POP_FAILURE,
  125.           "server mis-configured, can't get principal--%s",
  126.           error_message(retval));
  127. ***************
  128. *** 341,347 ****
  129.       pop_log(p, POP_DEBUG, "%s (%s): ok", client_name, inet_ntoa(addr->sin_addr));
  130.   #endif /* DEBUG */
  131.   
  132. ! #endif /* KRB5 */
  133.   #endif /* KERBEROS */
  134.   
  135.       return(POP_SUCCESS);
  136. --- 353,363 ----
  137.       pop_log(p, POP_DEBUG, "%s (%s): ok", client_name, inet_ntoa(addr->sin_addr));
  138.   #endif /* DEBUG */
  139.   
  140. !     tmpdata = krb5_princ_component(ext_client, 0);
  141. !     strncpy(p->user, tmpdata->data, tmpdata->length);
  142. !     p->user[tmpdata->length] = '\0';
  143. ! #endif /* KRB4 */
  144.   #endif /* KERBEROS */
  145.   
  146.       return(POP_SUCCESS);
  147. *** 1.1    1992/12/03 22:16:52
  148. --- pop_updt.c    1992/12/03 22:17:33
  149. ***************
  150. *** 252,258 ****
  151.     if(*line++ != ' ')
  152.       return(0);
  153.     
  154. !   if(strlen(line) < 28)
  155.       return(0);
  156.   
  157.     /* Tue */
  158. --- 252,258 ----
  159.     if(*line++ != ' ')
  160.       return(0);
  161.     
  162. !   if(strlen(line) < 20)
  163.       return(0);
  164.   
  165.     /* Tue */
  166.  
  167. -- 
  168. Jonathan Kamens                                         jik@MIT.Edu
  169. Aktis, Inc.                                 Moderator, news.answers
  170.