Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Also unset SUID and SGID flags on extracted files, to prevent issues …
Browse files Browse the repository at this point in the history
  • Loading branch information
embray committed Jun 30, 2016
1 parent c6ce4aa commit 66d67dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/bin/sage-uncompress-spkg
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ from __future__ import print_function
import argparse
import copy
import os
import stat
import sys
import tarfile
import zipfile
Expand Down Expand Up @@ -115,6 +116,7 @@ class SageTarFile(tarfile.TarFile):
def chmod(self, tarinfo, target):
tarinfo = copy.copy(tarinfo)
tarinfo.mode &= ~self.umask
tarinfo.mode &= ~(stat.S_ISUID | stat.S_ISGID)
return super(SageTarFile, self).chmod(tarinfo, target)

def extractall(self, path='.', members=None):
Expand Down

0 comments on commit 66d67dc

Please sign in to comment.