whoown / droidwall

Automatically exported from code.google.com/p/droidwall
0 stars 0 forks source link

Applying and listing rules fails due to missing [ (test) on Samsung's Galaxy S I9000 #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
applying any change or to the iptable rules or trying to list the rules via 
"show rules"

What is the expected output? What do you see instead?
Expected: rules are applied. Message: "Rules applied with success".
Actual: Rules are not applied. Message:
<Start Message>
Error applying iptable rules.
Exit code: 1

[: not found
[: not found
[: not found
[: not found
--version: not found
</Message>
What version of the product are you using? On what operating system?
1.4.1

Please provide any additional information below.
On Samsung's Galaxy S I9000 the generated script droidwall.sh fails since [ aka 
test is not available (neither as a shell built-in nore separatley).

Intermediate solution: install [ using busybox. 

Original issue reported on code.google.com by vdtick1...@gmail.com on 12 Sep 2010 at 10:22

GoogleCodeExporter commented 9 years ago
Firmware 2.1-update1

Original comment by vdtick1...@gmail.com on 12 Sep 2010 at 10:25

GoogleCodeExporter commented 9 years ago
Wow, I assumed that "test" would be available everywhere.
I will try to fix it for the next release.

Original comment by rodrigo...@gmail.com on 13 Sep 2010 at 12:05

GoogleCodeExporter commented 9 years ago
Hello, can you please test the attached development version to see if it works 
for you now?

Please post the results here on this issue.
Thanks

Original comment by rodrigo...@gmail.com on 13 Sep 2010 at 7:55

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,
tested it and works fine. Interesting solution though.

Cheers

Original comment by vdtick1...@gmail.com on 14 Sep 2010 at 7:34

GoogleCodeExporter commented 9 years ago
I received some feedback from other users that don't have the "which" command, 
so this solution doesn't work for them! gosh
I did a much simpler verification script now. This one should work for everyone 
since it doesn't depend on any external commands.
If you could test the attached version too, I would appreciate. Thanks

Original comment by rodrigo...@gmail.com on 14 Sep 2010 at 1:57

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Tried droidwall on a soft-rooted HTC Wildfire, get the same "[: not found" 
error as vdtick1111 with standard release. Dev. release above solved that 
error, but gave way to some other errors. I get long error messages when I 
whitelist items. Even if it says the rules were saved without any error 
messages the firewall doesnt seem to be working. All apps can still access the 
internet even thoufh they're not whitelisted... Love the program, hope it'll 
work on a wildfire soon.

Original comment by noorland...@gmail.com on 14 Sep 2010 at 5:09

GoogleCodeExporter commented 9 years ago
Just to give an example When i whitelist for wifi: (Any application) and for 
3G: just ASTRO file manager, it shows me:

Error applying iptables rules.
Exit code: 1
iptables v1.4.7
iptables v1.4.7
Chain droidwall (33
references)
target  prot opt source
destination
grep: not found
iptables: No chain/target/
match by that name.

Original comment by noorland...@gmail.com on 14 Sep 2010 at 5:23

GoogleCodeExporter commented 9 years ago
On further experimenting it seems that "(any application) - same as selecting 
all applications" is the only checkmark that works. If I actually do check all 
apps separately, or even one, It won't work. 

Original comment by noorland...@gmail.com on 14 Sep 2010 at 8:05

GoogleCodeExporter commented 9 years ago
Sorry, but these new errors means that your kernel was not compiled with the 
necessary netfilter owner module.
It is not possible to make Droid Wall work on such kernel, so there is nothing 
more that I can do.

The original error, caused by the lack of a "[" command, has been fixed. Some 
users which had the same error reported that this dev version works for them so 
I am considering this as closed.

Original comment by rodrigo...@gmail.com on 15 Sep 2010 at 1:09

GoogleCodeExporter commented 9 years ago
Sorry, to spoil ...

I tested your last solution on my device.
I now get:
[2] Segmentation fault ${IPTABLES} --ve...

The reason for this seems to be (wild guess :) that your method to avoid test/[ 
isn't working.
I've tested it by inserting exit 0 after $IPTABLES is set in droidwall.sh.
# sh -x droidwall.sh
+ export IPTABLES=iptables
+ /data/data/com.googlecode.droidwall/cache/iptables_g1 --version
+
+ export IPTABLES=/data/data/com.googlecode.droidwall/cache/iptables_g1
+ echo Value of IPTABLES: /data/data/com.googlecode.droidwall/cache/iptables_g1
Value of IPTABLES: /data/data/com.googlecode.droidwall/cache/iptables_g1
+ exit 0

iptables_g1 throws the segmentation fault signal on my device, that probably 
prevents your code from working

When I delete "&" in your output redirection I get this:
+ export IPTABLES=iptables
+ /data/data/com.googlecode.droidwall/cache/iptables_g1 --version
[1]   Segmentation fault      /data/data/com.g...
+ /data/data/com.googlecode.droidwall/cache/iptables_n1 --version
+
+ export IPTABLES=/data/data/com.googlecode.droidwall/cache/iptables_n1
+ echo Value of IPTABLES: /data/data/com.googlecode.droidwall/cache/iptables_n1
Value of IPTABLES: /data/data/com.googlecode.droidwall/cache/iptables_n1
+ exit 0
# iptables v1.4.7

But at least the right iptables is selected!

Second thing is more of a syntax issue. I get a line in droidwall.sh like this:
$IPTABLES -F droidwall || exit 4$IPTABLES -A droidwall -o rmnet+ -m owner 
--uid-owner 10084 -j RETURN || exit

Should there be a CR after exit 4?

Cheers,

Original comment by vdtick1...@gmail.com on 15 Sep 2010 at 8:15

GoogleCodeExporter commented 9 years ago
vdtick1111,
Thanks for letting me know that. It is possible that the "&>/dev/null" 
redirection does not work on some phones (probably due to a simpler shell).
I also fixed the lack of CR on that line.

Could you please test the attached version?
Thanks

Original comment by rodrigo...@gmail.com on 15 Sep 2010 at 12:26

Attachments:

GoogleCodeExporter commented 9 years ago
Ah  I'm sorry, I thought my issue was the same, didn't mean to hijack the 
topic... Any chance Droidwall will ever be released for the Wildfire. I'm not 
above donating...^_^

Original comment by noorland...@gmail.com on 15 Sep 2010 at 3:54

GoogleCodeExporter commented 9 years ago
Hip hip hurray.
It seems to work now. Funny that &> is different from > 2>.
Cheers

Original comment by vdtick1...@gmail.com on 16 Sep 2010 at 3:45

GoogleCodeExporter commented 9 years ago
Great! Thank you for the debugging work ;)

Original comment by rodrigo...@gmail.com on 16 Sep 2010 at 6:17

GoogleCodeExporter commented 9 years ago
@rodrigo, i installed the version from comment #12, now when I make show rules 
it works longer and i get a diferent error message:

/data/data/com.googlecode.droidwall/cache/iptables_n1 
Chain INPUT (policy ACCEPT 2377K packet, 3315M bytes)
pkts bytes target   prot opt in  
out source
destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in
out source
destination

Chain OUTPUT (policy ACCEPT 1108K packes, 52M bytes)
pkts bytes target prot opt in
out source
destination
grep: not found
which: not found
[1] Segmentaion fault / data/data/com.g...

and here the box ends. Can I verify something on the phone?

Original comment by samichl...@gmail.com on 23 Sep 2010 at 10:11

GoogleCodeExporter commented 9 years ago
@samichlaus, you may try the latest development version (attached) - this 
version attempts to find "grep" automatically in the system, instead of 
assuming that it is available in the path.
Please let me know if it works for you. Thanks

Original comment by rodrigo...@gmail.com on 24 Sep 2010 at 12:12

Attachments:

GoogleCodeExporter commented 9 years ago
The latest dev. version just works fine. Great job. Grats and Thanks.

Original comment by htot...@gmail.com on 26 Sep 2010 at 7:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
just had an issue with not finding grep. Fixed by installing busybox. Now got a 
new error asking about insmod? Im using a LG GT540 on 1.6 V10D

Original comment by dum4...@googlemail.com on 27 Sep 2010 at 5:32

GoogleCodeExporter commented 9 years ago
Next version will include a simple busybox built-in, so installing busybox 
won't be necessary anymore :)

Now, for this "insmod" error - this means that your kernel was not compiled 
with netfilter support. Sorry, but your ROM cannot run Droid Wall.

Original comment by rodrigo...@gmail.com on 27 Sep 2010 at 9:15