Skip to content

Commit 40564a4

Browse files
committed
Remove log4j references and update dependencies where needed.
1 parent 040dfbb commit 40564a4

File tree

6 files changed

+14
-40
lines changed

6 files changed

+14
-40
lines changed

src/examples/scripts/encryptProperties.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ cd ../java
4949
if [[ "$action" == "-display" ]]
5050
then
5151
set -x
52-
java -Dlog4j.configuration="file:$log4j_properties" \
53-
-Dorg.owasp.esapi.resources="$esapi_resources_test" \
52+
java -Dorg.owasp.esapi.resources="$esapi_resources_test" \
5453
-classpath "$esapi_classpath" \
5554
DisplayEncryptedProperties "$filename"
5655
else
@@ -65,8 +64,7 @@ else
6564
echo
6665
echo "Hit <Enter> to continue..."; read GO
6766
set -x
68-
java -Dlog4j.configuration="file:$log4j_properties" \
69-
-Dorg.owasp.esapi.resources="$esapi_resources_test" \
67+
java -Dorg.owasp.esapi.resources="$esapi_resources_test" \
7068
-classpath "$esapi_classpath" \
7169
org.owasp.esapi.reference.crypto.DefaultEncryptedProperties "$filename" &&
7270
echo "Output of encrypted properties in file: $filename"

src/examples/scripts/persistEncryptedData.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ set -x
2323
# Since this is just an illustration, we will use the test ESAPI.properties in
2424
# $esapi_resources_test. That way, it won't matter if the user has neglected
2525
# to run the 'setMasterKey.sh' example before running this one.
26-
java -Dlog4j.configuration="file:$log4j_properties" \
27-
-Dorg.owasp.esapi.resources="$esapi_resources_test" \
28-
-ea -classpath "$esapi_classpath" \
29-
PersistedEncryptedData "$@"
26+
java -Dorg.owasp.esapi.resources="$esapi_resources_test" \
27+
-ea -classpath "$esapi_classpath" \
28+
PersistedEncryptedData "$@"

src/examples/scripts/runClass.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ then echo >2&1 "Can't find class file: ${className}.class"
1919
exit 1
2020
fi
2121
echo "Your ESAPI.properties file: ${esapi_resources_test:?}/ESAPI.properties"
22-
echo "Your log4j properties file: ${log4j_properties:?}"
2322
echo
2423
set -x
25-
java -Dlog4j.configuration="file:$log4j_properties" \
26-
-Dorg.owasp.esapi.resources="$esapi_resources_test" \
24+
java -Dorg.owasp.esapi.resources="$esapi_resources_test" \
2725
-classpath "$esapi_classpath" \
2826
${className} "$@"

src/examples/scripts/setMasterKey.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ echo
1616
# set -x
1717
# This should use the real ESAPI.properties in $esapi_resources that does
1818
# not yet have Encryptor.MasterKey and Encryptor.MasterSalt yet set.
19-
java -Dlog4j.configuration="file:$log4j_properties" \
20-
-Dorg.owasp.esapi.resources="$esapi_resources" \
19+
java -Dorg.owasp.esapi.resources="$esapi_resources" \
2120
-classpath "$esapi_classpath" \
2221
org.owasp.esapi.reference.crypto.JavaEncryptor "$@"

src/examples/scripts/setenv-svn.sh

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,17 @@
99
# where '$' represents the shell command line prompt.
1010
###########################################################################
1111

12-
# IMPORTANT NOTE: Since you may have multiple (say) log4j jars under
13-
# your Maven2 repository under $HOME/.m2/respository, we
14-
# look for the specific versions that ESAPI was using as of
15-
# ESAPI 2.0_RC10 release on 2010/10/18. If these versions
16-
# changed, they will have to be reflected here.
17-
#
12+
# IMPORTANT NOTE: These dependency versions may need updated. Should match
13+
# what is in ESAPI's pom.xml.
1814
esapi_classpath=".:\
1915
../../../target/classes:\
2016
$(ls ../../../target/esapi-*.jar 2>&- || echo .):\
21-
$(./findjar.sh log4j-1.2.17.jar):\
22-
$(./findjar.sh commons-fileupload-1.3.1.jar):\
23-
$(./findjar.sh servlet-api-2.5.jar)"
17+
$(./findjar.sh commons-fileupload-1.4.jar):\
18+
$(./findjar.sh servlet-api-3.1.0.jar)"
2419

2520
esapi_resources="$(\cd ../../../configuration/esapi >&- 2>&- && pwd)"
2621
esapi_resources_test="$(\cd ../../../src/test/resources/esapi >&- 2>&- && pwd)"
2722

28-
log4j_properties="../../../src/test/resources/log4j.xml"
2923

3024
if [[ ! -r "$esapi_resources"/ESAPI.properties ]]
3125
then echo 2>&1 "setenv-svn.sh: Can't read ESAPI.properties in $esapi_resources"
@@ -37,16 +31,10 @@ then echo 2>&1 "setenv-svn.sh: Can't read ESAPI.properties in $esapi_resources_t
3731
return 1 # Don't use 'exit' here or it will kill their current shell.
3832
fi
3933

40-
if [[ ! -r "$log4j_properties" ]]
41-
then echo 2>&1 "setenv-svn.sh: Can't read log4j.xml: $log4j_properties"
42-
return 1 # Don't use 'exit' here or it will kill their current shell.
43-
fi
44-
4534
echo ############################################################
4635
echo "esapi_resources=$esapi_resources"
4736
echo "esapi_resources_test=$esapi_resources_test"
48-
echo "log4j_properties=$log4j_properties"
4937
echo "esapi_classpath=$esapi_classpath"
5038
echo ############################################################
5139

52-
export esapi_classpath esapi_resources esapi_resources_test log4j_properties
40+
export esapi_classpath esapi_resources esapi_resources_test

src/examples/scripts/setenv-zip.sh

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@
1212
# Here we don't look for the specific versions of the dependent libraries
1313
# since the specific version of the library is delivered as part of the
1414
# ESAPI zip file. In this manner, we do not have to update this if these
15-
# versions change. For the record, at the time of this writing, these were
16-
# log4j-1.2.17.jar, commons-fileupload-1.3.1.jar, and servlet-api-2.5.jar.
15+
# versions change.
1716
esapi_classpath=".:\
1817
$(ls ../../../esapi*.jar):\
19-
$(./findjar.sh -start ../../../libs log4j-*.jar):\
2018
$(./findjar.sh -start ../../../libs commons-fileupload-*.jar):\
2119
$(./findjar.sh -start ../../../libs servlet-api-*.jar)"
2220

2321
esapi_resources="$(\cd ../../../configuration/esapi >&- 2>&- && pwd)"
2422
esapi_resources_test="$(\cd ../../../src/test/resources/esapi >&- 2>&- && pwd)"
2523

26-
log4j_properties="../../../src/test/resources/log4j.xml"
2724

2825
if [[ ! -r "$esapi_resources"/ESAPI.properties ]]
2926
then echo 2>&1 "setenv-svn.sh: Can't read ESAPI.properties in $esapi_resources"
@@ -35,16 +32,11 @@ then echo 2>&1 "setenv-svn.sh: Can't read ESAPI.properties in $esapi_resources_t
3532
return 1 # Don't use 'exit' here or it will kill their current shell.
3633
fi
3734

38-
if [[ ! -r "$log4j_properties" ]]
39-
then echo 2>&1 "setenv-svn.sh: Can't read log4j.xml: $log4j_properties"
40-
return 1 # Don't use 'exit' here or it will kill their current shell.
41-
fi
4235

4336
echo ############################################################
4437
echo "esapi_resources=$esapi_resources"
4538
echo "esapi_resources_test=$esapi_resources_test"
46-
echo "log4j_properties=$log4j_properties"
4739
echo "esapi_classpath=$esapi_classpath"
4840
echo ############################################################
4941

50-
export esapi_classpath esapi_resources esapi_resources_test log4j_properties
42+
export esapi_classpath esapi_resources esapi_resources_test

0 commit comments

Comments
 (0)