Giter Club home page Giter Club logo

selix's People

Watchers

 avatar

Forkers

osmonds

selix's Issues

Prevent thread creation if current context equals target context

The target context == current context condition is only checked in set_context function called by the already created one-time thread. Because the goal of thread creation is transitioning to a new context, the target ctx == current ctx condition must be also checked prior to thread creation in order to avoid unnecessary threads and improve performance.

Check if target context exists before before setcon()

At the moment, if target security context doesn't exist an exception is raised with zend_error showing:

Fatal error: setcon() failed in Unknown on line 0

which is cryptic.
In order to give a more clear error depending on the situation (target context doesn't exist or unknown setcon() error), a check for target context existence must be added.

Security context doesn't get reset after a script compilation error

After a request returns a compilation error FPM process stucks in virtual host's security context without return in the default one (i.e. php_t).

Request raises a compilation error:
[*] Compiling /home/sephp/sephp-sandbox/webroot/selinux_test.php
[SC] Current context: system_u:system_r:php_t:s0
[SC] New context: system_u:system_r:sephp_php_t:s0
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/sephp/sephp-sandbox/webroot/selinux_test.php on line 69

Next request:
[*] Compiling /home/sephp/sephp-sandbox/webroot/selinux_test.php
[SC] Current context: system_u:system_r:sephp_php_t:s0
[SC] No context chages made

selix_php_import_environment_variables ugly loops

When the key gets deleted ( zend_hash_del() ) the next element becomes the current so there's no need to zend_hash_move_forward_ex(). The problem is that by being in the inner loop it isn't possible (in a clean way) continue the outer loop, thus the need to move backwards before remove the key in the inner loop.
A clean solution could be swith loops (inner becomes outer) in order to have the hash walking one "continuable".

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.