lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master b662b8f 2/3: Fix permissions after extracting


From: Greg Chicares
Subject: [lmi-commits] [lmi] master b662b8f 2/3: Fix permissions after extracting archives
Date: Sun, 10 May 2020 20:44:15 -0400 (EDT)

branch: master
commit b662b8ff820def134ba75487c0ab7eddf601c292
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Fix permissions after extracting archives
    
    Files extracted from archives may have more restrictive permissions
    than a umask such as 0002 would allow, so force the same permissions
    for group as for user.
    
    For many extracted files, this may matter rarely if ever, but there's
    no compelling reason not to do it. Actual use cases do exist: e.g.,
    a group user may want to modify a library source file. Furthermore,
    searching for files in /opt/lmi with more restrictive group than user
    permissions can reveal potential problems, and it's preferable for the
    results of such a search to be uncluttered by extracted files.
---
 install_mingw.make       | 2 ++
 install_mingw32.make     | 2 ++
 install_miscellanea.make | 5 +++++
 3 files changed, 9 insertions(+)

diff --git a/install_mingw.make b/install_mingw.make
index 83d70b5..7e3ff28 100644
--- a/install_mingw.make
+++ b/install_mingw.make
@@ -66,6 +66,7 @@ $(MinGW-8_1_0)-md5 := ebe9cf22aa13c9e34f5e684a79efaf8e
 # Utilities 
####################################################################
 
 BSDTAR := bsdtar
+CHMOD  := chmod
 CP     := cp
 ECHO   := echo
 MD5SUM := md5sum
@@ -124,3 +125,4 @@ WGETFLAGS := --no-verbose
        cd $(cache_dir) && [ -e $@ ] || $(WGET) $(WGETFLAGS) $(mirror)/$@
        cd $(cache_dir) && $(ECHO) "$($@-md5) *$@" | $(MD5SUM) --check
        $(BSDTAR) --extract $(BSDTARFLAGS) --directory=$(ad_hoc_dir) 
--file=$(cache_dir)/$@
+       $(CHMOD) -R g=u $(ad_hoc_dir)
diff --git a/install_mingw32.make b/install_mingw32.make
index 342a112..c605f29 100644
--- a/install_mingw32.make
+++ b/install_mingw32.make
@@ -74,6 +74,7 @@ $(MinGW-8_1_0)-md5 := 28ec1e65ab85a9e1043998516045ab62
 # Utilities 
####################################################################
 
 BSDTAR := bsdtar
+CHMOD  := chmod
 CP     := cp
 ECHO   := echo
 MD5SUM := md5sum
@@ -132,3 +133,4 @@ WGETFLAGS := --no-verbose
        cd $(cache_dir) && [ -e $@ ] || $(WGET) $(WGETFLAGS) $(mirror)/$@
        cd $(cache_dir) && $(ECHO) "$($@-md5) *$@" | $(MD5SUM) --check
        $(BSDTAR) --extract $(BSDTARFLAGS) --directory=$(ad_hoc_dir) 
--file=$(cache_dir)/$@
+       $(CHMOD) -R g=u $(ad_hoc_dir)
diff --git a/install_miscellanea.make b/install_miscellanea.make
index 507c8f3..dfd9019 100644
--- a/install_miscellanea.make
+++ b/install_miscellanea.make
@@ -80,6 +80,7 @@ $(xmlwrapp_archive)-md5 := 5e8ac678ab03b7c60ce61ac5424e0849
 
 # Utilities 
####################################################################
 
+CHMOD  := chmod
 CP     := cp
 DIFF   := diff
 ECHO   := echo
@@ -158,6 +159,7 @@ all: boost cgicc jing sample trang xmlwrapp
 .PHONY: boost
 boost: $(file_list)
        -[ -e $(stem).patch ] && $(PATCH) --directory=$(ad_hoc_dir) --strip=1 < 
$(stem).patch
+       $(CHMOD) -R g=u $(ad_hoc_dir)/$(stem)
        $(MKDIR) $(third_party_include_dir)/boost/
        $(CP) --force --preserve --recursive $(ad_hoc_dir)/$(stem)/boost/* 
$(third_party_include_dir)/boost/
        $(MKDIR) $(third_party_source_dir)/boost/
@@ -178,6 +180,7 @@ cgicc: $(file_list)
 
 .PHONY: jing
 jing: $(file_list)
+       $(CHMOD) -R g=u $(ad_hoc_dir)/$(stem)
        $(MKDIR) --parents $(dest_dir)/rng
        $(MV) $(ad_hoc_dir)/$(stem)/bin/$@.jar         $(dest_dir)/rng
        $(MV) $(ad_hoc_dir)/$(stem)/bin/xercesImpl.jar $(dest_dir)/rng
@@ -193,12 +196,14 @@ sample: $(file_list)
 
 .PHONY: trang
 trang: $(file_list)
+       $(CHMOD) -R g=u $(ad_hoc_dir)/$(stem)
        $(MKDIR) --parents $(dest_dir)/rng
        $(MV) $(ad_hoc_dir)/$(stem)/$@.jar $(dest_dir)/rng
 
 .PHONY: xmlwrapp
 xmlwrapp: $(file_list)
        -[ -e $(stem).patch ] && $(PATCH) --directory=$(ad_hoc_dir) --strip=1 < 
$(stem).patch
+       $(CHMOD) -R g=u $(ad_hoc_dir)/$(stem)
        $(MKDIR) $(third_party_include_dir)/xmlwrapp/
        $(MV) $(ad_hoc_dir)/$(stem)/include/xmlwrapp/*.h 
$(third_party_include_dir)/xmlwrapp/
        $(MKDIR) $(third_party_include_dir)/xsltwrapp/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]