Alan Baugher

Execution Bit Recovery: Moving from MS Windows to Unix/Linux

Discussion created by Alan Baugher Employee on Feb 2, 2017
Latest reply on Feb 13, 2017 by Chris_Hackett

Team,

 

If you ever had to extract Linux files from an ISO, to a staging server, e.g. MS Windows, you may have noticed that the execution bits of the various shell scripts or binaries is now muddled.

 

If you don't wish to copy over the entire ISO image, and only need a small section, here is a method to assist with a resync of the execution bit.

 

Use SCP or FileZilla tools to copy files from MS Windows to Unix/Linux.

 

After the files / folders have been copied, create a shell script to reset the file permissions.

If the files follow a format of *.sh or *.ksh, this is fairly straight forward, without having to review each file.

 

Here is a process for CA Identity Manager / CA SSO and CA Directory:

 

 

#!/bin/bash
#############################################################################
#
# Update media folder permissions to allow execution
#
# Address permission issues when data is copied from MS Windows Servers/Workstations
#
#############################################################################

_MEDIAFOLDER_=/opt/media

################### The below find and replace permissions ################
################### will ensure that any files extracted on################
################### Windows OS and copied to Linux have the################
################### correct permission flags.              ################
find $_MEDIAFOLDER_/iso -type d                  -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name "*.sh"             -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name "*.bin"            -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name setup              -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name setup64            -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name uninstall          -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name getfqdn            -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name dxupgradecheck     -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name install_base       -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name uninstall_AC       -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name install_calic      -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name customize_eac_rpm  -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name smreg              -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name XPSSecurity        -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name "ca-sm-installer"  -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name kernparmchk.Linux  -exec chmod a+x {} \;
find $_MEDIAFOLDER_/iso -name Utf8toNative.Linux -exec chmod a+x {} \;

 

echo ""
echo "Done with update of execution permissions for media binaries"
echo ""

 

 

 

 

Cheers,

 

Alan

Outcomes