hprop.c (72445) | hprop.c (78527) |
---|---|
1/* 2 * Copyright (c) 1997 - 2001 Kungliga Tekniska H�gskolan 3 * (Royal Institute of Technology, Stockholm, Sweden). 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 19 unchanged lines hidden (view full) --- 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#include "hprop.h" 35 | 1/* 2 * Copyright (c) 1997 - 2001 Kungliga Tekniska H�gskolan 3 * (Royal Institute of Technology, Stockholm, Sweden). 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 19 unchanged lines hidden (view full) --- 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#include "hprop.h" 35 |
36RCSID("$Id: hprop.c,v 1.60 2001/02/05 03:40:00 assar Exp $"); | 36RCSID("$Id: hprop.c,v 1.62 2001/02/20 01:44:50 assar Exp $"); |
37 38static int version_flag; 39static int help_flag; 40static char *ktname = HPROP_KEYTAB; 41static char *database; 42static char *mkeyfile; 43static int to_stdout; 44static int verbose_flag; --- 407 unchanged lines hidden (view full) --- 452 struct ka_header header; 453 int i; 454 int fd = open(file, O_RDONLY); 455 456 if(fd < 0) 457 krb5_err(pd->context, 1, errno, "open(%s)", file); 458 read_block(pd->context, fd, 0, &header, sizeof(header)); 459 if(header.version1 != header.version2) | 37 38static int version_flag; 39static int help_flag; 40static char *ktname = HPROP_KEYTAB; 41static char *database; 42static char *mkeyfile; 43static int to_stdout; 44static int verbose_flag; --- 407 unchanged lines hidden (view full) --- 452 struct ka_header header; 453 int i; 454 int fd = open(file, O_RDONLY); 455 456 if(fd < 0) 457 krb5_err(pd->context, 1, errno, "open(%s)", file); 458 read_block(pd->context, fd, 0, &header, sizeof(header)); 459 if(header.version1 != header.version2) |
460 krb5_errx(pd->context, 1, "Version mismatch in header: %d/%d", 461 ntohl(header.version1), ntohl(header.version2)); | 460 krb5_errx(pd->context, 1, "Version mismatch in header: %ld/%ld", 461 (long)ntohl(header.version1), (long)ntohl(header.version2)); |
462 if(ntohl(header.version1) != 5) | 462 if(ntohl(header.version1) != 5) |
463 krb5_errx(pd->context, 1, "Unknown database version %d (expected 5)", 464 ntohl(header.version1)); | 463 krb5_errx(pd->context, 1, "Unknown database version %ld (expected 5)", 464 (long)ntohl(header.version1)); |
465 for(i = 0; i < ntohl(header.hashsize); i++){ 466 int32_t pos = ntohl(header.hash[i]); 467 while(pos){ 468 struct ka_entry ent; 469 read_block(pd->context, fd, pos, &ent, sizeof(ent)); 470 ka_convert(pd, fd, &ent, cell); 471 pos = ntohl(ent.next); 472 } --- 309 unchanged lines hidden (view full) --- 782 krb5_error_code ret; 783 krb5_context context; 784 krb5_ccache ccache; 785 HDB *db; 786 int optind = 0; 787 788 int type = 0; 789 | 465 for(i = 0; i < ntohl(header.hashsize); i++){ 466 int32_t pos = ntohl(header.hash[i]); 467 while(pos){ 468 struct ka_entry ent; 469 read_block(pd->context, fd, pos, &ent, sizeof(ent)); 470 ka_convert(pd, fd, &ent, cell); 471 pos = ntohl(ent.next); 472 } --- 309 unchanged lines hidden (view full) --- 782 krb5_error_code ret; 783 krb5_context context; 784 krb5_ccache ccache; 785 HDB *db; 786 int optind = 0; 787 788 int type = 0; 789 |
790 set_progname(argv[0]); | 790 setprogname(argv[0]); |
791 792 if(getarg(args, num_args, argc, argv, &optind)) 793 usage(1); 794 795 if(help_flag) 796 usage(0); 797 798 if(version_flag){ --- 115 unchanged lines hidden --- | 791 792 if(getarg(args, num_args, argc, argv, &optind)) 793 usage(1); 794 795 if(help_flag) 796 usage(0); 797 798 if(version_flag){ --- 115 unchanged lines hidden --- |