GRAYBYTE WORDPRESS FILE MANAGER4872

Server IP : 198.54.121.189 / Your IP : 216.73.216.224
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/alt/ruby18/lib64/ruby/1.8/webrick/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/alt/ruby18/lib64/ruby/1.8/webrick//utils.rb
#
# utils.rb -- Miscellaneous utilities
#
# Author: IPR -- Internet Programming with Ruby -- writers
# Copyright (c) 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou
# Copyright (c) 2002 Internet Programming with Ruby writers. All rights
# reserved.
#
# $IPR: utils.rb,v 1.10 2003/02/16 22:22:54 gotoyuzo Exp $

require 'socket'
require 'fcntl'
begin
  require 'etc'
rescue LoadError
  nil
end

module WEBrick
  module Utils
    def set_non_blocking(io)
      flag = File::NONBLOCK
      if defined?(Fcntl::F_GETFL)
        flag |= io.fcntl(Fcntl::F_GETFL)
      end
      io.fcntl(Fcntl::F_SETFL, flag)
    end
    module_function :set_non_blocking

    def set_close_on_exec(io)
      if defined?(Fcntl::FD_CLOEXEC)
        io.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
      end
    end
    module_function :set_close_on_exec

    def su(user)
      if defined?(Etc)
        pw = Etc.getpwnam(user)
        Process::initgroups(user, pw.gid)
        Process::Sys::setgid(pw.gid)
        Process::Sys::setuid(pw.uid)
      else
        warn("WEBrick::Utils::su doesn't work on this platform")
      end
    end
    module_function :su

    def getservername
      host = Socket::gethostname
      begin
        Socket::gethostbyname(host)[0]
      rescue
        host
      end
    end
    module_function :getservername

    def create_listeners(address, port, logger=nil)
      unless port
        raise ArgumentError, "must specify port"
      end
      res = Socket::getaddrinfo(address, port,
                                Socket::AF_UNSPEC,   # address family
                                Socket::SOCK_STREAM, # socket type
                                0,                   # protocol
                                Socket::AI_PASSIVE)  # flag
      last_error = nil
      sockets = []
      res.each{|ai|
        begin
          logger.debug("TCPServer.new(#{ai[3]}, #{port})") if logger
          sock = TCPServer.new(ai[3], port)
          port = sock.addr[1] if port == 0
          Utils::set_close_on_exec(sock)
          sockets << sock
        rescue => ex
          logger.warn("TCPServer Error: #{ex}") if logger
          last_error  = ex
        end
      }
      raise last_error if sockets.empty?
      return sockets
    end
    module_function :create_listeners

    RAND_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
                 "0123456789" +
                 "abcdefghijklmnopqrstuvwxyz" 

    def random_string(len)
      rand_max = RAND_CHARS.size
      ret = "" 
      len.times{ ret << RAND_CHARS[rand(rand_max)] }
      ret 
    end
    module_function :random_string

  end
end

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 03 2024 22:48:17
root / root
0755
httpauth
--
March 03 2024 22:48:14
root / linksafe
0755
httpservlet
--
March 03 2024 22:48:14
root / linksafe
0755
accesslog.rb
2.246 KB
June 23 2011 09:44:05
root / linksafe
0644
cgi.rb
6.915 KB
February 12 2007 23:01:19
root / linksafe
0644
compat.rb
0.426 KB
February 12 2007 23:01:19
root / linksafe
0644
config.rb
3.135 KB
February 12 2007 23:01:19
root / linksafe
0644
cookie.rb
3.032 KB
February 12 2007 23:01:19
root / linksafe
0644
htmlutils.rb
0.57 KB
February 12 2007 23:01:19
root / linksafe
0644
httpauth.rb
1.31 KB
February 12 2007 23:01:19
root / linksafe
0644
httpproxy.rb
7.46 KB
June 06 2008 08:05:24
root / linksafe
0644
httprequest.rb
9.99 KB
November 22 2010 07:22:01
root / linksafe
0644
httpresponse.rb
7.961 KB
August 16 2010 07:31:35
root / linksafe
0644
https.rb
1.639 KB
December 20 2010 16:55:16
root / linksafe
0644
httpserver.rb
5.632 KB
February 12 2007 23:01:19
root / linksafe
0644
httpservlet.rb
0.653 KB
February 12 2007 23:01:19
root / linksafe
0644
httpstatus.rb
3.51 KB
June 10 2010 05:23:49
root / linksafe
0644
httputils.rb
9.964 KB
January 10 2010 10:30:06
root / linksafe
0644
httpversion.rb
1.115 KB
February 12 2007 23:01:19
root / linksafe
0644
log.rb
2.034 KB
February 12 2007 23:01:19
root / linksafe
0644
server.rb
5.279 KB
February 12 2007 23:01:19
root / linksafe
0644
ssl.rb
4.222 KB
November 22 2010 07:21:52
root / linksafe
0644
utils.rb
2.543 KB
June 06 2012 05:20:08
root / linksafe
0644
version.rb
0.343 KB
February 12 2007 23:01:19
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF