Automatically set execute permission for downloaded executables from known sources

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












If I understand correctly, Ubuntu would only set read and write permissions for files downloaded from the internet because umask is applied to the files. Is there a way for files to have execute permissions when they are downloaded from trusted sources, say an internal server? Typically these files are archived as .zip.










share|improve this question

















  • 1




    Why would you want a .zip archive to be executable?
    – Byte Commander
    Jan 31 at 17:15










  • Sorry I meant to say binaries which are bundle in an archive when unzipped only have rw permissions. Now executable. I want these binaries to have x permissions by default when downloaded and unzipped.
    – jaykumarark
    Jan 31 at 17:55






  • 1




    Now that's an entirely different question and has nothing to do with the downloading, but only with how the archive was zipped and gets unzipped again. Zip archives preserve permissions by default, so if the binaries had Linux executable permission set when they were archived, these will be restored automatically.
    – Byte Commander
    Jan 31 at 18:04










  • Possibly one could write a script that unzips the archive and then checks all files for their type and make ELF files and scripts executable, but that might not always be desirable and is prone to errors. I might look into that later or tomorrow if you want that.
    – Byte Commander
    Jan 31 at 18:05










  • I see. I didn't know Zip archives preserve permissions. We have a build system which archives (using groovy scripts) our executables and puts it in a server. I thought that Ubuntu changes these permissions on download. In that case, I think I should be able to configure permissions in the groovy script. This is my hunch.
    – jaykumarark
    Jan 31 at 18:13















up vote
0
down vote

favorite












If I understand correctly, Ubuntu would only set read and write permissions for files downloaded from the internet because umask is applied to the files. Is there a way for files to have execute permissions when they are downloaded from trusted sources, say an internal server? Typically these files are archived as .zip.










share|improve this question

















  • 1




    Why would you want a .zip archive to be executable?
    – Byte Commander
    Jan 31 at 17:15










  • Sorry I meant to say binaries which are bundle in an archive when unzipped only have rw permissions. Now executable. I want these binaries to have x permissions by default when downloaded and unzipped.
    – jaykumarark
    Jan 31 at 17:55






  • 1




    Now that's an entirely different question and has nothing to do with the downloading, but only with how the archive was zipped and gets unzipped again. Zip archives preserve permissions by default, so if the binaries had Linux executable permission set when they were archived, these will be restored automatically.
    – Byte Commander
    Jan 31 at 18:04










  • Possibly one could write a script that unzips the archive and then checks all files for their type and make ELF files and scripts executable, but that might not always be desirable and is prone to errors. I might look into that later or tomorrow if you want that.
    – Byte Commander
    Jan 31 at 18:05










  • I see. I didn't know Zip archives preserve permissions. We have a build system which archives (using groovy scripts) our executables and puts it in a server. I thought that Ubuntu changes these permissions on download. In that case, I think I should be able to configure permissions in the groovy script. This is my hunch.
    – jaykumarark
    Jan 31 at 18:13













up vote
0
down vote

favorite









up vote
0
down vote

favorite











If I understand correctly, Ubuntu would only set read and write permissions for files downloaded from the internet because umask is applied to the files. Is there a way for files to have execute permissions when they are downloaded from trusted sources, say an internal server? Typically these files are archived as .zip.










share|improve this question













If I understand correctly, Ubuntu would only set read and write permissions for files downloaded from the internet because umask is applied to the files. Is there a way for files to have execute permissions when they are downloaded from trusted sources, say an internal server? Typically these files are archived as .zip.







permissions security downloads






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 31 at 17:09









jaykumarark

1011




1011







  • 1




    Why would you want a .zip archive to be executable?
    – Byte Commander
    Jan 31 at 17:15










  • Sorry I meant to say binaries which are bundle in an archive when unzipped only have rw permissions. Now executable. I want these binaries to have x permissions by default when downloaded and unzipped.
    – jaykumarark
    Jan 31 at 17:55






  • 1




    Now that's an entirely different question and has nothing to do with the downloading, but only with how the archive was zipped and gets unzipped again. Zip archives preserve permissions by default, so if the binaries had Linux executable permission set when they were archived, these will be restored automatically.
    – Byte Commander
    Jan 31 at 18:04










  • Possibly one could write a script that unzips the archive and then checks all files for their type and make ELF files and scripts executable, but that might not always be desirable and is prone to errors. I might look into that later or tomorrow if you want that.
    – Byte Commander
    Jan 31 at 18:05










  • I see. I didn't know Zip archives preserve permissions. We have a build system which archives (using groovy scripts) our executables and puts it in a server. I thought that Ubuntu changes these permissions on download. In that case, I think I should be able to configure permissions in the groovy script. This is my hunch.
    – jaykumarark
    Jan 31 at 18:13













  • 1




    Why would you want a .zip archive to be executable?
    – Byte Commander
    Jan 31 at 17:15










  • Sorry I meant to say binaries which are bundle in an archive when unzipped only have rw permissions. Now executable. I want these binaries to have x permissions by default when downloaded and unzipped.
    – jaykumarark
    Jan 31 at 17:55






  • 1




    Now that's an entirely different question and has nothing to do with the downloading, but only with how the archive was zipped and gets unzipped again. Zip archives preserve permissions by default, so if the binaries had Linux executable permission set when they were archived, these will be restored automatically.
    – Byte Commander
    Jan 31 at 18:04










  • Possibly one could write a script that unzips the archive and then checks all files for their type and make ELF files and scripts executable, but that might not always be desirable and is prone to errors. I might look into that later or tomorrow if you want that.
    – Byte Commander
    Jan 31 at 18:05










  • I see. I didn't know Zip archives preserve permissions. We have a build system which archives (using groovy scripts) our executables and puts it in a server. I thought that Ubuntu changes these permissions on download. In that case, I think I should be able to configure permissions in the groovy script. This is my hunch.
    – jaykumarark
    Jan 31 at 18:13








1




1




Why would you want a .zip archive to be executable?
– Byte Commander
Jan 31 at 17:15




Why would you want a .zip archive to be executable?
– Byte Commander
Jan 31 at 17:15












Sorry I meant to say binaries which are bundle in an archive when unzipped only have rw permissions. Now executable. I want these binaries to have x permissions by default when downloaded and unzipped.
– jaykumarark
Jan 31 at 17:55




Sorry I meant to say binaries which are bundle in an archive when unzipped only have rw permissions. Now executable. I want these binaries to have x permissions by default when downloaded and unzipped.
– jaykumarark
Jan 31 at 17:55




1




1




Now that's an entirely different question and has nothing to do with the downloading, but only with how the archive was zipped and gets unzipped again. Zip archives preserve permissions by default, so if the binaries had Linux executable permission set when they were archived, these will be restored automatically.
– Byte Commander
Jan 31 at 18:04




Now that's an entirely different question and has nothing to do with the downloading, but only with how the archive was zipped and gets unzipped again. Zip archives preserve permissions by default, so if the binaries had Linux executable permission set when they were archived, these will be restored automatically.
– Byte Commander
Jan 31 at 18:04












Possibly one could write a script that unzips the archive and then checks all files for their type and make ELF files and scripts executable, but that might not always be desirable and is prone to errors. I might look into that later or tomorrow if you want that.
– Byte Commander
Jan 31 at 18:05




Possibly one could write a script that unzips the archive and then checks all files for their type and make ELF files and scripts executable, but that might not always be desirable and is prone to errors. I might look into that later or tomorrow if you want that.
– Byte Commander
Jan 31 at 18:05












I see. I didn't know Zip archives preserve permissions. We have a build system which archives (using groovy scripts) our executables and puts it in a server. I thought that Ubuntu changes these permissions on download. In that case, I think I should be able to configure permissions in the groovy script. This is my hunch.
– jaykumarark
Jan 31 at 18:13





I see. I didn't know Zip archives preserve permissions. We have a build system which archives (using groovy scripts) our executables and puts it in a server. I thought that Ubuntu changes these permissions on download. In that case, I think I should be able to configure permissions in the groovy script. This is my hunch.
– jaykumarark
Jan 31 at 18:13
















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1001792%2fautomatically-set-execute-permission-for-downloaded-executables-from-known-sourc%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1001792%2fautomatically-set-execute-permission-for-downloaded-executables-from-known-sourc%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491