mkstemp will generate the temp file with permissions 0600 so the
umask(0644) is causing the file to have permissions of 0000, making
signature files unreadable
Signed-off-by: Brett Grandbois <brett.grandbois@opengear.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
unsigned char *buffer;
ssize_t r;
size_t l1;
- mode_t oldmask;
source_handle = fopen(source_file, "r");
if (!source_handle) {
return -1;
}
- oldmask = umask(0644);
destination_fd = mkstemp(template);
- umask(oldmask);
if (destination_fd < 0) {
pb_log("%s: unable to create temp file, %m\n", __func__);
fclose(source_handle);