Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Mark closeexec all stream
Baptiste Daroussin committed 5 years ago
commit c14825ac976cec01517c5e1ea379148aceb63cc3
parent 6db0093
7 files changed +9 -9
modified libpkg/elfhints.c
@@ -387,7 +387,7 @@ read_dirs_from_file(const char *hintsfile, const char *listfile)
	char	 buf[MAXPATHLEN];
	int	 linenum;

-
	if ((fp = fopen(listfile, "r")) == NULL)
+
	if ((fp = fopen(listfile, "re")) == NULL)
		err(1, "%s", listfile);

	linenum = 0;
modified libpkg/metalog.c
@@ -36,7 +36,7 @@ FILE *metalogfp = NULL;
int
metalog_open(const char *metalog)
{
-
	metalogfp = fopen(metalog, "a");
+
	metalogfp = fopen(metalog, "ae");
	if (metalogfp == NULL) {
		pkg_fatal_errno("Unable to open metalog '%s'", metalog);
	} 
modified libpkg/pkg_jobs.c
@@ -1828,7 +1828,7 @@ solve_with_sat_solver(struct pkg_jobs *j)

	if ((dotfile = pkg_object_string(pkg_config_get("DOT_FILE")))
		!= NULL) {
-
		dot = fopen(dotfile, "w");
+
		dot = fopen(dotfile, "we");

		if (dot == NULL) {
			pkg_emit_errno("fopen", dotfile);
@@ -1851,7 +1851,7 @@ solve_with_sat_solver(struct pkg_jobs *j)

	if ((dotfile = pkg_object_string(pkg_config_get("DOT_FILE")))
		!= NULL) {
-
		dot = fopen(dotfile, "w");
+
		dot = fopen(dotfile, "we");

		if (dot == NULL) {
			pkg_emit_errno("fopen", dotfile);
modified libpkg/pkg_ports.c
@@ -1434,7 +1434,7 @@ ports_parse_plist(struct pkg *pkg, const char *plist, const char *stage)
		plist_free(pplist);
		return (EPKG_FATAL);
	}
-
	if ((plist_f = fopen(plist, "r")) == NULL) {
+
	if ((plist_f = fopen(plist, "re")) == NULL) {
		pkg_emit_error("Unable to open plist file: %s", plist);
		plist_free(pplist);
		return (EPKG_FATAL);
modified libpkg/pkg_repo_create.c
@@ -780,12 +780,12 @@ pkg_create_repo(char *path, const char *output_dir, bool filelist,
	/* Write metafile */
	snprintf(repodb, sizeof(repodb), "%s/%s", output_dir,
		"meta");
-
	if ((mfile = fopen(repodb, "w")) != NULL) {
+
	if ((mfile = fopen(repodb, "we")) != NULL) {
		meta_dump = pkg_repo_meta_to_ucl(meta);
		ucl_object_emit_file(meta_dump, UCL_EMIT_CONFIG, mfile);
		fclose(mfile);
		strlcat(repodb, ".conf", sizeof(repodb));
-
		if ((mfile = fopen(repodb, "w")) != NULL) {
+
		if ((mfile = fopen(repodb, "we")) != NULL) {
			ucl_object_emit_file(meta_dump, UCL_EMIT_CONFIG, mfile);
			fclose(mfile);
		} else {
modified libpkg/rsa.c
@@ -50,7 +50,7 @@ _load_rsa_private_key(struct rsa_key *rsa)
{
	FILE *fp;

-
	if ((fp = fopen(rsa->path, "r")) == NULL)
+
	if ((fp = fopen(rsa->path, "re")) == NULL)
		return (EPKG_FATAL);

	if ((rsa->key = RSA_new()) == NULL) {
modified src/version.c
@@ -295,7 +295,7 @@ hash_indexfile(const char *indexfilename)
	/* Create a hash table of all the package names and port
	 * directories from the index file. */

-
	indexfile = fopen(indexfilename, "r");
+
	indexfile = fopen(indexfilename, "re");
	if (!indexfile)
		err(EX_NOINPUT, "Unable to open %s", indexfilename);