Giter VIP home page Giter VIP logo

Comments (1)

RoliSoft avatar RoliSoft commented on July 2, 2024 2

Hi,

Capabilities are not supported under WSL at this time. See my discussion here: microsoft/WSL#1303 (comment)

Regardless, the application should work properly as long as it has enough privileges to perform whatever it is trying to do, without needing to resort to capabilities. If you're running as root, you won't have problems. If you aren't, you'll have to make sure to track down what permissions it needs and to grant it accordingly, if possible.

As for the installer failing, you could use a nasty workaround. That is, compile a library with a no-op cap_set_file function, and load it with LD_PRELOAD.

echo -e "#include <sys/capability.h>\nint cap_set_file(const char *path_p, cap_t cap_p){return 0;}" > fakecap.c
gcc fakecap.c -shared -fPIC -o fakecap.so

Note: for sys/capability.h you will need libcap-dev on Debian. most likely libcap-devel on CentOS, but I haven't tested the latter.

You can check whether the library is working by trying to use setcap:

$ setcap CAP_NET_BIND_SERVICE=+eip test.txt
Failed to set capabilities on file `test.txt' (Operation not supported)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
$ LD_PRELOAD=./fakecap.so setcap CAP_NET_BIND_SERVICE=+eip test.txt; echo $?
0

As such, for yum you'd use it with:

$ LD_PRELOAD=./fakecap.so yum install iputils

from wsl-distribution-switcher.

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.