Coder Social home page Coder Social logo

Comments (5)

aniketpanjwani avatar aniketpanjwani commented on June 30, 2024

Good point - thanks! One fix is to just change env PATH=$(PATH) to env PATH=$(PATH):/sbin. That should only alter the PATH variable in the context of the sudo command. However, I'm actually not sure now whether env PATH=$(PATH) is needed in the first place, since we have absolute paths to the interpreter and reset.py. It's pretty late here, so I'll think about what to do about this tomorrow, but happy to hear your thoughts too.

from chomper.

sarg avatar sarg commented on June 30, 2024

Another option is to use python library for interacting with iptables - https://github.com/ldx/python-iptables

btw, iptables could be located in /usr/sbin too

from chomper.

aniketpanjwani avatar aniketpanjwani commented on June 30, 2024

Interesting library, but I'd rather not add on another dependency if it's not necessary.

Another idea: use which iptables to figure out where iptables is located on the system, parse out the directory, and make sure it's on path during the sudo command. Specifically, add the following new variable to the top of the Makefile

IPTABLES_PATH = dirname $(which iptables)

and then modify the reset task as follows

reset:
	sudo env PATH=$(PATH):$(IPTABLES_PATH) ${INTERPRETER}3.6m ${CURRENT_DIR}/chomper/reset.py

from chomper.

sarg avatar sarg commented on June 30, 2024

which works by searching current PATH. I suggest you to add /sbin:/usr/sbin to env and forget about this ticket until someone reports it again.

from chomper.

aniketpanjwani avatar aniketpanjwani commented on June 30, 2024

Yeah you're right - which isn't necessary if it's already on PATH. Let's just do what you're suggesting - add /sbin:/usr/sbin to the env.

Could you make a PR? Thanks!

from chomper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.