From e797936c4083e0efa7a730c842621b325eaa4610 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Mon, 27 Feb 2017 18:50:19 +0100 Subject: [PATCH] lib/repo_sync.c: sane umask for repodata files --- lib/repo_sync.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/repo_sync.c b/lib/repo_sync.c index bf303dd3..49767691 100644 --- a/lib/repo_sync.c +++ b/lib/repo_sync.c @@ -74,6 +74,7 @@ xbps_get_remote_repo_string(const char *uri) int HIDDEN xbps_repo_sync(struct xbps_handle *xhp, const char *uri) { + mode_t prev_umask; const char *arch, *fetchstr = NULL; char *repodata, *lrepodir, *uri_fixedp; int rv = 0; @@ -130,6 +131,7 @@ xbps_repo_sync(struct xbps_handle *xhp, const char *uri) /* * Download plist index file from repository. */ + prev_umask = umask(022); if ((rv = xbps_fetch_file(xhp, repodata, NULL)) == -1) { /* reposync error cb */ fetchstr = xbps_fetch_error_string(); @@ -139,6 +141,7 @@ xbps_repo_sync(struct xbps_handle *xhp, const char *uri) repodata, fetchstr ? fetchstr : strerror(errno)); } else if (rv == 1) rv = 0; + umask(prev_umask); free(repodata);