public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Matt Connell <matt@connell.tech>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Strange behaviour of iptables
Date: Wed, 01 Jan 2025 23:34:07 -0500	[thread overview]
Message-ID: <673fdadaaa7de7e12ac8d0f4c3443b18c0751ecc.camel@connell.tech> (raw)
In-Reply-To: <c60339e6-c175-7b74-bc79-fa0b070951f2@hanft.de>

On Wed, 2025-01-01 at 18:33 +0100, Matthias Hanft wrote:
> 
> So it seems that I can't use any parameters at all any more -
> from PHP.
> 
> What's the trick to get this working again?

Hmm.  I can't replicate this failure.  Using both `php -a` and foo.php,
I get expected results. (I'm using the INPUT chain because that's what
I have with real rules.)

---

   php > exec("/sbin/iptables -L INPUT -n -v -x -w", $iptables);   
   php > var_dump($iptables);                                      
   array(37) {                                                     
     [0]=>                                                         
     string(46) "Chain INPUT (policy ACCEPT 0 packets, 0 bytes)"   
   ...
   ...
   
---
   
   $ cat foo.php
   <?php
   exec("/sbin/iptables -L INPUT -n -v -x -w", $iptables);
   var_dump($iptables);
   $ php foo.php
   array(37) {                                                        
     [0]=>                                                            
     string(46) "Chain INPUT (policy ACCEPT 0 packets, 0 bytes)"
   ...
   ...
   
---

I noticed that your path to iptables is in /usr/bin/, but `which` on my
system says /sbin/.  Are you running this as root?  What version of PHP
are you using?



  reply	other threads:[~2025-01-02  4:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-01 17:33 [gentoo-user] Strange behaviour of iptables Matthias Hanft
2025-01-02  4:34 ` Matt Connell [this message]
2025-01-02  8:13   ` Matthias Hanft
2025-01-02  9:33     ` Alexis
2025-01-03 10:30       ` Matthias Hanft
2025-01-02 19:25     ` Matt Connell
2025-01-02 23:00       ` Ro Bra
2025-01-02 23:03       ` Ro Bra
2025-01-03  1:15         ` Matt Connell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=673fdadaaa7de7e12ac8d0f4c3443b18c0751ecc.camel@connell.tech \
    --to=matt@connell.tech \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox