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

« back to all changes in this revision

Viewing changes to src/appl/gssftp/ftp/ruserpass.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:
136
136
        hdir = getenv("HOME");
137
137
        if (hdir == NULL)
138
138
                hdir = ".";
139
 
        (void) sprintf(buf, "%s/.netrc", hdir);
 
139
        (void) snprintf(buf, sizeof(buf), "%s/.netrc", hdir);
140
140
        cfile = fopen(buf, "r");
141
141
        if (cfile == NULL) {
142
142
                if (errno != ENOENT)
187
187
                case LOGIN:
188
188
                        if (token()) {
189
189
                                if (*aname == 0) { 
190
 
                                        *aname = malloc((unsigned) strlen(tokval) + 1);
191
 
                                        (void) strcpy(*aname, tokval);
 
190
                                        *aname = strdup(tokval);
192
191
                                } else {
193
192
                                        if (strcmp(*aname, tokval))
194
193
                                                goto next;
204
203
                                goto bad;
205
204
                        }
206
205
                        if (token() && *apass == 0) {
207
 
                                *apass = malloc((unsigned) strlen(tokval) + 1);
208
 
                                (void) strcpy(*apass, tokval);
 
206
                                *apass = strdup(tokval);
209
207
                        }
210
208
                        break;
211
209
                case ACCOUNT:
216
214
                                goto bad;
217
215
                        }
218
216
                        if (token() && *aacct == 0) {
219
 
                                *aacct = malloc((unsigned) strlen(tokval) + 1);
220
 
                                (void) strcpy(*aacct, tokval);
 
217
                                *aacct = strdup(tokval);
221
218
                        }
222
219
                        break;
223
220
                case MACDEF: