From: Mark Eichin Date: Sun, 14 Aug 1994 04:45:04 +0000 (+0000) Subject: unistd.h X-Git-Tag: krb5-1.0-beta4.3~186 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=12c7bfc067cc2f58238e23aa32ccf86883b3d593;p=krb5.git unistd.h maxpathlen unused vars fix error message printfs string.h throw out byte_copy, use memcpy git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4137 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/kpasswd/configure.in b/src/kadmin/kpasswd/configure.in index 6c28f653a..9ac066bac 100644 --- a/src/kadmin/kpasswd/configure.in +++ b/src/kadmin/kpasswd/configure.in @@ -5,6 +5,7 @@ AC_SET_BUILDTOP AC_PROG_INSTALL AC_HAVE_LIBRARY(socket) AC_HAVE_LIBRARY(nsl) +AC_HAVE_HEADERS(unistd.h) AC_COMPILE_CHECK([ut_pid in struct utmp], [#include ], [struct utmp ut; ut.ut_pid;], diff --git a/src/kadmin/kpasswd/kpasswd.c b/src/kadmin/kpasswd/kpasswd.c index dc2706cc6..0dd48e808 100644 --- a/src/kadmin/kpasswd/kpasswd.c +++ b/src/kadmin/kpasswd/kpasswd.c @@ -33,10 +33,6 @@ static char rcsid_kpasswd_c[] = #include #include -#ifndef MAXPATHLEN -#define MAXPATHLEN 1024 -#endif - #include #include @@ -65,6 +61,11 @@ static char rcsid_kpasswd_c[] = #include #include #include +#include + +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif krb5_error_code get_first_ticket PROTOTYPE((krb5_ccache, @@ -101,20 +102,17 @@ main(argc,argv) struct passwd *pw; krb5_principal client; - krb5_principal server; char default_name[256]; char *client_name; /* Single string representation of client id */ krb5_data requested_realm; - char * local_realm; char input_string[768]; krb5_error_code retval; /* return code */ int local_socket; - int c, count; krb5_error *err_ret; krb5_ap_rep_enc_part *rep_ret; @@ -128,8 +126,6 @@ main(argc,argv) char *new_password; int new_pwsize; - krb5_data *decodable_pwd_string; - int i, j; #ifdef SANDIA extern int networked(); @@ -584,9 +580,7 @@ OLDDECLARG(krb5_ccache, cache) OLDDECLARG(krb5_principal, client) { char prompt[255]; /* for the password prompt */ - char verify_prompt[255]; /* Verification Prompt if Desired */ char pword[ADM_MAX_PW_LENGTH+1]; /* storage for the password */ - int pword_length = sizeof(pword); char *old_password; int old_pwsize; int i; @@ -594,7 +588,6 @@ OLDDECLARG(krb5_principal, client) krb5_address **my_addresses; char *client_name; - char local_realm[255]; krb5_error_code retval; if ((retval = krb5_unparse_name(client, &client_name))) { @@ -622,7 +615,8 @@ OLDDECLARG(krb5_principal, client) /* instance is local realm */ client->realm.data, 0))) { - fprintf(stderr, "Error %s while building server name\n"); + fprintf(stderr, "Error %s while building server name\n", + error_message(retval)); return(1); } @@ -685,7 +679,6 @@ krb5_error_code retval; krb5_pwd_data *pwd_data; passwd_phrase_element **next_passwd_phrase_element; char prompt[255]; - char *verify_prompt = 0; int i, j, k; int legit_pswd = 0; /* Assume No Legitimate Password */ char *password_list[ADM_MAX_PW_CHOICES]; @@ -818,9 +811,7 @@ int * local_socket; { struct servent *service_process; /* service we will talk to */ - struct hostent *local_host; /* us */ struct hostent *remote_host; /* host we will talk to */ - struct sockaddr *sockaddr_list; char **hostlist; diff --git a/src/kadmin/kpasswd/networked.c b/src/kadmin/kpasswd/networked.c index 39897f17d..e70e6f83f 100644 --- a/src/kadmin/kpasswd/networked.c +++ b/src/kadmin/kpasswd/networked.c @@ -33,6 +33,10 @@ * suitability of the modifications, or additions to this software for * any purpose. It is provided "as is" without express or implied warranty. */ +#include +#ifdef HAVE_UNISTD_H +#include +#endif #ifndef _TYPES_ #include #ifndef _TYPES_ @@ -140,7 +144,7 @@ char *username,*tmpname; kadmin_endutent(); return(1); } - byte_copy((char *)tmpptr,(char *)&retutent,sizeof(struct utmp)); + memcpy((char *)&retutent,(char *)tmpptr,sizeof(struct utmp)); kadmin_endutent(); #ifdef DEBUG #ifdef NO_UT_HOST @@ -192,16 +196,6 @@ char *username,*tmpname; return(1); } -byte_copy(str1,str2,len) -char *str1, *str2; -int len; -{ - int i; - for (i=0;i < len; i++) *(str2 + i) = *(str1 + i); - return; -} - - #ifdef NOTKERBEROS main(argc,argv) int argc;