]>
Commit | Line | Data |
---|---|---|
07cd2e49 AM |
1 | diff -urNp -x '*.orig' cvs-1.12.13.org/src/login.c cvs-1.12.13/src/login.c |
2 | --- cvs-1.12.13.org/src/login.c 2005-05-13 23:47:28.000000000 +0200 | |
3 | +++ cvs-1.12.13/src/login.c 2023-02-02 09:01:00.365363622 +0100 | |
4 | @@ -309,9 +309,25 @@ internal error: can only call password_e | |
a6d1728f AM |
5 | fp = CVS_FOPEN (passfile, "r"); |
6 | if (fp == NULL) | |
7 | { | |
87b758f5 | 8 | + /* The password file doesn't exist yet - probably because it's |
9 | + * the first time someone uses cvs login. Create it. | |
10 | + */ | |
11 | + fp = CVS_FOPEN (passfile, "w"); | |
d5fe4098 AG |
12 | + if (fp == NULL) |
13 | + { | |
14 | + /* Creating the password file didn't work. Bail out. */ | |
15 | + error(0, errno, "warning: failed to open %s for writing", passfile); | |
16 | + goto process; | |
17 | + } | |
87b758f5 | 18 | + fclose (fp); |
19 | + fp = CVS_FOPEN (passfile, "r"); | |
20 | + if (fp == NULL) | |
21 | + { | |
d5fe4098 AG |
22 | + /* Opening the password file didn't work. Bail out. */ |
23 | error (0, errno, "warning: failed to open %s for reading", passfile); | |
24 | goto process; | |
a6d1728f | 25 | } |
d5fe4098 | 26 | + } |
a6d1728f | 27 | |
d5fe4098 | 28 | /* Check each line to see if we have this entry already. */ |
07cd2e49 | 29 | line = 0L; |