Current File : //bin/sandbox
#! /usr/libexec/platform-python -EsI
# Authors: Dan Walsh <dwalsh@redhat.com>
# Authors: Thomas Liu <tliu@fedoraproject.org>
# Authors: Josh Cogliati
#
# Copyright (C) 2009,2010  Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; version 2 only
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

import os
import stat
import sys
import socket
import random
import fcntl
import shutil
import re
import subprocess
import selinux
import signal
from tempfile import mkdtemp
import pwd
import sepolicy

SEUNSHARE = "/usr/sbin/seunshare"
SANDBOXSH = "/usr/share/sandbox/sandboxX.sh"
PROGNAME = "selinux-sandbox"
try:
    import gettext
    kwargs = {}
    if sys.version_info < (3,):
        kwargs['unicode'] = True
    gettext.install(PROGNAME,
                    localedir="/usr/share/locale",
                    codeset='utf-8',
                    **kwargs)
except:
    try:
        import builtins
        builtins.__dict__['_'] = str
    except ImportError:
        import __builtin__
        __builtin__.__dict__['_'] = unicode

DEFAULT_WINDOWSIZE = "1000x700"
DEFAULT_TYPE = "sandbox_t"
DEFAULT_X_TYPE = "sandbox_x_t"
SAVE_FILES = {}

random.seed(None)


def sighandler(signum, frame):
    signal.signal(signum, signal.SIG_IGN)
    os.kill(0, signum)
    raise KeyboardInterrupt


def setup_sighandlers():
    signal.signal(signal.SIGHUP, sighandler)
    signal.signal(signal.SIGQUIT, sighandler)
    signal.signal(signal.SIGTERM, sighandler)


def error_exit(msg):
    sys.stderr.write("%s: " % sys.argv[0])
    sys.stderr.write("%s\n" % msg)
    sys.stderr.flush()
    sys.exit(1)


def copyfile(file, srcdir, dest):
    import re
    if file.startswith(srcdir):
        dname = os.path.dirname(file)
        bname = os.path.basename(file)
        if dname == srcdir:
            dest = dest + "/" + bname
        else:
            newdir = re.sub(srcdir, dest, dname)
            if not os.path.exists(newdir):
                os.makedirs(newdir)
            dest = newdir + "/" + bname

        try:
            if os.path.isdir(file):
                shutil.copytree(file, dest)
            else:
                shutil.copy2(file, dest)

        except shutil.Error as elist:
            for e in elist.message:
                sys.stderr.write(e[2])

        SAVE_FILES[file] = (dest, os.path.getmtime(dest))


def savefile(new, orig, X_ind):
    copy = False
    if(X_ind):
        import gi
        gi.require_version('Gtk', '3.0')
        from gi.repository import Gtk
        dlg = Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO,
                                Gtk.ButtonsType.YES_NO,
                                _("Do you want to save changes to '%s' (Y/N): ") % orig)
        dlg.set_title(_("Sandbox Message"))
        dlg.set_position(Gtk.WindowPosition.MOUSE)
        dlg.show_all()
        rc = dlg.run()
        dlg.destroy()
        if rc == Gtk.ResponseType.YES:
            copy = True
    else:
        try:
            input = raw_input
        except NameError:
            pass
        ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig)
        if(re.match(_("[yY]"), ans)):
            copy = True
    if(copy):
        shutil.copy2(new, orig)


def reserve(level):
    sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
    sock.bind("\0%s" % level)
    fcntl.fcntl(sock.fileno(), fcntl.F_SETFD, fcntl.FD_CLOEXEC)


def get_range():
    try:
        level = selinux.getcon_raw()[1].split(":")[4]
        lowc, highc = level.split(".")
        low = int(lowc[1:])
        high = int(highc[1:]) + 1
        if high - low == 0:
            raise IndexError

        return low, high
    except IndexError:
        raise ValueError(_("User account must be setup with an MCS Range"))


def gen_mcs():
    low, high = get_range()

    level = None
    ctr = 0
    total = high - low
    total = (total * (total - 1)) / 2
    while ctr < total:
        ctr += 1
        i1 = random.randrange(low, high)
        i2 = random.randrange(low, high)
        if i1 == i2:
            continue
        if i1 > i2:
            tmp = i1
            i1 = i2
            i2 = tmp
        level = "s0:c%d,c%d" % (i1, i2)
        try:
            reserve(level)
        except socket.error:
            continue
        break
    if level:
        return level
    raise ValueError(_("Failed to find any unused category sets.  Consider a larger MCS range for this user."))


def fullpath(cmd):
    for i in ["/", "./", "../"]:
        if cmd.startswith(i):
            return cmd
    for i in os.environ["PATH"].split(':'):
        f = "%s/%s" % (i, cmd)
        if os.access(f, os.X_OK):
            return f
    return cmd


class Sandbox:
    SYSLOG = "/var/log/messages"

    def __init__(self):
        self.setype = DEFAULT_TYPE
        self.__options = None
        self.__cmds = None
        self.__init_files = []
        self.__paths = []
        self.__mount = False
        self.__level = None
        self.__homedir = None
        self.__tmpdir = None

    def __validate_mount(self):
        if self.__options.level:
            if not self.__options.homedir or not self.__options.tmpdir:
                self.usage(_("Homedir and tempdir required for level mounts"))

        if not os.path.exists(SEUNSHARE):
            raise ValueError(_("""
%s is required for the action you want to perform.
""") % SEUNSHARE)

    def __mount_callback(self, option, opt, value, parser):
        self.__mount = True

    def __x_callback(self, option, opt, value, parser):
        self.__mount = True
        setattr(parser.values, option.dest, True)
        if not os.path.exists(SEUNSHARE):
            raise ValueError(_("""
%s is required for the action you want to perform.
""") % SEUNSHARE)

        if not os.path.exists(SANDBOXSH):
            raise ValueError(_("""
%s is required for the action you want to perform.
""") % SANDBOXSH)

    def __validdir(self, option, opt, value, parser):
        if not os.path.isdir(value):
            raise IOError("Directory " + value + " not found")
        setattr(parser.values, option.dest, value)
        self.__mount = True

    def __include(self, option, opt, value, parser):
        rp = os.path.realpath(os.path.expanduser(value))
        if not os.path.exists(rp):
            raise IOError(value + " not found")

        if rp not in self.__init_files:
            self.__init_files.append(rp)

    def __includefile(self, option, opt, value, parser):
        fd = open(value, "r")
        for i in fd.readlines():
            try:
                self.__include(option, opt, i[:-1], parser)
            except IOError as e:
                sys.stderr.write(str(e))
            except TypeError as e:
                sys.stderr.write(str(e))
        fd.close()

    def __copyfiles(self):
        files = self.__init_files + self.__paths
        homedir = pwd.getpwuid(os.getuid()).pw_dir
        for f in files:
            copyfile(f, homedir, self.__homedir)
            copyfile(f, "/tmp", self.__tmpdir)
            copyfile(f, "/var/tmp", self.__tmpdir)

    def __setup_sandboxrc(self, wm="/usr/bin/matchbox-window-manager"):
        execfile = self.__homedir + "/.sandboxrc"
        fd = open(execfile, "w+")
        if self.__options.session:
            fd.write("""#!/bin/sh
#TITLE: /etc/gdm/Xsession
/etc/gdm/Xsession
""")
        else:
            command = self.__paths[0] + " "
            for p in self.__paths[1:]:
                command += "'%s' " % p
            fd.write("""#! /bin/sh
#TITLE: %s
# /usr/bin/test -r ~/.xmodmap && /usr/bin/xmodmap ~/.xmodmap
%s &
WM_PID=$!
if which dbus-run-session >/dev/null 2>&1; then
    dbus-run-session -- %s
else
    dbus-launch --exit-with-session %s
fi
kill -TERM $WM_PID  2> /dev/null
""" % (command, wm, command, command))
        fd.close()
        os.chmod(execfile, 0o700)

    def usage(self, message=""):
        error_exit("%s\n%s" % (self.__parser.usage, message))

    def __parse_options(self):
        from optparse import OptionParser
        types = ""
        try:
            types = _("""
Policy defines the following types for use with the -t:
\t%s
""") % "\n\t".join(next(sepolicy.info(sepolicy.ATTRIBUTE, "sandbox_type"))['types'])
        except StopIteration:
            pass

        usage = _("""
sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [-W windowmanager ] [ -w windowsize ] [[-i file ] ...] [ -t type ] command

sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [-W windowmanager ] [ -w windowsize ] [[-i file ] ...] [ -t type ] -S
%s
""") % types

        parser = OptionParser(usage=usage)
        parser.disable_interspersed_args()
        parser.add_option("-i", "--include",
                          action="callback", callback=self.__include,
                          type="string",
                          help=_("include file in sandbox"))
        parser.add_option("-I", "--includefile", action="callback", callback=self.__includefile,
                          type="string",
                          help=_("read list of files to include in sandbox from INCLUDEFILE"))
        parser.add_option("-t", "--type", dest="setype", action="store", default=None,
                          help=_("run sandbox with SELinux type"))
        parser.add_option("-M", "--mount",
                          action="callback", callback=self.__mount_callback,
                          help=_("mount new home and/or tmp directory"))

        parser.add_option("-d", "--dpi",
                          dest="dpi", action="store",
                          help=_("dots per inch for X display"))

        parser.add_option("-S", "--session", action="store_true", dest="session",
                          default=False, help=_("run complete desktop session within sandbox"))

        parser.add_option("-s", "--shred", action="store_true", dest="shred",
                          default=False, help=_("Shred content before tempory directories are removed"))

        parser.add_option("-X", dest="X_ind",
                          action="callback", callback=self.__x_callback,
                          default=False, help=_("run X application within a sandbox"))

        parser.add_option("-H", "--homedir",
                          action="callback", callback=self.__validdir,
                          type="string",
                          dest="homedir",
                          help=_("alternate home directory to use for mounting"))

        parser.add_option("-T", "--tmpdir", dest="tmpdir",
                          type="string",
                          action="callback", callback=self.__validdir,
                          help=_("alternate /tmp directory to use for mounting"))

        parser.add_option("-w", "--windowsize", dest="windowsize",
                          type="string", default=DEFAULT_WINDOWSIZE,
                          help="size of the sandbox window")

        parser.add_option("-W", "--windowmanager", dest="wm",
                          type="string",
                          default="/usr/bin/matchbox-window-manager",
                          help=_("alternate window manager"))

        parser.add_option("-l", "--level", dest="level",
                          help=_("MCS/MLS level for the sandbox"))

        parser.add_option("-C", "--capabilities",
                          action="store_true", dest="usecaps", default=False,
                          help="Allow apps requiring capabilities to run within the sandbox.")

        self.__parser = parser

        self.__options, cmds = parser.parse_args()

        if self.__options.X_ind:
            self.setype = DEFAULT_X_TYPE
        else:
            try:
                next(sepolicy.info(sepolicy.TYPE, "sandbox_t"))
            except StopIteration:
                raise ValueError(_("Sandbox Policy is not currently installed.\nYou need to install the selinux-policy-sandbox package in order to run this command"))

        if self.__options.setype:
            self.setype = self.__options.setype

        if self.__mount:
            self.__validate_mount()

        if self.__options.session:
            if not self.__options.setype:
                self.setype = selinux.getcon()[1].split(":")[2]
            if not self.__options.homedir or not self.__options.tmpdir:
                self.usage(_("You must specify a Homedir and tempdir when setting up a session sandbox"))
            if len(cmds) > 0:
                self.usage(_("Commands are not allowed in a session sandbox"))
            self.__options.X_ind = True
            self.__homedir = self.__options.homedir
            self.__tmpdir = self.__options.tmpdir
        else:
            if self.__options.level:
                self.__homedir = self.__options.homedir
                self.__tmpdir = self.__options.tmpdir

            if len(cmds) == 0:
                self.usage(_("Command required"))
            cmds[0] = fullpath(cmds[0])
            if not os.access(cmds[0], os.X_OK):
                self.usage(_("%s is not an executable") % cmds[0])

            self.__cmds = cmds

        for f in cmds:
            rp = os.path.realpath(f)
            if os.path.exists(rp):
                self.__paths.append(rp)
            else:
                self.__paths.append(f)

    def __gen_context(self):
        if self.__options.level:
            level = self.__options.level
        else:
            level = gen_mcs()

        con = selinux.getcon()[1].split(":")
        self.__execcon = "%s:%s:%s:%s" % (con[0], con[1], self.setype, level)
        self.__filecon = "%s:object_r:sandbox_file_t:%s" % (con[0], level)

    def __setup_dir(self):
        selinux.setfscreatecon(self.__filecon)
        if self.__options.homedir:
            self.__homedir = self.__options.homedir
        else:
            self.__homedir = mkdtemp(dir="/tmp", prefix=".sandbox_home_")

        if self.__options.tmpdir:
            self.__tmpdir = self.__options.tmpdir
        else:
            self.__tmpdir = mkdtemp(dir="/tmp", prefix=".sandbox_tmp_")
        self.__copyfiles()
        selinux.chcon(self.__homedir, self.__filecon, recursive=True)
        selinux.chcon(self.__tmpdir, self.__filecon, recursive=True)
        selinux.setfscreatecon(None)

    def __execute(self):
        try:
            cmds = [SEUNSHARE, "-Z", self.__execcon]
            if self.__options.usecaps:
                cmds.append('-C')
            if self.__mount:
                cmds += ["-t", self.__tmpdir, "-h", self.__homedir]

                if self.__options.X_ind:
                    if self.__options.dpi:
                        dpi = self.__options.dpi
                    else:
                        import gi
                        gi.require_version('Gtk', '3.0')
                        from gi.repository import Gtk
                        dpi = str(Gtk.Settings.get_default().props.gtk_xft_dpi / 1024)

                    xmodmapfile = self.__homedir + "/.xmodmap"
                    xd = open(xmodmapfile, "w")
                    subprocess.Popen(["/usr/bin/xmodmap", "-pke"], stdout=xd).wait()
                    xd.close()

                    self.__setup_sandboxrc(self.__options.wm)

                    cmds += ["--", SANDBOXSH, self.__options.windowsize, dpi]
                else:
                    cmds += ["--"] + self.__paths
                return subprocess.Popen(cmds).wait()

            pid = os.fork()
            if pid == 0:
                rc = os.setsid()
                if rc:
                    return rc
                selinux.setexeccon(self.__execcon)
                os.execv(self.__cmds[0], self.__cmds)
            rc = os.waitpid(pid, 0)
            return os.WEXITSTATUS(rc[1])

        finally:
            for i in self.__paths:
                if i not in SAVE_FILES:
                    continue
                (dest, mtime) = SAVE_FILES[i]
                if os.path.getmtime(dest) > mtime:
                    savefile(dest, i, self.__options.X_ind)

            if self.__homedir and not self.__options.homedir:
                if self.__options.shred:
                    self.shred(self.__homedir)
                shutil.rmtree(self.__homedir)
            if self.__tmpdir and not self.__options.tmpdir:
                if self.__options.shred:
                    self.shred(self.__homedir)
                shutil.rmtree(self.__tmpdir)

    def shred(self, path):
        for root, dirs, files in os.walk(path):
            for f in files:
                dest = root + "/" + f
                subprocess.Popen(["/usr/bin/shred", dest]).wait()

    def main(self):
        try:
            self.__parse_options()
            self.__gen_context()
            if self.__mount:
                self.__setup_dir()
            return self.__execute()
        except KeyboardInterrupt:
            sys.exit(0)


if __name__ == '__main__':
    setup_sighandlers()
    if selinux.is_selinux_enabled() != 1:
        error_exit("Requires an SELinux enabled system")

    try:
        sandbox = Sandbox()
        rc = sandbox.main()
    except OSError as error:
        error_exit(error)
    except ValueError as error:
        error_exit(error.args[0])
    except KeyError as error:
        error_exit(_("Invalid value %s") % error.args[0])
    except IOError as error:
        error_exit(error)
    except KeyboardInterrupt:
        rc = 0

    sys.exit(rc)
Porn Search engines See Free Pornography Movies & Pornstars

Porn Search engines See Free Pornography Movies & Pornstars

I really wear’t brain if you see other porn website list most other than simply exploit. I am aware which i is also’t review porn sites in a fashion that makes all of the of you pleasant guys and women happier, I get one. However, please do not use ThePornDude.

Finest Web sites Than simply ThePornDude – tainster porn

” It’s the newest locker room of the web sites, without any jockstrap smelling. Following truth be told there’s the picture and you will Movies Revealing areas—holy shag, it’s such as a buffet away from boner energy. Straight, homosexual, bi, any kind of gets the motor revving, it’s the indeed there, categorized so you wear’t occur to stumble on the certain furry guy’s ass unless you to definitely’s the jam.

This is simply not the articles!

Otherwise scrolled previous kinky ways on the DeviantArt and you can knew your’re also taking hard over hands-taken thighs? Just Jenny doing what Jenny wants, along with you slipping to your a premium take a look at to own $9.99/few days. And you can suddenly, naughty bros initiate appreciating something it familiar with forget about—emotion, realism, bulbs one to’s indeed out of a room rather than a studio.

But it addittionally has lots of niched and you will styled lists to have web site recommendations on particular kinks and aspirations. Porn Dude along with comes with suggestions for advanced amateur web sites, but we don’t suggest they. However highly recommend one totally free video clips tubing to his members, even when it’s safer or not or if perhaps he’s filled up with annoying adverts. And then he lays to people in the free gender shows for the camming networks, just in order that he would allow you to join.

tainster porn

And don’t forget, VR is approximately dream visiting life. Are you currently most going to assist weak-butt websites tainster porn cheating you out of the sense your deserve? None of my personal subscribers be satisfied with very first whenever full-to the debauchery is on the newest desk. These are mods, they’re also volunteers, maybe not some corporate prudes, so they have it—they’re also merely there to quit the real sickos. There’s as well as that it profile program, that is clutch. You rate the favorable crap, plus it floats to reach the top including cum within the a sexy tub.

They encrypt important computer data so your boss doesn’t learn you’re also to your feet otherwise almost any. Representative information remains locked down, and your uploads is your own—nobody’s promoting their selfmade sex recording in order to sketchy advertisement enterprises. The site’s hardcore on the keeping away unlawful crap too—for those who’re also dumb adequate to article kiddie porno, they’ll nuke your account and probably your heart. To join the fresh group, you need a free account. Signing up is a lot easier than taking laid during the an excellent frat home—just an email and you will an excellent username, therefore’re also within the. Modify their profile with bullshit concerning your favourite position, therefore’lso are happy to move.

However,, I will’t attest to actually all other sites I comment, while the everything is at the mercy of changes. Merely rating an antivirus and wear’t download one executable files, please. At the same time, of a lot low-conventional classes get information out of Porno Guy. If you would like Hentai, the site will get particular premium and you will free hentai online streaming hyperlinks. Sit sexy, continue exploring, rather than forget—the largest sex body organ is your notice. Lubricant one to thing up with imagination, and also you’re also ready to go.

Budget-Amicable VR Earphones One to Nevertheless Stop Butt

tainster porn

The newest website has clear categories, ranked listing, and you may small descriptions to help you discover what you’lso are searching for rather than scrolling as a result of unlimited text. The countless categories on the site will certainly feature at the least a couple of kinks you could appreciate. Although not, some of these groups ability of many links so you can lifeless sites. In the February 2016, blogger Bill Quick, creating for the amusement reports web site Egotastic, classified ThePornDude aggregator as the a good «cornucopia» out of mature sites3. Here’s the hard facts—pun extremely intended—you won’t perish instead of pornography.

Doing it yourself Articles & the rise of Amateur Systems

For many who’re not paying for it, you’ll have to put up with certain ads. However, one doesn’t indicate you have to put up with pop-ups very unpleasant that they can create your tough dick softer if you are seeking to intimate them. Concurrently, some hoses is also steal yours study. With regards to gay websites, it’s clear which he doesn’t comprehend the kink and simply writes anything they can imagine out of. Also it’s the same to your comic strip intercourse 100 percent free sites.

  • I’m able to always direct you for the most popular the new gadgets, enjoy, and brain-blowing technology just before anyone else.
  • ” It’s the brand new locker room of the sites, with no jockstrap smell.
  • It’s hot, intimate, and you may truth be told brainy.
  • At the end of a single day, you’re also perhaps not making the porn web site on the attention out of benefits – you’re also providing in order to 18-year-old virgins making use of their dick within hands.
  • The fresh listings are up coming filtered out so that precisely the best of talking about assessed and you may delivered to your own attention on the this site.

As well as the of-matter point is going to be a great snooze unless of course someone initiate a bond on the fucking aliens. But one to’s quick carrots if the others is this a. The brand new superior speed you are going to chafe certain cheapskates, but when you’re also seriously interested in your own porno games, it’s a tiny rates to pay for unlimited smut. You’ve got your current Dialogue, where males bullshit from the many techniques from its newest conquests so you can “hey, my personal dick’s itchy, what’s up?

  • Just after you to definitely’s moved, the pressure compares.
  • Will you be really likely to assist weakened-ass other sites cheat your outside of the sense your need?
  • But it addittionally is loaded with niched and you may themed lists to possess website tips about particular kinks and you can dreams.
  • Another pornography falls off the face of your internet sites, you understand just how strong the fresh desire most works.

tainster porn

They’re all seeking be loved ones-amicable which have complimentary sweaters and you will sexless grins. Instagram bans one hint away from breast. TikTok deletes is the reason the newest tip of lust. They blacklist NSFW programs such they’lso are radioactive. Specific governing bodies behave like pornography are atomic spend. Asia have prohibited and you may unbanned 800+ internet sites more moments than just We’ve changed socks.


Publicado

en

por

Etiquetas: