Unix(以及类Unix)操作系统提供了一种功能,允许用户在重新映射的根文件系统中执行进程。chroot命令会把根(/)文件系统映射转换成相对于当前根目录的指定目录,然后在新的根目录下执行指定的命令。已更换根目录的进程及其子进程无法抵达不被新的根目录树所包含的文件系统,保护系统核心层数据,提高了系统的安全性能。
为了要设定Tomcat在chroot Jail中运行,必须:
1、在运行Tomcat的机器上拥有root的权限。
2、使用官方Tomcat二进制发行版。
下面我们开始进行chroot Jail的设置。
1、在文件系统中创建新根目录树(自定义)。
mkdir /opt/chroot
2、创建Tomcat要使用的通用Unix文件系统目录,并授予类似的权限。
cd /opt/chroot
mkdir -p bin etc home lib proc usr dev lib64 tmp
chmod 755 etc dev usr
chmod 1777 tmp
cp -a /etc/hosts etc/hosts
3、将Java JDK或JRE复制到chroot树中
mkdir -p usr/java
cp -a /usr/java/jdk1.6.0_45 usr/java
4、使用ldd命令验证Java运行时所需的库文件,并将它们复制到chroot的/lib或其他的lib目录中(通常是/lib64),然后尝试执行Java,以测试确定找到并正常加载了所有库文件。
ldd /usr/java/jdk1.6.0_45/bin/java
cp -p /lib64/ld-linux-x86-64.so.2 lib64/
cp -p /lib64/libc.so.6 lib64/
cp -p /lib64/libdl.so.2 lib64/
cp -p /lib64/libpthread.so.0 lib64/
ln -s /usr/java/jdk1.6.0_45/jre/lib/amd64/jli/libjli.so libjli.so
还要复制JVM需要的(根据JVM运行的错误信息)一组库文件
cp -p /lib64/libacl.so.1 lib64/
cp -p /lib64/libattr.so.1 lib64/
cp -p /lib64/libcap.so.2 lib64/
cp -p /lib64/libm.so.6 lib64/
cp -p /lib64/libnsl.so.1 lib64/
cp -p /lib64/libpcre.so.1 lib64/
cp -p /lib64/libselinux.so.1 lib64/
cp -p /lib64/libtinfo.so.5 lib64/
5、在chroot下创建具有一组设备的新/dev目录
mkdir -p dev/pts
cp -a /dev/shm ./dev/
CentOS 6.x版本(内核版本:2.6.X):
/dev/MAKEDEV -d ./dev null random urandom zero loop* log console
cp /dev/MAKEDEV ./dev
CentOS 7.x版本(内核版本:3.10.X):
ll /dev/{null,zero,random,urandom,loop*,log,console}
mknod -m 666 ./dev/zero c 1 5
mknod -m 600 ./dev/console c 5 1
mknod -m 660 ./dev/loop-control c 10 237
mknod -m 666 ./dev/null c 1 3
mknod -m 666 ./dev/random c 1 8
mknod -m 666 ./dev/urandom c 1 9
mknod -m 666 ./dev/tty c 5 0
cp -a /dev/log ./dev/
6、创建proc文件系统
CentOS 6.X版本:
mount -t proc proc ./proc
CentOS 7.X版本:
mount -t proc none ./proc/
7、复制必要的/etc文件和库文件,以支持chroot内部的命名解决方案
cp -a /etc/hosts /etc/resolv.conf /etc/nsswitch.conf ./etc/
cp -p /lib64/libnss_dns.so.2 lib64/
cp -p /lib64/libnss_files.so.2 lib64/
cp -p /lib64/libresolv.so.2 lib64/
8、在chroot内部安装一个bash shell,启用命令行shell,运行shell脚本并帮助调试chroot内部的问题
cp /bin/bash ./bin/
ln -s /bin/bash ./bin/sh
cp -p /lib64/libtermcap.so.2 ./lib64/ # CentOS 6.X系统
chroot /opt/chroot /bin/bash # 在chroot内部测试bash
9、在chroot内部测试Java虚拟机是否正常:
chroot /opt/chroot /usr/java/jdk1.6.0_45/bin/java -version l
如果运行失败,说明chroot树内部还未成功创建真实的root目录的某些部分,需要查看错误提示和日志。在CentOS 6.X可使用strace命令输出更多信息:
strace chroot /opt/chroot /usr/java/jdk1.6.0_45/bin/java -version
10、一旦已经让Java运行在chroot内,则可以继续配置让Tomcat运行在chroot内。
配置Tomcat运行环境:
cp /bin/uname ./bin/
cp /usr/bin/dirname ./usr/bin/
cp /usr/bin/tty ./usr/bin/
cp /bin/touch ./bin/
把Tomcat二进制文件解压到chroot目录下:
cp -a /iFinCar_App/apache-tomcat-6.0.18 /opt/chroot/iFinCar_App/apache-tomcat-6.0.18
chroot /opt/chroot /iFinCar_App/apache-tomcat-6.0.18/bin/catalina.sh start
11、Linux的chroot命令不支持用户或组的切换功能,只能用root用户执行,给系统带来了一定的风险。为了解决这个问题,我们将OpenBSD的chroot命令移植到Linux下,并将其重命名为jbchroot,以区别于默认的chroot命令。
gcc -0 jbchroot.c -o jbchroot
cp jbchroot /usr/local/bin/
ls -la which jbchroot
chmod 755 /usr/local/bin/jbchroot
chown root.root /usr/local/bin/jbchroot
jbchroot /opt/chroot -U car -- /iFinCar_App/apache-tomcat-6.0.18/bin/catalina.sh start
jbchroot代码:
<!DOCTYPE html>
<html class="with-system-footer" lang="en">
<head prefix="og: http://ogp.me/ns#">
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="object" property="og:type">
<meta content="GitLab" property="og:site_name">
<meta content="tomcat-definitive-guide-2ed-examples/jbchroot.c · master · examples / Tomcat The Definitive Guide 2nd Edition" property="og:title">
<meta content="O'Reilly Resources" property="og:description">
<meta content="https://resources.oreilly.com/examples/9780596101060/avatar" property="og:image">
<meta content="64" property="og:image:width">
<meta content="64" property="og:image:height">
<meta content="https://resources.oreilly.com/examples/9780596101060/blob/master/tomcat-definitive-guide-2ed-examples/jbchroot.c" property="og:url">
<meta content="summary" property="twitter:card">
<meta content="tomcat-definitive-guide-2ed-examples/jbchroot.c · master · examples / Tomcat The Definitive Guide 2nd Edition" property="twitter:title">
<meta content="O'Reilly Resources" property="twitter:description">
<meta content="https://resources.oreilly.com/examples/9780596101060/avatar" property="twitter:image">
<title>tomcat-definitive-guide-2ed-examples/jbchroot.c · master · examples / Tomcat The Definitive Guide 2nd Edition · GitLab</title>
<meta content="O'Reilly Resources" name="description">
<link rel="shortcut icon" type="image/x-icon" href="/assets/favicon-075eba76312e8421991a0c1f89a89ee81678bcde72319dd3e8047e2a47cd3a42.ico" id="favicon" />
<link rel="stylesheet" media="all" href="/assets/application-7dd45a23dafef4b5ec7501ed3737cfd023a850e0b9b27ed5e2493ffdb44a1a7f.css" />
<link rel="stylesheet" media="print" href="/assets/print-74b3d49adeaada27337e759b75a34af7cf3d80051de91d60d40570f5a382e132.css" />
<script src="/assets/webpack/webpack_runtime.afbac23c2c460afb7e3e.bundle.js" defer="defer"></script>
<script src="/assets/webpack/common.7fc6b72f51d774a76237.bundle.js" defer="defer"></script>
<script src="/assets/webpack/main.00809cc2a5dbae7653f6.bundle.js" defer="defer"></script>
<script src="/assets/webpack/pages.projects.0b539e43324616adb567.bundle.js" defer="defer"></script>
<script src="/assets/webpack/pages.projects.blob.show.b550e00045138d8c5030.bundle.js" defer="defer"></script>
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="9+UBBgrgNzBezDgAvzv7ECyKRRkodRZB8qQ6thRivsh5TsgFUjTBGGrxtC/X4o1saN6r1/14M6Qjwxl95Wa/VA==" />
<meta content="origin-when-cross-origin" name="referrer">
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
<meta content="#474D57" name="theme-color">
<link rel="apple-touch-icon" type="image/x-icon" href="/assets/touch-icon-iphone-5a9cee0e8a51212e70b90c87c12f382c428870c0ff67d1eb034d884b78d2dae7.png" />
<link rel="apple-touch-icon" type="image/x-icon" href="/assets/touch-icon-ipad-a6eec6aeb9da138e507593b464fdac213047e49d3093fc30e90d9a995df83ba3.png" sizes="76x76" />
<link rel="apple-touch-icon" type="image/x-icon" href="/assets/touch-icon-iphone-retina-72e2aadf86513a56e050e7f0f2355deaa19cc17ed97bbe5147847f2748e5a3e3.png" sizes="120x120" />
<link rel="apple-touch-icon" type="image/x-icon" href="/assets/touch-icon-ipad-retina-8ebe416f5313483d9c1bc772b5bbe03ecad52a54eba443e5215a22caed2a16a2.png" sizes="152x152" />
<link color="rgb(226, 67, 41)" href="/assets/logo-d36b5212042cebc89b96df4bf6ac24e43db316143e89926c0db839ff694d2de4.svg" rel="mask-icon">
<meta content="/assets/msapplication-tile-1196ec67452f618d39cdd85e2e3a542f76574c071051ae7effbfde01710eb17d.png" name="msapplication-TileImage">
<meta content="#30353E" name="msapplication-TileColor">
</head>
<body class="ui_indigo " data-find-file="/examples/9780596101060/find_file/master" data-group="" data-page="projects:blob:show" data-project="9780596101060">
<header class="navbar navbar-gitlab navbar-gitlab-new qa-navbar">
<a class="sr-only gl-accessibility" href="#content-body" tabindex="1">Skip to content</a>
<div class="container-fluid">
<div class="header-content">
<div class="title-container">
<h1 class="title">
<a title="Dashboard" id="logo" href="/"><img data-src="/uploads/-/system/appearance/header_logo/1/atl.site.logo.png" class=" lazy" src="https://img-blog.csdnimg.cn/2022010710224959949.gif" />
</a></h1>
<ul class="list-unstyled navbar-sub-nav">
<li class="home"><a title="Projects" class="dashboard-shortcuts-projects" href="/explore">Projects
</a></li><li class=""><a title="Groups" class="dashboard-shortcuts-groups" href="/explore/groups">Groups
</a></li><li class=""><a title="Snippets" class="dashboard-shortcuts-snippets" href="/explore/snippets">Snippets
</a></li><li>
<a title="About GitLab CE" href="/help">Help</a>
</li>
</ul>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="hidden-sm hidden-xs">
<div class="has-location-badge search search-form">
<form class="navbar-form" action="/search" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="✓" /><div class="search-input-container">
<div class="location-badge">This project</div>
<div class="search-input-wrap">
<div class="dropdown" data-url="/search/autocomplete">
<input type="search" name="search" id="search" placeholder="Search" class="search-input dropdown-menu-toggle no-outline js-search-dashboard-options" spellcheck="false" tabindex="1" autocomplete="off" data-issues-path="/dashboard/issues" data-mr-path="/dashboard/merge_requests" aria-label="Search" />
<button class="hidden js-dropdown-search-toggle" data-toggle="dropdown" type="button"></button>
<div class="dropdown-menu dropdown-select">
<div class="dropdown-content"><ul>
<li class="dropdown-menu-empty-item">
<a>
Loading...
</a>
</li>
</ul>
</div><div class="dropdown-loading"><i aria-hidden="true" data-hidden="true" class="fa fa-spinner fa-spin"></i></div>
</div>
<svg class="s16 search-icon"><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#search"></use></svg>
<svg class="s16 clear-icon js-clear-input"><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#close"></use></svg>
</div>
</div>
</div>
<input type="hidden" name="group_id" id="group_id" class="js-search-group-options" />
<input type="hidden" name="project_id" id="search_project_id" value="3118" class="js-search-project-options" data-project-path="9780596101060" data-name="Tomcat The Definitive Guide 2nd Edition" data-issues-path="/examples/9780596101060/issues" data-mr-path="/examples/9780596101060/merge_requests" data-issues-disabled="false" />
<input type="hidden" name="search_code" id="search_code" value="true" />
<input type="hidden" name="repository_ref" id="repository_ref" value="master" />
<div class="search-autocomplete-opts hide" data-autocomplete-path="/search/autocomplete" data-autocomplete-project-id="3118" data-autocomplete-project-ref="master"></div>
</form></div>
</li>
<li class="visible-sm-inline-block visible-xs-inline-block">
<a title="Search" aria-label="Search" data-toggle="tooltip" data-placement="bottom" data-container="body" href="/search"><svg class="s16"><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#search"></use></svg>
</a></li>
<li>
<div>
<a class="btn btn-sign-in" href="/users/sign_in?redirect_to_referer=yes">Sign in / Register</a>
</div>
</li>
</ul>
</div>
<button class="navbar-toggle hidden-sm hidden-md hidden-lg" type="button">
<span class="sr-only">Toggle navigation</span>
<svg class="s12 more-icon js-navbar-toggle-right"><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#more"></use></svg>
<svg class="s12 close-icon js-navbar-toggle-left"><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#close"></use></svg>
</button>
</div>
</div>
</header>
<div class="layout-page page-with-contextual-sidebar">
<div class="nav-sidebar">
<div class="nav-sidebar-inner-scroll">
<div class="context-header">
<a title="Tomcat The Definitive Guide 2nd Edition" href="/examples/9780596101060"><div class="avatar-container s40 project-avatar">
<img alt="Tomcat The Definitive Guide 2nd Edition" class="avatar s40 avatar-tile lazy" data-src="https://resources.oreilly.com/examples/9780596101060/avatar" src="https://img-blog.csdnimg.cn/2022010710224959949.gif" />
</div>
<div class="sidebar-context-title">
Tomcat The Definitive Guide 2nd Edition
</div>
</a></div>
<ul class="sidebar-top-level-items">
<li class="home"><a class="shortcuts-project" href="/examples/9780596101060"><div class="nav-icon-container">
<svg><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#project"></use></svg>
</div>
<span class="nav-item-name">
Overview
</span>
</a><ul class="sidebar-sub-level-items">
<li class="fly-out-top-item"><a href="/examples/9780596101060"><strong class="fly-out-top-item-name">
Overview
</strong>
</a></li><li class="divider fly-out-top-item"></li>
<li class=""><a title="Project details" class="shortcuts-project" href="/examples/9780596101060"><span>Details</span>
</a></li><li class=""><a title="Activity" class="shortcuts-project-activity" href="/examples/9780596101060/activity"><span>Activity</span>
</a></li><li class=""><a title="Cycle Analytics" class="shortcuts-project-cycle-analytics" href="/examples/9780596101060/cycle_analytics"><span>Cycle Analytics</span>
</a></li></ul>
</li><li class="active"><a class="shortcuts-tree" href="/examples/9780596101060/tree/master"><div class="nav-icon-container">
<svg><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#doc_text"></use></svg>
</div>
<span class="nav-item-name">
Repository
</span>
</a><ul class="sidebar-sub-level-items">
<li class="fly-out-top-item active"><a href="/examples/9780596101060/tree/master"><strong class="fly-out-top-item-name">
Repository
</strong>
</a></li><li class="divider fly-out-top-item"></li>
<li class="active"><a href="/examples/9780596101060/tree/master">Files
</a></li><li class=""><a href="/examples/9780596101060/commits/master">Commits
</a></li><li class=""><a href="/examples/9780596101060/branches">Branches
</a></li><li class=""><a href="/examples/9780596101060/tags">Tags
</a></li><li class=""><a href="/examples/9780596101060/graphs/master">Contributors
</a></li><li class=""><a href="/examples/9780596101060/network/master">Graph
</a></li><li class=""><a href="/examples/9780596101060/compare?from=master&to=master">Compare
</a></li><li class=""><a href="/examples/9780596101060/graphs/master/charts">Charts
</a></li></ul>
</li><li class=""><a class="shortcuts-issues" href="/examples/9780596101060/issues"><div class="nav-icon-container">
<svg><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#issues"></use></svg>
</div>
<span class="nav-item-name">
Issues
</span>
<span class="badge count issue_counter">
0
</span>
</a><ul class="sidebar-sub-level-items">
<li class="fly-out-top-item"><a href="/examples/9780596101060/issues"><strong class="fly-out-top-item-name">
Issues
</strong>
<span class="badge count issue_counter fly-out-badge">
0
</span>
</a></li><li class="divider fly-out-top-item"></li>
<li class=""><a title="Issues" href="/examples/9780596101060/issues"><span>
List
</span>
</a></li><li class=""><a title="Boards" href="/examples/9780596101060/boards"><span>
Boards
</span>
</a></li><li class=""><a title="Labels" href="/examples/9780596101060/labels"><span>
Labels
</span>
</a></li><li class=""><a title="Milestones" href="/examples/9780596101060/milestones"><span>
Milestones
</span>
</a></li></ul>
</li><li class=""><a title="Members" class="shortcuts-tree" href="/examples/9780596101060/settings/members"><div class="nav-icon-container">
<svg><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#users"></use></svg>
</div>
<span class="nav-item-name">
Members
</span>
</a><ul class="sidebar-sub-level-items is-fly-out-only">
<li class="fly-out-top-item"><a href="/examples/9780596101060/project_members"><strong class="fly-out-top-item-name">
Members
</strong>
</a></li></ul>
</li><a class="toggle-sidebar-button js-toggle-sidebar" role="button" title="Toggle sidebar" type="button">
<svg class=" icon-angle-double-left"><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#angle-double-left"></use></svg>
<svg class=" icon-angle-double-right"><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#angle-double-right"></use></svg>
<span class="collapse-text">Collapse sidebar</span>
</a>
<button name="button" type="button" class="close-nav-button"><svg class="s16"><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#close"></use></svg>
<span class="collapse-text">Close sidebar</span>
</button>
<li class="hidden">
<a title="Activity" class="shortcuts-project-activity" href="/examples/9780596101060/activity"><span>
Activity
</span>
</a></li>
<li class="hidden">
<a title="Network" class="shortcuts-network" href="/examples/9780596101060/network/master">Graph
</a></li>
<li class="hidden">
<a title="Charts" class="shortcuts-repository-charts" href="/examples/9780596101060/graphs/master/charts">Charts
</a></li>
<li class="hidden">
<a class="shortcuts-new-issue" href="/examples/9780596101060/issues/new">Create a new issue
</a></li>
<li class="hidden">
<a title="Commits" class="shortcuts-commits" href="/examples/9780596101060/commits/master">Commits
</a></li>
<li class="hidden">
<a title="Issue Boards" class="shortcuts-issue-boards" href="/examples/9780596101060/boards">Issue Boards</a>
</li>
</ul>
</div>
</div>
<div class="content-wrapper">
<div class="mobile-overlay"></div>
<div class="alert-wrapper">
<nav class="breadcrumbs container-fluid container-limited" role="navigation">
<div class="breadcrumbs-container">
<button name="button" type="button" class="toggle-mobile-nav"><span class="sr-only">Open sidebar</span>
<i aria-hidden="true" data-hidden="true" class="fa fa-bars"></i>
</button><div class="breadcrumbs-links js-title-container">
<ul class="list-unstyled breadcrumbs-list js-breadcrumbs-list">
<li><a class="group-path breadcrumb-item-text js-breadcrumb-item-text " href="/examples"><img class="avatar-tile lazy" width="15" height="15" data-src="/uploads/-/system/group/avatar/3/tarsier_hi_elbows.png" src="https://img-blog.csdnimg.cn/2022010710224959949.gif" />examples</a><svg class="s8 breadcrumbs-list-angle"><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#angle-right"></use></svg></li> <li><a href="/examples/9780596101060"><img alt="Tomcat The Definitive Guide 2nd Edition" class="avatar-tile lazy" width="15" height="15" data-src="https://resources.oreilly.com/examples/9780596101060/avatar" src="https://img-blog.csdnimg.cn/2022010710224959949.gif" /><span class="breadcrumb-item-text js-breadcrumb-item-text">Tomcat The Definitive Guide 2nd Edition</span></a><svg class="s8 breadcrumbs-list-angle"><use xlink:href="/assets/icons-fe86f87a3d244c952cc0ec8d7f88c5effefcbe454d751d8449d4a1a32aaaf9a0.svg#angle-right"></use></svg></li>
<li>
<h2 class="breadcrumbs-sub-title"><a href="/examples/9780596101060/blob/master/tomcat-definitive-guide-2ed-examples/jbchroot.c">Repository</a></h2>
</li>
</ul>
</div>
</div>
</nav>
<div class="flash-container flash-container-page">
</div>
</div>
<div class=" ">
<div class="content" id="content-body">
<div class="container-fluid container-limited">
<div class="tree-holder" id="tree-holder">
<div class="nav-block">
<div class="tree-ref-container">
<div class="tree-ref-holder">
<form class="project-refs-form" action="/examples/9780596101060/refs/switch" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="✓" /><input type="hidden" name="destination" id="destination" value="blob" />
<input type="hidden" name="path" id="path" value="tomcat-definitive-guide-2ed-examples/jbchroot.c" />
<div class="dropdown">
<button class="dropdown-menu-toggle js-project-refs-dropdown" type="button" data-toggle="dropdown" data-selected="master" data-ref="master" data-refs-url="/examples/9780596101060/refs?sort=updated_desc" data-field-name="ref" data-submit-form-on-click="true" data-visit="true"><span class="dropdown-toggle-text ">master</span><i aria-hidden="true" data-hidden="true" class="fa fa-chevron-down"></i></button>
<div class="dropdown-menu dropdown-menu-paging dropdown-menu-selectable git-revision-dropdown">
<div class="dropdown-page-one">
<div class="dropdown-title"><span>Switch branch/tag</span><button class="dropdown-title-button dropdown-menu-close" aria-label="Close" type="button"><i aria-hidden="true" data-hidden="true" class="fa fa-times dropdown-menu-close-icon"></i></button></div>
<div class="dropdown-input"><input type="search" id="" class="dropdown-input-field" placeholder="Search branches and tags" autocomplete="off" /><i aria-hidden="true" data-hidden="true" class="fa fa-search dropdown-input-search"></i><i role="button" aria-hidden="true" data-hidden="true" class="fa fa-times dropdown-input-clear js-dropdown-input-clear"></i></div>
<div class="dropdown-content"></div>
<div class="dropdown-loading"><i aria-hidden="true" data-hidden="true" class="fa fa-spinner fa-spin"></i></div>
</div>
</div>
</div>
</form>
</div>
<ul class="breadcrumb repo-breadcrumb">
<li>
<a href="/examples/9780596101060/tree/master">9780596101060
</a></li>
<li>
<a href="/examples/9780596101060/tree/master/tomcat-definitive-guide-2ed-examples">tomcat-definitive-guide-2ed-examples</a>
</li>
<li>
<a href="/examples/9780596101060/blob/master/tomcat-definitive-guide-2ed-examples/jbchroot.c"><strong>jbchroot.c</strong>
</a></li>
</ul>
</div>
<div class="tree-controls">
<a class="btn shortcuts-find-file" rel="nofollow" href="/examples/9780596101060/find_file/master"><i aria-hidden="true" data-hidden="true" class="fa fa-search"></i>
<span>Find file</span>
</a>
<div class="btn-group" role="group"><a class="btn js-blob-blame-link" href="/examples/9780596101060/blame/master/tomcat-definitive-guide-2ed-examples/jbchroot.c">Blame</a><a class="btn" href="/examples/9780596101060/commits/master/tomcat-definitive-guide-2ed-examples/jbchroot.c">History</a><a class="btn js-data-file-blob-permalink-url" href="/examples/9780596101060/blob/a057298bbb1011965c3dde5a5e19e9e76cf9e6c0/tomcat-definitive-guide-2ed-examples/jbchroot.c">Permalink</a></div>
</div>
</div>
<div class="info-well hidden-xs">
<div class="well-segment">
<ul class="blob-commit-info">
<li class="commit flex-row js-toggle-container" id="commit-a057298b">
<div class="avatar-cell hidden-xs">
<a href="/oreillymedia"><img alt="O'Reilly Media, Inc.'s avatar" src="/uploads/-/system/user/avatar/3/tarsier_hi_elbows.png" data-container="body" class="avatar s36 hidden-xs has-tooltip" title="O'Reilly Media, Inc." /></a>
</div>
<div class="commit-detail flex-list">
<div class="commit-content">
<a class="commit-row-message item-title" href="/examples/9780596101060/commit/a057298bbb1011965c3dde5a5e19e9e76cf9e6c0">Initial commit</a>
<span class="commit-row-message visible-xs-inline">
·
a057298b
</span>
<div class="commiter">
<a class="commit-author-link has-tooltip" title="booktech@oreilly.com" href="/oreillymedia">O'Reilly Media, Inc.</a> authored <time class="js-timeago" title="Jun 27, 2017 10:20am" datetime="2017-06-27T17:20:44Z" data-toggle="tooltip" data-placement="bottom" data-container="body">Jun 27, 2017</time>
</div>
</div>
<div class="commit-actions flex-row hidden-xs">
<div class="js-commit-pipeline-status" data-endpoint="/examples/9780596101060/commit/a057298bbb1011965c3dde5a5e19e9e76cf9e6c0/pipelines"></div>
<div class="commit-sha-group">
<div class="label label-monospace">
a057298b
</div>
<button class="btn btn btn-default" data-toggle="tooltip" data-placement="bottom" data-container="body" data-title="Copy commit SHA to clipboard" data-class="btn btn-default" data-clipboard-text="a057298bbb1011965c3dde5a5e19e9e76cf9e6c0" type="button" title="Copy commit SHA to clipboard" aria-label="Copy commit SHA to clipboard"><i aria-hidden="true" aria-hidden="true" data-hidden="true" class="fa fa-clipboard"></i></button>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
<div class="blob-content-holder" id="blob-content-holder">
<article class="file-holder">
<div class="js-file-title file-title-flex-parent">
<div class="file-header-content">
<i aria-hidden="true" data-hidden="true" class="fa fa-file-text-o fa-fw"></i>
<strong class="file-title-name">
jbchroot.c
</strong>
<button class="btn btn-clipboard btn-transparent prepend-left-5" data-toggle="tooltip" data-placement="bottom" data-container="body" data-class="btn-clipboard btn-transparent prepend-left-5" data-title="Copy file path to clipboard" data-clipboard-text="{"text":"tomcat-definitive-guide-2ed-examples/jbchroot.c","gfm":"tomcat-definitive-guide-2ed-examples/jbchroot.c
"}" type="button" title="Copy file path to clipboard" aria-label="Copy file path to clipboard"><i aria-hidden="true" aria-hidden="true" data-hidden="true" class="fa fa-clipboard"></i></button>
<small>
7.41 KB
</small>
</div>
<div class="file-actions">
<div class="btn-group" role="group"><button class="btn btn btn-sm js-copy-blob-source-btn" data-toggle="tooltip" data-placement="bottom" data-container="body" data-class="btn btn-sm js-copy-blob-source-btn" data-title="Copy source to clipboard" data-clipboard-target=".blob-content[data-blob-id='eb6103232d65fa9cdeab766c99910d3f4f3082fd']" type="button" title="Copy source to clipboard" aria-label="Copy source to clipboard"><i aria-hidden="true" aria-hidden="true" data-hidden="true" class="fa fa-clipboard"></i></button><a class="btn btn-sm has-tooltip" target="_blank" rel="noopener noreferrer" title="Open raw" data-container="body" href="/examples/9780596101060/raw/master/tomcat-definitive-guide-2ed-examples/jbchroot.c"><i aria-hidden="true" data-hidden="true" class="fa fa-file-code-o"></i></a></div>
<div class="btn-group" role="group"><a class="btn js-edit-blob btn-sm" href="/examples/9780596101060/edit/master/tomcat-definitive-guide-2ed-examples/jbchroot.c">Edit</a><a class="btn btn-default btn-sm" href="/-/ide/project/examples/9780596101060/edit/master/tomcat-definitive-guide-2ed-examples/jbchroot.c">Web IDE</a></div>
</div>
</div>
<div class="blob-viewer" data-type="simple" data-url="/examples/9780596101060/blob/master/tomcat-definitive-guide-2ed-examples/jbchroot.c?format=json&viewer=simple">
<div class="text-center prepend-top-default append-bottom-default">
<i aria-hidden="true" aria-label="Loading content…" class="fa fa-spinner fa-spin fa-2x"></i>
</div>
</div>
</article>
</div>
<div class="modal" id="modal-upload-blob">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<a class="close" data-dismiss="modal" href="#">×</a>
<h3 class="page-title">Replace jbchroot.c</h3>
</div>
<div class="modal-body">
<form class="js-quick-submit js-upload-blob-form form-horizontal" data-method="put" action="/examples/9780596101060/update/master/tomcat-definitive-guide-2ed-examples/jbchroot.c" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="✓" /><input type="hidden" name="_method" value="put" /><input type="hidden" name="authenticity_token" value="Me6OV0uY1Xlnof7FWKoxO86raRHw6yM7bekMP7BJGZW/RUdUE0wjUVOccuowc0dHiv+H3yXmBt68ji/0QU0YCQ==" /><div class="dropzone">
<div class="dropzone-previews blob-upload-dropzone-previews">
<p class="dz-message light">
Attach a file by drag & drop or <a class="markdown-selector" href="#">click to upload</a>
</p>
</div>
</div>
<br>
<div class="dropzone-alerts alert alert-danger data" style="display:none"></div>
<div class="form-group commit_message-group">
<label class="control-label" for="commit_message-af3fce33aac308cfd82a3db63b081e85">Commit message
</label><div class="col-sm-10">
<div class="commit-message-container">
<div class="max-width-marker"></div>
<textarea name="commit_message" id="commit_message-af3fce33aac308cfd82a3db63b081e85" class="form-control js-commit-message" placeholder="Replace jbchroot.c" required="required" rows="3">
Replace jbchroot.c</textarea>
</div>
</div>
</div>
<input type="hidden" name="branch_name" id="branch_name" />
<input type="hidden" name="create_merge_request" id="create_merge_request" value="1" />
<input type="hidden" name="original_branch" id="original_branch" value="master" class="js-original-branch" />
<div class="form-actions">
<button name="button" type="button" class="btn btn-create btn-upload-file" id="submit-all"><i aria-hidden="true" data-hidden="true" class="fa fa-spin fa-spinner js-loading-icon hidden"></i>
Replace file
</button><a class="btn btn-cancel" data-dismiss="modal" href="#">Cancel</a>
<div class="inline prepend-left-10">
A new branch will be created in your fork and a new merge request will be started.
</div>
</div>
</form></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer-message" style="background-color: #d3002d;color: #ffffff"><p><gl-emoji title="copyright sign" data-name="copyright" data-unicode-version="1.1">©</gl-emoji> 2018 O’Reilly Media, Inc. All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. <a href="http://www.oreilly.com/terms/" rel="nofollow noreferrer noopener" target="_blank">Terms of Service</a> • <a href="http://www.oreilly.com/privacy.html" rel="nofollow noreferrer noopener" target="_blank">Privacy Policy</a> • <a href="http://www.oreilly.com/about/editorial_independence.html" rel="nofollow noreferrer noopener" target="_blank">Editorial Independence</a></p></div>
</body>
</html>
转载于:https://blog.51cto.com/10248921/2400834