home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / protocol / kerberos / 842 < prev    next >
Encoding:
Text File  |  1992-11-06  |  9.6 KB  |  345 lines

  1. Path: sparky!uunet!snorkelwacker.mit.edu!bloom-picayune.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: Some patches to V5 B2
  5. Date: 6 Nov 1992 00:49:40 GMT
  6. Organization: Massachusetts Institute of Technology
  7. Lines: 334
  8. Message-ID: <JIK.92Nov5194939@pit-manager.mit.edu>
  9. NNTP-Posting-Host: pit-manager.mit.edu
  10.  
  11.  
  12. The patches below, prepared by Barry Jaspan <bjaspan@mit.edu> and me,
  13. do the following:
  14.  
  15. include/kerberosIV/Imakefile:
  16.     Create the file, which installs header files in
  17.     $(KRB5_INCDIR)/kerberosIV.
  18.  
  19. include/Imakefile:
  20.     Descend into the kerberosIV subdirectory.
  21.  
  22. lib/krb425/rd_req.c:
  23.     1) Prepend "FILE:" to the name of the srvtab file name before
  24.        passing it to V5 routines.
  25.     2) Correctly extract the aname, instance and realm from the V5
  26.        ticket for the V4 ticket.
  27.  
  28. lib/krb425/get_cred.c:
  29.     1) Correctly extract the aname and instance from the V5
  30.        ticket.
  31.     2) Correctly extract the service aname and instance from the
  32.        V5 server ticket.
  33.  
  34. lib/des/Imakefile:
  35.     Add "depend" dependencies for the .c and .h files that are
  36.     machine-generated.
  37.  
  38. lib/Imakefile:
  39.     Install the krb425 and des425 libraries.
  40.  
  41. kdc/do_as_req.c:
  42.     Print more useful error messages.
  43.  
  44. kdc/policy.c:
  45.     "#ifdef 0" should be "#if 0".
  46.  
  47. kadmin/kpasswd/kpasswd.c:
  48.     Fix a stupid error that was causing an "out of memory" error
  49.     unnecessarily.
  50.  
  51. config-files/services.append:
  52.     Add this file.
  53.  
  54. Jonathan Kamens                                         jik@MIT.Edu
  55. Geer Zolot Associates                       Moderator, news.answers
  56.  
  57. *** /dev/null    Thu Nov  5 17:17:21 1992
  58. --- include/kerberosIV/Imakefile    Thu Nov  5 14:49:18 1992
  59. ***************
  60. *** 0 ****
  61. --- 1,9 ----
  62. + KRB4_HEADERS=krb.h des.h kadm.h mit-copyright.h
  63. + all::
  64. + clean::
  65. + depend::
  66. + Krb5InstallHeaders($(KRB4_HEADERS),$(KRB5_INCDIR)/kerberosIV)
  67. *** 5.3    1991/06/06 09:35:05
  68. --- include/Imakefile    1992/11/04 20:52:25
  69. ***************
  70. *** 25,30 ****
  71.   #define IHaveSubdirs
  72.   #define PassCDebugFlags
  73.   
  74. ! SUBDIRS=krb5
  75.   
  76.   MakeSubdirs($(SUBDIRS))
  77. --- 25,30 ----
  78.   #define IHaveSubdirs
  79.   #define PassCDebugFlags
  80.   
  81. ! SUBDIRS=krb5 kerberosIV
  82.   
  83.   MakeSubdirs($(SUBDIRS))
  84. *** 5.9    1992/08/21 03:16:54
  85. --- lib/krb425/rd_req.c    1992/11/05 23:45:21
  86. ***************
  87. *** 27,36 ****
  88.   
  89.   #if !defined(lint) && !defined(SABER)
  90.   static char rcsid_rd_req_c[] =
  91.   "$Id: rd_req.c,v 5.9 1992/08/21 03:16:54 jfc Exp $";
  92.   #endif    /* !lint & !SABER */
  93.   
  94.   #include "krb425.h"
  95.   
  96.   static krb5_error_code
  97.   setkey_key_proc(DECLARG(krb5_pointer,arg),
  98. --- 27,37 ----
  99.   
  100.   #if !defined(lint) && !defined(SABER)
  101.   static char rcsid_rd_req_c[] =
  102.   "$Id: rd_req.c,v 5.9 1992/08/21 03:16:54 jfc Exp $";
  103.   #endif    /* !lint & !SABER */
  104.   
  105.   #include "krb425.h"
  106. + #include <sys/param.h>
  107.   
  108.   static krb5_error_code
  109.   setkey_key_proc(DECLARG(krb5_pointer,arg),
  110. ***************
  111. *** 62,67 ****
  112. --- 63,70 ----
  113.       krb5_data authe;
  114.       extern int gethostname();
  115.       int use_set_key = 0;
  116. +     char file_name[MAXPATHLEN+5]; /* 5 for "FILE:" */
  117. +     int tmp;
  118.   
  119.       if (from_addr) {
  120.           peer.addrtype = ADDRTYPE_INET;
  121. ***************
  122. *** 108,115 ****
  123.       if (!fn) {
  124.           use_set_key = 1;
  125.           fn = (char *)0;
  126. !     } else if (!*fn)
  127. !         fn = (char *)0;
  128.   
  129.   #ifdef  EBUG
  130.           EPRINT "Calling krb5_rd_req with:\n");
  131. --- 111,124 ----
  132.       if (!fn) {
  133.           use_set_key = 1;
  134.           fn = (char *)0;
  135. !     } else if (!*fn) {
  136. !         fn = (char *)0;
  137. !     } else {
  138. !         strcpy(file_name, "FILE:");
  139. !         strncpy(file_name + 5, fn, MAXPATHLEN);
  140. !         file_name[sizeof(file_name)-1] = '\0';
  141. !         fn = file_name;
  142. !     }
  143.   
  144.   #ifdef  EBUG
  145.           EPRINT "Calling krb5_rd_req with:\n");
  146. ***************
  147. *** 175,185 ****
  148.       r = 0;
  149.   #endif
  150.       set_string(ad->pname, ANAME_SZ,
  151. -            krb5_princ_component(authdat->authenticator->client, 1));
  152. -     set_string(ad->pinst, INST_SZ,
  153. -            krb5_princ_component(authdat->authenticator->client, 2));
  154. -     set_string(ad->prealm, REALM_SZ,
  155.              krb5_princ_component(authdat->authenticator->client, 0));
  156.   
  157.       ad->checksum = *(long *)authdat->authenticator->checksum->contents;
  158.   
  159. --- 184,202 ----
  160.       r = 0;
  161.   #endif
  162.       set_string(ad->pname, ANAME_SZ,
  163.              krb5_princ_component(authdat->authenticator->client, 0));
  164. +     if (authdat->authenticator->client->length > 1) {
  165. +              set_string(ad->pinst, INST_SZ,
  166. +                krb5_princ_component(authdat->authenticator->client,
  167. +                         1));
  168. +     }
  169. +     else {
  170. +         ad->pinst[0] = '\0';
  171. +     }
  172. +     set_string(ad->prealm, REALM_SZ,
  173. +            krb5_princ_realm(authdat->authenticator->client));
  174.   
  175.       ad->checksum = *(long *)authdat->authenticator->checksum->contents;
  176.   
  177. *** 5.7    1992/08/21 03:17:43
  178. --- lib/krb425/get_cred.c    1992/11/05 23:21:11
  179. ***************
  180. *** 93,104 ****
  181.               }
  182.       }
  183.   #endif
  184. !     set_string(c->pname, ANAME_SZ, krb5_princ_component(creds.client, 1));
  185. !     set_string(c->pinst, INST_SZ, krb5_princ_component(creds.client, 2));
  186.       set_string(c->realm, REALM_SZ, krb5_princ_realm(creds.server));
  187. !     set_string(c->service, REALM_SZ, krb5_princ_component(creds.server, 1));
  188. !     set_string(c->instance, REALM_SZ, krb5_princ_component(creds.server, 2));
  189.   
  190.       c->ticket_st.length = creds.ticket.length;
  191.       memcpy((char *)c->ticket_st.dat,
  192. --- 93,108 ----
  193.               }
  194.       }
  195.   #endif
  196. !     set_string(c->pname, ANAME_SZ, krb5_princ_component(creds.client, 0));
  197. !     if (creds.client->length > 1) {
  198. !       set_string(c->pinst, INST_SZ, krb5_princ_component(creds.client, 1));
  199. !     }
  200. !     else {
  201. !       c->pinst[0] = '\0';
  202. !     }
  203.       set_string(c->realm, REALM_SZ, krb5_princ_realm(creds.server));
  204. !     set_string(c->service, REALM_SZ, krb5_princ_component(creds.server, 0));
  205. !     set_string(c->instance, REALM_SZ, krb5_princ_component(creds.server, 1));
  206.   
  207.       c->ticket_st.length = creds.ticket.length;
  208.       memcpy((char *)c->ticket_st.dat,
  209. *** 5.24    1992/08/21 02:59:25
  210. --- lib/des/Imakefile    1992/11/05 23:26:20
  211. ***************
  212. *** 128,130 ****
  213. --- 128,134 ----
  214.       ./make_st s_table.h
  215.   
  216.   NormalLintTarget($(SRCS))
  217. + depend:: key_perm.h odd.h p_table.h s_table.h
  218. + depend:: fp.c ip.c p.c
  219. *** 5.28    1992/08/21 03:21:29
  220. --- lib/Imakefile    1992/11/05 23:26:41
  221. ***************
  222. *** 121,126 ****
  223. --- 121,128 ----
  224.   
  225.   Krb5InstallLibrary(krb5,$(KRB5_LIBDIR))
  226.   Krb5InstallLibrary($(DESLIB),$(KRB5_LIBDIR))
  227. + Krb5InstallLibrary(krb425,$(KRB5_LIBDIR))
  228. + Krb5InstallLibrary(des425,$(KRB5_LIBDIR))
  229.   
  230.   SharedLibraryTarget(kdb5,-L$(KRB5_LIBDIR) -Lshared $(LDLOCATIONS) -lkrb5 -l$(DESLIB) $(ISODELIB) -lcom_err)
  231.   /* SharedLibraryTarget(des425,-L$(KRB5_LIBDIR) -Lshared $(LDLOCATIONS) -l$(DESLIB)) */
  232. *** 5.32    1992/09/30 14:06:19
  233. --- kdc/do_as_req.c    1992/11/04 22:36:04
  234. ***************
  235. *** 548,556 ****
  236.       krb5_error errpkt;
  237.       krb5_error_code retval;
  238.       krb5_data *scratch;
  239.   
  240. !     syslog(LOG_INFO, "AS_REQ: %s while processing request",
  241. !        error_message(error+KRB5KDC_ERR_NONE));
  242.   
  243.       errpkt.ctime = request->nonce;
  244.       errpkt.cusec = 0;
  245. --- 548,581 ----
  246.       krb5_error errpkt;
  247.       krb5_error_code retval;
  248.       krb5_data *scratch;
  249. +     char unparse_failed = 0, *cname = 0, *sname = 0;
  250.   
  251. !     if (retval = krb5_unparse_name(request->client, &cname)) {
  252. !      syslog(LOG_INFO, "AS_REQ: %s while unparsing client name for error",
  253. !         error_message(retval));
  254. !      unparse_failed = 1;
  255. !     }
  256. !     if (retval = krb5_unparse_name(request->server, &sname)) {
  257. !      syslog(LOG_INFO, "AS_REQ: %s while unparsing server name for error",
  258. !         error_message(retval));
  259. !      unparse_failed = 2;
  260. !     }
  261. !     if (!unparse_failed)
  262. !      syslog(LOG_INFO, "AS_REQ: %s while processing request from %s for %s",
  263. !         error_message(error+KRB5KDC_ERR_NONE), cname, sname);
  264. !     else
  265. !      syslog(LOG_INFO, "AS_REQ: %s while processing request",
  266. !         error_message(error+KRB5KDC_ERR_NONE));
  267. !     switch (unparse_failed) {
  268. !     case 0:
  269. !      free(sname);
  270. !     case 2:
  271. !      free(cname);
  272. !     case 1:
  273. !      break;
  274. !     }
  275.   
  276.       errpkt.ctime = request->nonce;
  277.       errpkt.cusec = 0;
  278. *** 5.6    1992/09/30 14:08:14
  279. --- kdc/policy.c    1992/11/05 23:34:37
  280. ***************
  281. *** 58,64 ****
  282.   krb5_ticket *ticket;
  283.   char **status;
  284.   {
  285. ! #ifdef 0
  286.       /*
  287.        * For example, if your site wants to disallow ticket forwarding,
  288.        * you might do something like this:
  289. --- 58,64 ----
  290.   krb5_ticket *ticket;
  291.   char **status;
  292.   {
  293. ! #if 0
  294.       /*
  295.        * For example, if your site wants to disallow ticket forwarding,
  296.        * you might do something like this:
  297. *** /dev/null    Thu Nov  5 17:17:21 1992
  298. --- config-files/services.append    Wed Nov  4 16:24:37 1992
  299. ***************
  300. *** 0 ****
  301. --- 1,13 ----
  302. + klogin        543/tcp                # Kerberos authenticated rlogin
  303. + kerberos    88/udp         kdc        # Kerberos authentication--udp
  304. + kerberos    88/tcp         kdc        # Kerberos authentication--tcp
  305. + kerberos-sec    750/udp             # Kerberos authentication--udp
  306. + kerberos-sec    750/tcp             # Kerberos authentication--tcp
  307. + kerberos_master    751/udp             # Kerberos authentication
  308. + kerberos_master    751/tcp             # Kerberos authentication
  309. + kerberos_adm    752/tcp                # Kerberos 5 admin/changepw
  310. + passwd_server    752/udp                # Kerberos passwd server
  311. + kpop        1109/tcp            # Pop with Kerberos
  312. + kshell        544/tcp        cmd        # and remote shell
  313. + eklogin        2105/tcp            # Kerberos encrypted rlogin
  314. + krb_prop    754/tcp                # Kerberos slave propagation
  315. *** 5.1    1992/09/30 14:33:37
  316. --- kadmin/kpasswd/kpasswd.c    1992/11/04 22:37:42
  317. ***************
  318. *** 150,156 ****
  319.       arg = &arg2;
  320.       }
  321.       my_keyblock = (krb5_keyblock *)malloc(sizeof(**key));
  322. !     if (!*key) {
  323.       if (f_salt) xfree(salt.data);
  324.       if (arg != (struct v4_pwd_keyproc_arg *) keyseed) 
  325.           memset((char *) arg->password.data, 0, arg->password.length);
  326. --- 150,156 ----
  327.       arg = &arg2;
  328.       }
  329.       my_keyblock = (krb5_keyblock *)malloc(sizeof(**key));
  330. !     if (!my_keyblock) {
  331.       if (f_salt) xfree(salt.data);
  332.       if (arg != (struct v4_pwd_keyproc_arg *) keyseed) 
  333.           memset((char *) arg->password.data, 0, arg->password.length);
  334.