~ubuntu-branches/ubuntu/maverick/krb5/maverick

« back to all changes in this revision

Viewing changes to src/clients/ksu/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2009-05-07 16:16:34 UTC
  • mfrom: (13.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090507161634-xqyk0s9na0le4flj
Tags: 1.7dfsg~beta1-4
When  decrypting the TGS response fails with the subkey, try with the
session key to work around Heimdal bug, Closes: #527353 

Show diffs side-by-side

added added

removed removed

Lines of Context:
425
425
           cache will be created.*/
426
426
        
427
427
        do {
428
 
            sprintf(cc_target_tag, "%s%ld.%d",
429
 
                    KRB5_SECONDARY_CACHE,
430
 
                    (long) target_uid, gen_sym());
 
428
            snprintf(cc_target_tag, KRB5_SEC_BUFFSIZE, "%s%ld.%d",
 
429
                     KRB5_SECONDARY_CACHE,
 
430
                     (long) target_uid, gen_sym());
431
431
            cc_target_tag_tmp = strchr(cc_target_tag, ':') + 1;
432
432
            
433
433
        }while ( !stat ( cc_target_tag_tmp, &st_temp)); 
855
855
static char * ontty()
856
856
{
857
857
    char *p, *ttyname();
858
 
    static char buf[MAXPATHLEN + 4];
 
858
    static char buf[MAXPATHLEN + 5];
 
859
    int result;
859
860
    
860
861
    buf[0] = 0;
861
862
    if ((p = ttyname(STDERR_FILENO))) {
862
 
        if (strlen (p) > MAXPATHLEN) {
 
863
        result = snprintf(buf, sizeof(buf), " on %s", p);
 
864
        if (SNPRINTF_OVERFLOW(result, sizeof(buf))) {
863
865
            fprintf (stderr, "terminal name %s too long\n", p);
864
866
            exit (1);
865
867
        }
866
 
        sprintf(buf, " on %s", p);
867
868
    }
868
869
    return (buf);
869
870
}
875
876
{
876
877
    char * env_var_buf;
877
878
    
878
 
    /* allocate extra two spaces, one for the = and one for the \0 */  
879
 
    env_var_buf = (char *) xcalloc(2 + strlen(name) + strlen(value),
880
 
                                   sizeof(char)); 
881
 
    
882
 
    sprintf(env_var_buf,"%s=%s",name, value);  
 
879
    asprintf(&env_var_buf,"%s=%s",name, value);  
883
880
    return putenv(env_var_buf);
884
881
    
885
882
}
931
928
    int size = pargc - *optindex + 2;
932
929
    
933
930
    if ((ret_params = (char **) calloc(size, sizeof (char *)))== NULL ){
934
 
        return errno;
 
931
        return ENOMEM;
935
932
    }
936
933
    
937
934
    for (i = *optindex, j=1; i < pargc; i++,j++){