Ignore:
Timestamp:
Oct 27, 2016, 1:30:40 PM (3 years ago)
Author:
mabarracus
Message:

allow oracle java

File:
1 edited

Legend:

Unmodified
Added
Removed
  • flash-java-insecure-perms/trunk/fuentes/flash-java-insecure-perms/usr/bin/flash-java-insecure-perms

    r2692 r2700  
    3636fi
    3737
     38CERTPATHS=".config/icedtea-web/security .java/deployment/security"
    3839DONE=0
    3940if [ "x$1" = "xinstall" ]; then
    4041
    41 for x in ${DIALOG}; do
     42for user in ${DIALOG}; do
    4243    DATE=$(date '+%Y%m%d%H%M%S')
    4344
    44     if [ ! -f "/home/$x/.config/unsec_settings_on" ]; then
     45    if [ ! -f "/home/$user/.config/unsec_settings_on" ]; then
    4546        # JAVA
    4647        if [ ! -z "${ICED}" ]; then
    4748            if [ "${IAM}" = "0" ];then
    48                 sudo su $x bash -c "${ICED} -headless set deployment.security.level ALLOW_UNSIGNED"
     49                sudo su $user bash -c "${ICED} -headless set deployment.security.level ALLOW_UNSIGNED"
    4950            else
    5051                ${ICED} -headless set deployment.security.level ALLOW_UNSIGNED
     
    5455            certname=${cert%%.cert}
    5556            echo Importing into trusted.certs ${certname}.cert
    56             if [ ! -f "/home/$x/.config/icedtea-web/security/trusted.certs" ]; then
    57                 mkdir -p /home/$x/.config/icedtea-web/security/
    58                 ${KEYTOOL} -genkey -alias recursos -keyalg RSA -keystore /home/$x/.config/icedtea-web/security/trusted.certs -keypass changeit -storepass changeit -keysize 2048 -dname "CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown"
    59                 ${KEYTOOL} -delete -alias recursos -keystore /home/$x/.config/icedtea-web/security/trusted.certs -storepass changeit
    60                 if [ "${IAM}" = "0" ]; then
    61                     chown -R ${x}:${x} /home/$x/.config/icedtea-web/security/
     57            for certpath in ${CERTPATHS}; do
     58                if [ ! -f "/home/$user/${certpath}/trusted.certs" ]; then
     59                    mkdir -p /home/$user/${certpath}
     60                    ${KEYTOOL} -genkey -alias recursos -keyalg RSA -keystore /home/$user/${certpath}/trusted.certs -keypass changeit -storepass changeit -keysize 2048 -dname "CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown" > /dev/null 2> /dev/null
     61                    ${KEYTOOL} -delete -alias recursos -keystore /home/$user/${certpath}/trusted.certs -storepass changeit > /dev/null 2> /dev/null
     62                    if [ "${IAM}" = "0" ]; then
     63                        chown -R ${user}:${user} /home/$user/${certpath}/
     64                    fi
    6265                fi
    63             fi
    64             $KEYTOOL -importcert -trustcacerts -storepass "changeit" -keystore /home/$x/.config/icedtea-web/security/trusted.certs -file ${cert} -alias ${certname} -noprompt
     66                $KEYTOOL -importcert -trustcacerts -storepass "changeit" -keystore /home/$user/${certpath}/trusted.certs -file ${cert} -alias ${certname} -noprompt > /dev/null 2> /dev/null
     67            done
    6568        done
    6669        #FLASH
    67         if [ ! -d "/home/$x/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys" ]; then
    68             mkdir -p /home/$x/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys
     70        if [ ! -d "/home/$user/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys" ]; then
     71            mkdir -p /home/$user/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys
    6972        fi
    70         if [ ! -d "/home/$x/.macromedia/Flash_Player/#Security/FlashPlayerTrust" ]; then
    71             mkdir -p "/home/$x/.macromedia/Flash_Player/#Security/FlashPlayerTrust"
     73        if [ ! -d "/home/$user/.macromedia/Flash_Player/#Security/FlashPlayerTrust" ]; then
     74            mkdir -p "/home/$user/.macromedia/Flash_Player/#Security/FlashPlayerTrust"
    7275        fi
    73         if [ -f "/home/$x/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings.sol" ]; then
    74             mv /home/$x/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings.sol /home/$x/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings-${DATE}.sol
     76        if [ -f "/home/$user/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings.sol" ]; then
     77            mv /home/$user/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings.sol /home/$user/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings-${DATE}.sol
    7578        fi
    76         if [ -f "/home/$x/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos.cfg" ]; then
    77             mv "/home/$x/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos.cfg" "/home/$x/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos-${DATE}.cfg"
     79        if [ -f "/home/$user/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos.cfg" ]; then
     80            mv "/home/$user/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos.cfg" "/home/$user/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos-${DATE}.cfg"
    7881        fi
    79         cp /usr/share/flash-java-insecure-perms/settings.sol /home/$x/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys
    80         cp /usr/share/flash-java-insecure-perms/recursos.cfg "/home/$x/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos.cfg"
    81         chown -R ${x}:${x} /home/$x/.macromedia
    82         touch /home/$x/.config/unsec_settings_on
     82        cp /usr/share/flash-java-insecure-perms/settings.sol /home/$user/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys
     83        cp /usr/share/flash-java-insecure-perms/recursos.cfg "/home/$user/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos.cfg"
     84        chown -R ${user}:${user} /home/$user/.macromedia
     85        touch /home/$user/.config/unsec_settings_on
    8386        #FIREFOX
    84         pkill -u $x --signal 9 firefox
    85         for pref in $(find /home/$x/.mozilla -name 'prefs.js'); do
     87        if [ ! -d "/home/$user/.mozilla" ]; then
     88            mkdir -p /home/$user/.mozilla
     89            if [ "${IAM}" = "0" ]; then
     90                chown -R ${user}:${user} /home/$user/.mozilla
     91                sudo su $user bash -c "firefox" &
     92            else
     93                firefox &
     94            fi
     95            sleep 2
     96        fi
     97        pkill -u $user --signal 9 firefox
     98        for pref in $(find /home/$user/.mozilla -name 'prefs.js'); do
    8699            sed -i -r 's%.*plugin\.state\.java.*%%' $pref
    87100            sed -i -r 's%.*plugin\.state\.flash.*%%' $pref
     
    104117if [ "x$1" = "xdeinstall" ]; then
    105118
    106     for x in ${USERS}; do
    107         if [ -f "/home/$x/.config/unsec_settings_on" ]; then
    108             echo Deconfiguring $x!
     119    for user in ${USERS}; do
     120        if [ -f "/home/$user/.config/unsec_settings_on" ]; then
     121            echo Deconfiguring $user!
    109122            #FLASH
    110             file1=$(find /home/$x/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys -maxdepth 1 -name '*.sol'|grep 'settings-'|sort -h|uniq|head -1)
     123            file1=$(find /home/$user/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys -maxdepth 1 -name '*.sol'|grep 'settings-'|sort -h|uniq|head -1)
    111124            if [ ! -z "$file1" ]; then
    112                 mv $file1 /home/$x/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings.sol
     125                mv $file1 /home/$user/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings.sol
    113126            fi
    114             if [ -f "/home/$x/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos.cfg" ]; then
    115                 rm -f "/home/$x/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos.cfg"
     127            if [ -f "/home/$user/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos.cfg" ]; then
     128                rm -f "/home/$user/.macromedia/Flash_Player/#Security/FlashPlayerTrust/recursos.cfg"
    116129            fi
    117130            #JAVA
    118131            if [ ! -z "${ICED}" ]; then
    119132                if [ "${IAM}" = "0" ];then
    120                     sudo su $x bash -c "${ICED} -headless reset deployment.security.level"
     133                    sudo su $user bash -c "${ICED} -headless reset deployment.security.level"
    121134                else
    122135                    ${ICED} -headless reset deployment.security.level
     
    126139                certname=${cert%%.cert}
    127140                echo Deleting ${certname}.cert from trusted.certs
    128                 $KEYTOOL -delete -storepass "changeit" -keystore /home/$x/.config/icedtea-web/security/trusted.certs -alias ${certname}
     141                for certpath in ${CERTPATHS}; do
     142                    if [ -f "/home/$user/${certpath}/trusted.certs" ]; then
     143                        $KEYTOOL -delete -storepass "changeit" -keystore /home/$user/${certpath}/trusted.certs -alias ${certname} > /dev/null 2> /dev/null
     144                    fi
     145                done
    129146            done
    130             rm /home/$x/.config/unsec_settings_on
    131             pkill -u $x --signal 9 firefox
    132             for pref in $(find /home/$x/.mozilla -name 'prefs.js'); do
     147            rm /home/$user/.config/unsec_settings_on
     148            pkill -u $user --signal 9 firefox
     149            for pref in $(find /home/$user/.mozilla -name 'prefs.js'); do
    133150                sed -i -r 's%.*plugin\.state\.java.*%user_pref("plugin.state.java",1);%' $pref
    134151                sed -i -r 's%.*plugin\.state\.flash.*%user_pref("plugin.state.flash",1);%' $pref
Note: See TracChangeset for help on using the changeset viewer.