shell bypass 403

UnknownSec Shell

: /bin/ [ dr-xr-xr-x ]

name : vdo
#! /usr/libexec/platform-python

#
# Copyright Red Hat
#
# 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; either version 2
# of the License, or (at your option) any later version.
# 
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA. 
#

"""
  vdo - VDO management utility

  $Id: //eng/vdo-releases/aluminum/src/python/vdo/vdo#5 $

"""
#pylint: disable=C0302
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import argparse
import copy
import gettext
import logging
from logging.handlers import RotatingFileHandler
import locale
import os
import re
import sys
from textwrap import TextWrapper
import traceback

from vdo.utils import Command
from vdo.vdomgmnt import *

gettext.install('vdo')

########################################################################
def configureLogger(name, logfile = None, debug = False):
  """Configure the logging system according to the arguments."""
  debugging   = debug
  myname      = os.path.basename(sys.argv[0])
  formatBase  = ': %(levelname)s - %(message)s'
  debugBase   = (': %(name)s' if debugging else '') + formatBase

  logger = logging.getLogger()
  logger.setLevel(logging.NOTSET)

  handler = logging.StreamHandler(sys.stderr)
  handler.setFormatter(logging.Formatter(myname + debugBase))
  handler.setLevel(logging.DEBUG if debugging else logging.WARNING)
  logger.addHandler(handler)

  if logfile is not None:
    try:
      if os.path.isfile(logfile) or not os.path.exists(logfile):
        # Nonexistent or file, treat it as a file
        handler = RotatingFileHandler(logfile,
                                      maxBytes=10*1024*1024,
                                      backupCount=5)
      else:
        # Exists but not a file, treat it as a stream
        logstream = open(logfile, "w")
        handler = logging.StreamHandler(stream=logstream)

      formatter = logging.Formatter('%(asctime)s %(name)s' + formatBase)
      handler.setFormatter(formatter)
      handler.setLevel(logging.DEBUG if debugging else logging.INFO)
      logger.addHandler(handler)
    except Exception as ex:
      logger.error("Unable to configure logging to '{logfile}' {ex}"
                   .format(logfile=logfile, ex=ex))
      sys.exit(1)

  # syslog logger
  try:
    handler = logging.handlers.SysLogHandler(address='/dev/log')
    handler.setFormatter(logging.Formatter(myname + formatBase))
    handler.setLevel(logging.WARNING)
    logger.addHandler(handler)
  except Exception as ex:
    logger.warn('Unable to configure logging for rsyslog: {0}'.format(ex))

########################################################################
def main():
  """The main program.

     Exit codes:
       0        SUCCESS  success
       1        ERROR    error(s) occurred
  """
  SUCCESS = 0
  ERROR   = 1

  try:
    import vdoInstrumentation
  except ImportError:
    pass
  try:
    locale.setlocale(locale.LC_ALL, '')
  except locale.Error:
    pass

  arguments = VDOArgumentParser().parse_args()
  if arguments.command is None:
    # There does not appear to be a convenient way to get a command list.
    VDOArgumentParser().print_usage()
    sys.exit(ERROR)
  configureLogger(os.path.basename(sys.argv[0]),
                  arguments.logfile, arguments.debug)
  mainLogger = logging.getLogger(os.path.basename(sys.argv[0]))
  mainLogger.info(' '.join(['running'] + sys.argv))
  Command.setDefaults(arguments.verbose)

  operation = None
  exitval = ERROR
  try:
    operation = vdoOperations[arguments.command]
  except KeyError:
    mainLogger.error(_('Unknown command "{0}"'.format(arguments.command)))
  try:
    if operation is not None:
      operation.run(arguments)
      exitval = SUCCESS
  except Exception as ex:
    if isinstance(ex, ExitStatus):
      # pylint: disable=E1101
      # If it's an instance of ExitStatus we know it has exitStatus.
      exitval = ex.exitStatus
    traceInfo = sys.exc_info()[2]
    mainLogger.error(str(ex))
    # By default (i.e., without --debug) this will log to the
    # specified log file, if any, but not to stderr, because of the
    # priority thresholds we set for the different logging
    # destinations. We can't use mainLogger.exception because that
    # logs at level ERROR which would go everywhere.
    traceText = 'Traceback:\n' + ''.join(traceback.format_tb(traceInfo))
    mainLogger.info(traceText.rstrip())

  logging.shutdown()
  sys.exit(exitval)

########################################################################
if __name__ == "__main__":
  main()

© 2025 UnknownSec
Web Design for Beginners | Anyleson - Learning Platform
INR (₹)
India Rupee
$
United States Dollar
Web Design for Beginners

Web Design for Beginners

in Design
Created by Linda Anderson
+2
5 Users are following this upcoming course
Course Published
This course was published already and you can check the main course
Course
Web Design for Beginners
in Design
4.25
1:45 Hours
8 Jul 2021
₹11.80

What you will learn?

Create any website layout you can imagine

Support any device size with Responsive (mobile-friendly) Design

Add tasteful animations and effects with CSS3

Course description

You can launch a new career in web development today by learning HTML & CSS. You don't need a computer science degree or expensive software. All you need is a computer, a bit of time, a lot of determination, and a teacher you trust. I've taught HTML and CSS to countless coworkers and held training sessions for fortune 100 companies. I am that teacher you can trust. 


Don't limit yourself by creating websites with some cheesy “site-builder" tool. This course teaches you how to take 100% control over your webpages by using the same concepts that every professional website is created with.


This course does not assume any prior experience. We start at square one and learn together bit by bit. By the end of the course you will have created (by hand) a website that looks great on phones, tablets, laptops, and desktops alike.


In the summer of 2020 the course has received a new section where we push our website live up onto the web using the free GitHub Pages service; this means you'll be able to share a link to what you've created with your friends, family, colleagues and the world!

Requirements

No prerequisite knowledge required

No special software required

Comments (0)

Report course

Please describe about the report short and clearly.

Share

Share course with your friends