mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-18 08:52:42 +01:00
This changes two things when importing an unreadable file:
1: It stops invalid files being created in the cvs tree 2: It stops the import from aborting without mailing a commit message.. The first is simple, it opens the file for reading before touching the repository, and the second catches the pieces when it hits an unreadable file rather than just aborting mid-way through, leaving the repository in a bit mess. Reviewed by: rgrimes
This commit is contained in:
parent
90129a1968
commit
f4df6549b2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=10074
@ -753,8 +753,19 @@ add_rcs_file (message, rcs, user, vtag, targc, targv)
|
||||
if (noexec)
|
||||
return (0);
|
||||
|
||||
fprcs = open_file (rcs, "w+");
|
||||
fpuser = open_file (user, "r");
|
||||
/* open the user file first, before we change the RCS files... */
|
||||
fpuser = fopen (user, "r");
|
||||
if (fpuser == NULL) {
|
||||
/* not fatal, continue the import */
|
||||
fperror (logfp, 0, errno, "ERROR: cannot read file %s", user);
|
||||
error (0, errno, "ERROR: cannot read file %s", user);
|
||||
goto read_error;
|
||||
}
|
||||
fprcs = fopen (rcs, "w+");
|
||||
if (fprcs == NULL) {
|
||||
ierrno = errno;
|
||||
goto write_error_noclose;
|
||||
}
|
||||
|
||||
/*
|
||||
* putadmin()
|
||||
@ -908,6 +919,7 @@ write_error_noclose:
|
||||
fperror (logfp, 0, 0, "ERROR: out of space - aborting");
|
||||
error (1, 0, "ERROR: out of space - aborting");
|
||||
}
|
||||
read_error:
|
||||
return (err + 1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user