??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩亚洲综合精品国产,亚洲人成色77777在线观看,亚洲人成亚洲人成在线观看 http://m.tkk7.com/jinfeng_wang/category/578.htmlG-G-S,D-D-U!zh-cnSat, 20 Mar 2010 06:28:37 GMTSat, 20 Mar 2010 06:28:37 GMT60力_法分?/title><link>http://m.tkk7.com/jinfeng_wang/archive/2010/03/19/315853.html</link><dc:creator>jinfeng_wang</dc:creator><author>jinfeng_wang</author><pubDate>Thu, 18 Mar 2010 16:27:00 GMT</pubDate><guid>http://m.tkk7.com/jinfeng_wang/archive/2010/03/19/315853.html</guid><wfw:comment>http://m.tkk7.com/jinfeng_wang/comments/315853.html</wfw:comment><comments>http://m.tkk7.com/jinfeng_wang/archive/2010/03/19/315853.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jinfeng_wang/comments/commentRss/315853.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jinfeng_wang/services/trackbacks/315853.html</trackback:ping><description><![CDATA[  <p>A)<span style="font-family: 'QS 明朝'">?/span><span style="font-family: SimSun">?/span><span style="font-family: 'QS 明朝'">人民共和?/span><span style="font-family: SimSun">力_</span><span style="font-family: 'QS 明朝'">合同?/span></p> <p><a >http://www.molss.gov.cn/gb/news/2007-06/30/content_184630.htm</a></p> <p>B)<span style="font-family: 'QS 明朝'">?/span><span style="font-family: SimSun">?/span><span style="font-family: 'QS 明朝'">人民共和?/span><span style="font-family: SimSun">力_</span><span style="font-family: 'QS 明朝'">合同?/span><span style="font-family: SimSun">?/span><span style="font-family: 'QS 明朝'">施条?/span><span style="font-family: 'QS 明朝'">(</span><span style="font-family: SimSun">解释力_法实?/span><span style="font-family: 'QS 明朝'">)</span></p> <p><a >http://www.gov.cn/flfg/2008-09/19/content_1099500.htm</a></p> <p>C)<span style="font-family: SimSun">关于立力_关系有关事项的通知</span></p> <p><a >http://www.law-lib.com/law/law_view.asp?id=92395</a></p> <p>D)<span style="font-family: SimSun">上v市女职工力_保护办法</span></p> <p><a >http://www.shanghai.gov.cn/shanghai/node2314/node3124/node3125/node3133/userobject6ai655.html</a></p> <p style="margin-left: 36pt; text-indent: -36pt; tab-stops: list 0cm"><span style="font-family: Symbol">·<span style="font: 7pt 'Times New Roman'">                     </span><strong>C)</strong></span><strong><span style="font-family: SimSun">的相兛_容:</strong></span></p> <p>     <span style="font-family: SimSun">用h单位未与力_者签订劳动合同,<strong><span style="color: red">认定双方存在力_关系</strong>时可参照下列凭证Q?/span></span></p> <p>(<span style="font-family: SimSun">一</span>)<span style="font-family: SimSun">工资支付凭证或记?/span>(<span style="font-family: SimSun">职工工资发放花名?/span>)<span style="font-family: SimSun">、缴U_社会保险费的记录;</span></p> <p>(<span style="font-family: SimSun">?/span>)<span style="font-family: SimSun">用h单位向劳动者发攄<strong><span style="color: red">“工作?#8221;?#8220;服务?#8221;{能够证明n份的证g</strong>Q?/span></span></p> <p style="margin-left: 36pt; text-indent: -36pt; tab-stops: list 0cm"><span style="font-family: Symbol">·<span style="font: 7pt 'Times New Roman'">                     </span><strong>B) </strong></span><strong><span style="font-family: SimSun">的相兛_容:</strong></span></p> <p style="margin-left: 69pt; text-indent: -48pt; tab-stops: list 69.0pt">W六?span style="font: 7pt 'Times New Roman'">        <span style="font-family: SimSun">用h单位自用工之日v<span style="color: blue">过一个月不满一q?/span>未与力_者订立书面劳动合同的Q应当依?span style="color: blue">力_合同法第八十二条的规定向力_者每月支付两倍的工资Qƈ与劳动者补订书面劳动合?/span>Q劳动者不与用人单位订立书面劳动合同的Q用人单位应当书面通知力_者终止劳动关p,<span style="color: blue">q依照劳动合同法W四十七条的规定支付l济补偿</span>?/span></span><strong><span style="color: red">(1</strong></span><strong><span style="color: red; font-family: SimSun">Q相当于l?/strong></span><strong><span style="color: red">2</strong></span><strong><span style="color: red; font-family: SimSun">倍工资,</strong></span><strong><span style="color: red">2</strong></span><strong><span style="color: red; font-family: SimSun">Q补合同Q?/strong></span><strong><span style="color: red">3</strong></span><strong><span style="color: red; font-family: SimSun">Q如果辞退Q再按照有合同补偿)</strong></span></p> <p style="margin-left: 21pt"><span style="font-family: SimSun">W二十七条 力_合同法第四十七条规定?strong><span style="color: red">l济补偿的月工资按照力_者应得工资计,包括计时工资或者计件工资以及奖?/strong><span style="color: red">?/span></span></span></p> <p style="margin-left: 36pt; text-indent: -36pt; tab-stops: list 0cm"><span style="font-family: Symbol">·<span style="font: 7pt 'Times New Roman'">                     </span><strong>A)</strong></span><strong><span style="font-family: SimSun">的相兛_容:</strong></span></p> <p>     <span style="font-family: SimSun">W四十二条 力_者有下列情Ş之一的,用h单位<strong><span style="color: red">不得依照</strong>本法W四十条、第四十一条的规定解除力_合同Q?/span></span></p> <p><strong><span style="color: red">        </strong></span><strong><span style="color: red; font-family: SimSun">Q四Q女职工在孕期、期、哺x?/strong></span></p> <p> <span style="font-family: SimSun"> W四十七条 l济补偿按劳动者在本单位工作的q限Q?strong><span style="color: red">每满一q支付一个月工资的标准向力_者支付。六个月以上不满一q的Q按一q计;</strong>不满六个月的Q向力_者支付半个月工资的经补ѝ?/span></span></p> <p>     <span style="font-family: SimSun">W八十二条 <strong><span style="color: red">用h单位自用工之日v过一个月不满一q未与劳动者订立书面劳动合同的Q应当向力_者每月支付二倍的工资?/strong></span></span></p> <p><strong><span style="color: red">    </strong></span><span style="font-family: SimSun">用h单位q反本法规定不与力_者订?strong><span style="color: red">无固定期限劳动合?/strong>的,自应当订立无固定期限力_合同之日起向力_者每?strong><span style="color: red">支付二倍的工资</span></strong>?/span></span></p> <p><strong><span style="color: red">     </strong></span><span style="font-family: SimSun">W八十七条 用h<strong><span style="color: red">单位q反本法</strong>规定解除或者终止劳动合同的Q应?strong><span style="color: red">依照本法W四十七?/span></strong>规定的经补?strong><span style="color: red">标准的二?/span></strong>向劳动者支付赔偉K?/span></span></p> <p> <span style="font-family: SimSun">W十四条 无固定期限劳动合同,是指用h单位与劳动者约定无定l止旉的劳动合同?/span></p> <p>    <span style="font-family: SimSun">用h单位与劳动者协商一_可以订立无固定期限劳动合同。有下列情Ş之一Q劳动者提出或者同意箋订、订立劳动合同的Q除力_者提立固定期限劳动合同外Q应?strong><span style="color: red">订立无固定期限劳动合?/strong>Q?/span></span></p> <p>    <span style="font-family: SimSun">Q一Q劳动者在该用人单?span style="color: red">q箋<strong>工作满十q?/strong>的;</span></span></p> <p>    <span style="font-family: SimSun">Q二Q用人单位初ơ实行劳动合同制度或者国有企业改刉新订立劳动合同时Q劳动者在该用人单位连l工作满十年且距法定退休年龄不_q的Q?/span></p> <p>    <span style="font-family: SimSun">Q三Q?strong><span style="color: red">q箋订立二次固定期限力_合同</strong>Q且力_者没有本法第三十九条和第四十条第一V第二项规定的情形,l订力_合同的?/span></span></p> <p>    <span style="font-family: SimSun">用h单位<strong><span style="color: red">自用工之日v满一q不与劳动者订立书面劳动合同的Q视为用人单位与力_者已订立无固定期限劳动合?/strong>?/span></span></p> <p><strong> </strong></p> <p style="margin-left: 36pt; text-indent: -36pt; tab-stops: list 0cm"><span style="font-family: Symbol">·<span style="font: 7pt 'Times New Roman'">                     </span><strong>D) </strong></span><strong><span style="font-family: SimSun">的相兛_容:</strong></span></p> <p><span style="font-family: SimSun">W十一?/span><span style="font-family: SimSun">对妊娠期的女职工Q?strong><span style="color: red">不应廉其劳动时?/strong>Q?/span></span></p> <p><span style="font-family: SimSun">W十四条</span><span style="font-family: SimSun">奌工假分别按下列情况执行Q?/span></p> <p>     <span style="font-family: SimSun">Q一Q单胎顺产者,l予<span style="color: red">产假九十天,其中产前休息十五天,产后休息七十五天?/span></span></p> <p><span style="font-family: SimSun">W十五条</span><span style="font-family: SimSun">奌工生育后Q在其婴儿一周岁内应照顾其在每班力_旉?span style="color: red">授^两次Q包括h工喂养)?span style="color: red">每次</span>单胎U授x间ؓ<span style="color: red">三十分钟</span>Q亦可将两次授^旉合ƈ使用。多胞胎生育者,每多生一胎,每次Z^旉增加三十分钟?/span></span></p> <p> <span style="font-family: SimSun">W十八条</span><span style="font-family: SimSun">奌工在<span style="color: red">产假期间的工资照发。按本规定n受的<span style="color: red">产前假和Z^假的工资</span>按本人原工资?span style="color: red">癑ֈ之八十发l?/span>。单位增加工资时Q女职工按规定n受的产前假、假、哺乛_Q应作出勤对待?/span></span></p> <p><strong><span style="color: red">    </strong></span></p> <p style="margin-left: 36pt; text-indent: -36pt; tab-stops: list 0cm"><span style="font-family: Symbol">·<span style="font: 7pt 'Times New Roman'">                     </span><strong><span style="font-family: SimSun">l论Q?/span></strong></span></p> <p style="margin-left: 36pt; text-indent: -27pt; tab-stops: list 36.0pt"><strong><span style="color: red">1Q?span style="font: 7pt 'Times New Roman'">      </span></strong><strong><span style="color: red; font-family: SimSun">认定力_关系Q工作证</span></strong></span></p> <p style="margin-left: 36pt; text-indent: -27pt; tab-stops: list 36.0pt"><strong><span style="color: red">2Q?span style="font: 7pt 'Times New Roman'">      </span></strong><strong><span style="color: red; font-family: SimSun">是否{֐?/span></strong></span></p> <p style="margin-left: 36pt; text-indent: -27pt; tab-stops: list 36.0pt"><strong><span style="color: red">3Q?span style="font: 7pt 'Times New Roman'">      </span></strong><strong><span style="color: red; font-family: SimSun">如果没签合同Q怎么补偿Q?/span></strong></span><span style="color: red">1</span><span style="color: red; font-family: SimSun">Q?strong>相当于给</strong></span><strong><span style="color: red">2</strong></span><strong><span style="color: red; font-family: SimSun">倍工资,</strong></span><strong><span style="color: red">2</strong></span><strong><span style="color: red; font-family: SimSun">Q补合同Q?/strong></span><strong><span style="color: red">3</strong></span><strong><span style="color: red; font-family: SimSun">Q如果辞退Q再按照有合同补偿)</strong></span></p> <p style="margin-left: 36pt; text-indent: -27pt; tab-stops: list 36.0pt"><strong><span style="color: red">4Q?span style="font: 7pt 'Times New Roman'">      </span></strong><strong><span style="color: red; font-family: SimSun">如果是固定合同,怎么补偿Q?/span></strong></span><strong><span style="color: red">N+1</strong></span><strong><span style="color: red; font-family: SimSun">Q?/strong></span></p> <p style="margin-left: 36pt; text-indent: -27pt; tab-stops: list 36.0pt"><strong><span style="color: red">5Q?span style="font: 7pt 'Times New Roman'">      </span></strong><strong><span style="color: red; font-family: SimSun">如果是无期合同,</span></strong></span><strong><span style="color: red">2</strong></span><strong><span style="color: red; font-family: SimSun">?/strong></span></p> <p style="margin-left: 36pt; text-indent: -27pt; tab-stops: list 36.0pt"><strong><span style="color: red">6Q?span style="font: 7pt 'Times New Roman'">      </span></strong><strong><span style="color: red; font-family: SimSun">孕妇怎么处理Q?/span></strong></span></p> <p style="margin-left: 9pt"><span style="background: silver; color: #333333">1</span><span style="background: silver; color: #333333; font-family: SimSun">、公司辞退孕妇的补偿情冉|准是怎样Q?/span></p> <p style="margin-left: 9pt"><span style="background: silver; color: #333333; font-family: SimSun">{:发放工资到哺x满;按工作年限计经补偉K?/span></p> <p style="margin-left: 9pt"><span style="background: silver; color: #333333">2</span><span style="background: silver; color: #333333; font-family: SimSun">、公司是否可以以我的考核和我是孕产妇不能胜Q工作为由Ҏq行降职降降薪处理Q?/span></p> <p style="margin-left: 9pt"><span style="background: silver; color: #333333; font-family: SimSun">{:不可以?/span></p> <p style="margin-left: 9pt"><span style="background: silver; color: #333333; font-family: SimSun">我们的工资分为基本工资(U占</span><span style="background: silver; color: #333333">1/4)+</span><span style="background: silver; color: #333333; font-family: SimSun">岗位工资</span><span style="background: silver; color: #333333">+</span><span style="background: silver; color: #333333; font-family: SimSun">l效工资{。是否可能出现只要不降低我的基本工资是合法的行为?</span></p> <p style="margin-left: 9pt"><span style="background: silver; color: #333333; font-family: SimSun">{:不合理。工资是包括了岗位工资和l效工资?/span></p> <p style="margin-left: 9pt"><span style="background: silver; color: #333333">3</span><span style="background: silver; color: #333333; font-family: SimSun">、如果公怾法破产,我是否有向集团主张赔偿的权利Q?/span></p> <p style="margin-left: 9pt"><span style="background: silver; color: #333333; font-family: SimSun">{:破也可以主张权利,在破产胦产中优先演戏ѝ?/span></p> <p style="margin-left: 9pt"><span style="background: silver; color: #333333">4</span><span style="background: silver; color: #333333; font-family: SimSun">、如果可能需要诉诸法律,我应该准备哪些方面的举证Q?/span></p> <p style="margin-left: 9pt"><span style="background: silver; color: #333333; font-family: SimSun">{:存在力_关系的证据最重要Q此外,工资条、怀孕的证据、结婚证、准生证</span></p> <p style="margin-left: 9pt"><span style="background: silver; color: #333333; font-family: SimSun">也比较重要?/span><span style="background: silver; color: #333333; font-family: SimSun">Q?/span><strong><span style="background: silver; color: red; font-family: SimSun">按照力_?/span></strong><strong><span style="background: silver; color: red">42</span></strong><strong><span style="background: silver; color: red; font-family: SimSun">条,不得解除三期【孕期、期、哺x】妇奟뀂那么如果一定要q反力_法解除劳动关p,只能按照q反力_法,按照W八十七条进行二倍赔偿,也就?/span></strong><strong><span style="background: silver; color: red">3</span></strong><strong><span style="background: silver; color: red; font-family: SimSun">倍)</span></strong></p> <p style="margin-left: 9pt"><strong><span style="font-size: 13.5pt; color: #333333; font-family: 'QS 明朝'">案例</span></strong><strong><span style="font-size: 13.5pt; color: #333333">:</span></strong></p> <p style="margin-left: 9pt"><strong><span style="font-size: 13.5pt; color: #333333"><a >http://www.tianya.cn/publicforum/content/law/1/119373.shtml</a> </span></strong></p> <p style="margin-left: 9pt"><span style="background: silver; font-family: 'QS 明朝'">案情Q?/span><span style="background: silver">A</span><span style="background: silver; font-family: 'QS 明朝'">公司辞退</span><span style="background: silver">B</span><span style="background: silver; font-family: 'QS 明朝'">?/span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver; font-family: 'QS 明朝'">Q不?/span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver">B</span><span style="background: silver; font-family: 'QS 明朝'">可能存在?/span><span style="background: silver; font-family: SimSun">q错</span><span style="background: silver; font-family: 'QS 明朝'">Q假</span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver">A</span><span style="background: silver; font-family: 'QS 明朝'">毫无道理毫无依据的辞退</span><span style="background: silver">B</span><span style="background: silver; font-family: 'QS 明朝'">?/span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver; font-family: 'QS 明朝'">Q?/span></p> <p style="margin-left: 9pt"><span style="background: silver; font-family: 'QS 明朝'">  </span><span style="background: silver; font-family: 'QS 明朝'">一</span><span style="background: silver; font-family: SimSun">审结</span><span style="background: silver; font-family: 'QS 明朝'">果:<strong><span style="color: red">?/span></strong></span><strong><span style="background: silver; color: red; font-family: SimSun">?/span></strong><strong><span style="background: silver; color: red; font-family: 'QS 明朝'">?/span></strong><strong><span style="background: silver; color: red; font-family: SimSun">?/span></strong><strong><span style="background: silver; color: red; font-family: 'QS 明朝'">孕期?/span></strong><strong><span style="background: silver; color: red; font-family: SimSun">?/span></strong><strong><span style="background: silver; color: red; font-family: 'QS 明朝'">、全</span></strong><strong><span style="background: silver; color: red; font-family: SimSun">额</span></strong><strong><span style="background: silver; color: red; font-family: 'QS 明朝'">期(</span></strong><strong><span style="background: silver; color: red; font-family: SimSun">?/span></strong><strong><span style="background: silver; color: red; font-family: 'QS 明朝'">?/span></strong><strong><span style="background: silver; color: red; font-family: SimSun">q?/span></strong><strong><span style="background: silver; color: red; font-family: 'QS 明朝'">加了</span></strong><strong><span style="background: silver; color: red">15</span></strong><strong><span style="background: silver; color: red; font-family: 'QS 明朝'">天)?/span></strong><strong><span style="background: silver; color: red; font-family: SimSun">?/span></strong><strong><span style="background: silver; color: red; font-family: 'QS 明朝'">?/span></strong><strong><span style="background: silver; color: red">75%</span></strong><strong><span style="background: silver; color: red; font-family: 'QS 明朝'">的哺x?/span></strong><strong><span style="background: silver; color: red; font-family: SimSun">?/span></strong><span style="background: silver; font-family: 'QS 明朝'">Qƈ以入</span><span style="background: silver; font-family: SimSun">职时?/span><span style="background: silver; font-family: 'QS 明朝'">至三期届</span><span style="background: silver; font-family: SimSun">满ؓ力_</span><span style="background: silver; font-family: 'QS 明朝'">合同</span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver; font-family: 'QS 明朝'">pd</span><span style="background: silver; font-family: SimSun">l?/span><span style="background: silver; font-family: 'QS 明朝'">?/span><span style="background: silver; font-family: SimSun">间计</span><span style="background: silver; font-family: 'QS 明朝'">在</span><span style="background: silver; font-family: SimSun">职时?/span><span style="background: silver; font-family: 'QS 明朝'">Q然后以</span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver; font-family: 'QS 明朝'">?/span><span style="background: silver; font-family: SimSun">职时?/span><span style="background: silver; font-family: 'QS 明朝'">按照?/span><span style="background: silver; font-family: SimSun">力_</span><span style="background: silver; font-family: 'QS 明朝'">合同法》第八十七条?/span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver; font-family: 'QS 明朝'">?/span><strong><span style="background: silver; color: red; font-family: SimSun">赔偿</span></strong><strong><span style="background: silver; color: red; font-family: 'QS 明朝'">金(卛_法解除的</span></strong><strong><span style="background: silver; color: red; font-family: SimSun">补偿</span></strong><strong><span style="background: silver; color: red; font-family: 'QS 明朝'">金的双倍)</span></strong><span style="background: silver; font-family: 'QS 明朝'">。一</span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver; font-family: 'QS 明朝'">不是我代理的?/span></p> <p style="margin-left: 9pt"><span style="background: silver; font-family: 'QS 明朝'">  </span><span style="background: silver; font-family: 'QS 明朝'">?/span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver">A</span><span style="background: silver; font-family: 'QS 明朝'">公司扑ֈ我,我想当然的以</span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver; font-family: 'QS 明朝'">Q按照?/span><span style="background: silver; font-family: SimSun">力_</span><span style="background: silver; font-family: 'QS 明朝'">合同法》第八十七条?/span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver; font-family: 'QS 明朝'">定,</span><span style="background: silver; font-family: SimSun">力_</span><span style="background: silver; font-family: 'QS 明朝'">者可?/span><span style="background: silver; font-family: SimSun">选择</span><span style="background: silver; font-family: 'QS 明朝'">要求</span><span style="background: silver; font-family: SimSun">l箋</span><span style="background: silver; font-family: 'QS 明朝'">履行Q不要求</span><span style="background: silver; font-family: SimSun">l箋</span><span style="background: silver; font-family: 'QS 明朝'">履行的,</span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver; font-family: 'QS 明朝'">?/span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver; font-family: 'QS 明朝'">支付双?/span><span style="background: silver; font-family: SimSun">补偿</span><span style="background: silver; font-family: 'QS 明朝'">卛_Q一</span><span style="background: silver; font-family: SimSun">?/span><span style="background: silver; font-family: 'QS 明朝'">判决属适用法律</span><span style="background: silver; font-family: SimSun">错误</span><span style="background: silver; font-family: 'QS 明朝'">?/span></p> <img src ="http://m.tkk7.com/jinfeng_wang/aggbug/315853.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jinfeng_wang/" target="_blank">jinfeng_wang</a> 2010-03-19 00:27 <a href="http://m.tkk7.com/jinfeng_wang/archive/2010/03/19/315853.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>谈谈ZKerberos的Windows Network Authentication zzhttp://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132605.htmljinfeng_wangjinfeng_wangThu, 26 Jul 2007 10:02:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132605.htmlhttp://m.tkk7.com/jinfeng_wang/comments/132605.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132605.html#Feedback17http://m.tkk7.com/jinfeng_wang/comments/commentRss/132605.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/132605.htmlhttp://www.cnblogs.com/artech/archive/2007/07/05/807492.html 


前几天在lh解释Windows是如何通过Kerberosq行Authentication的时候,讲了半天也别把那位老兄讲明白,q差Ҏ自己l绕q去。后来想惛_因有以下两点Q对于一个没有完全不了解Kerberos的h来说QKerberos的整个Authenticationq程实不好理解——一会儿以这个Keyq行加密、一会儿又要以另一个Keyq行加密Q确实很Ҏ把hl弄晕;另一斚w是我讲解方式有问题,一开始就从Kerberos?个Sub-protocol全面讲述整个Authentication q程Q对于一个完全不了解Kerberos的h来说要求也忒高了炏Vؓ此,我花了一些时间写了这文章,量以由入深、层层深入的方式讲述我所理解的基于Kerberos的Windows Network AuthenticationQ希望这文章能帮助那些对Kerberos不明里的h带来一丝帮助。对于一些不对的地方Q欢q大家批评指正?/p>

一?nbsp;基本原理

Authentication解决的是“如何证明某个人确实实就是他或她所声称的那个h”的问题。对于如何进行AuthenticationQ我们采用这LҎQ如果一个秘密(secretQ仅仅存在于A和BQ那么有个h对B声称自己是AQB通过让A提供q个U密来证明这个h是他或Ҏ声称的A。这个过E实际上涉及?个重要的关于Authentication的方面:

  • Secret如何表示?/div>
  • A如何向B提供Secret?/div>
  • B如何识别Secret?/div>

Zq?个方面,我们把Kerberos Authenticationq行最大限度的化:整个q程涉及到Client和ServerQ他们之间的q个Secret我们用一个KeyQ?strong>KServer-ClientQ来表示。ClientZ让Server对自p行有效的认证Q向Ҏ提供如下两组信息Q?/p>

  • 代表Client自nIdentity的信息,Z便,它以明文的Ş式传递?/div>
  • Client的Identity使用KServer-Client作ؓPublic Key、ƈ采用对称加密法q行加密?/div>

׃KServer-Client仅仅被Client和Server知晓Q所以被Client使用KServer-Client加密q的Client Identity只能被Client和Server解密。同理,Server接收到Client传送的q两l信息,先通过KServer-Client对后者进行解密,随后机密的数据同前者进行比较,如果完全一P则可以证明Client能过提供正确?strong>KServer-ClientQ而这个世界上Q仅仅只有真正的Client和自q?strong>KServer-ClientQ所以可以对方就是他所声称的那个h?br>


Keberos大体上就是按照这L一个原理来q行Authentication的。但是Kerberosq比q个复杂Q我在后箋的章节中不断地扩充这个过E,知道Kerberos真实的认证过E。ؓ了读者更加容易理解后l的部分Q在q里我们先给Z个重要的概念Q?/p>

  • Long-term Key/Master KeyQ在Security的领域中Q有的Key可能长期内保持不变,比如你在密码Q可能几q都不曾改变Q这LKey、以及由此派生的Key被称为Long-term Key。对于Long-term Key的用有q样的原则:被Long-term Key加密的数据不应该在网l上传输。原因很单,一旦这些被Long-term Key加密的数据包被恶意的|络监听者截P在原则上Q只要有充的时_他是可以通过计算获得你用于加密的Long-term Key的——Q何加密算法都不可能做到绝对保密?/div>

在一般情况下Q对于一个Account来说Q密码往往仅仅限于该Account的所有者知晓,甚至对于MDomain的AdministratorQ密码仍然应该是保密的。但是密码却又是证明w䆾的凭据,所以必通过Z你密码的z的信息来证明用户的真实n份,在这U情况下Q一般将你的密码q行Hashq算得到一个Hash code, 我们一般管q样的Hash Code叫做Master Key。由于Hash Algorithm是不可逆的Q同时保证密码和Master Key是一一对应的,q样既保证了你密码的保密性,有同时保证你的Master Key和密码本w在证明你n份的时候具有相同的效力?/p>

  • Short-term Key/Session KeyQ由于被Long-term Key加密的数据包不能用于|络传送,所以我们用另一UShort-term Key来加密需要进行网l传输的数据。由于这UKey只在一D|间内有效Q即使被加密的数据包被黑客截P{他把Key计算出来的时候,q个Key早就已经q期了?/div>

二、引入Key Distribution: KServer-Client从何而来

上面我们讨论了Kerberos Authentication的基本原理:通过让被认证的一Ҏ供一个仅限于他和认证方知晓的Key来鉴定对方的真实w䆾。而被q个Key加密的数据包需要在Client和Server之间传送,所以这个Key不能是一?strong>Long-term KeyQ而只可能?strong>Short-term KeyQ这个可以仅仅在Client和Server的一个Session中有效,所以我们称q个Key为Client和Server之间的Session KeyQ?strong>SServer-ClientQ?/p>

现在我们来讨论Client和Server如何得到q个SServer-Client。在q里我们要引入一个重要的角色Q?strong>Kerberos Distribution Center-KDC。KDC在整个Kerberos Authentication中作为Client和Server共同信Q的第三方L重要的作用,而Kerberos的认证过E就是通过q?方协作完成。顺便说一下,Kerberosh于希腊神话,是一支守护着冥界长着3个头颅的犬Q在keberos Authentication中,Kerberos?个头颅代表中认证q程中涉及的3方:Client、Server和KDC?/p>

对于一个Windows Domain来说Q?strong>Domain Controller扮演着KDC的角艌ӀKDCl护着一个存储着该Domain中所有帐LAccount DatabaseQ一般地Q这个Account Database?strong>AD来维护)Q也是_他知道属于每个Account的名U和z于该Account Password?strong>Master Key。而用于Client和Server怺认证?strong>SServer-Client是有KDC分发。下面我们来看看KDC分发SServer-Client的过E?/p>

通过下图我们可以看到KDC分发SServer-Client的简单的q程Q首先Client向KDC发送一个对SServer-Client的申诗这个申L内容可以单概括ؓ“我是某个ClientQ我需要一个Session Key用于讉K某个Server ”。KDC在接收到q个h的时候,生成一个Session KeyQؓ了保证这个Session Key仅仅限于发送请求的Client和他希望讉K的Server知晓QKDC会ؓq个Session Key生成两个CopyQ分别被Client和Server使用。然后从Account database中提取Client和Server的Master Key分别对这两个Copyq行对称加密。对于后者,和Session Key一赯加密的还包含关于Client的一些信息?/p>

KDC现在有了两个分别被Client和Server 的Master Key加密q的Session KeyQ这两个Session Key如何分别被Client和Server获得呢?也许?马上会说QKDC直接这两个加密q的包发送给Client和Server不就可以了吗Q但是如果这样做Q对于Server来说会出C?两个问题Q?/p>

  • ׃一个Server会面对若q不同的Client, 而每个Client都具有一个不同的Session Key。那么Server׃为所有的Clientl护q样一个Session Key的列表,q样做对于Server来说是比较麻烦而低效的?/div>
  • ׃|络传输的不定性,可能出现q样一U情况:Client很快获得Session KeyQƈ这个Session Key作ؓCredential随同讉Kh发送到ServerQ但是用于Server的Session Key还没有收到Qƈ且很有可能承载这个Session Key的永q也C了Server端,Client永q得不到认证?/div>

Z解决q个问题QKerberos的做法很单,这两个被加密的Copy一q发送给ClientQ属于Server的那份由Client发送给Server?br>


可能有h会问QKDCq没有真正去认证q个发送请求的Client是否真的是那个他所声称的那个hQ就把Session Key发送给他,会不会有什么问题?如果另一个hQ比如Client BQ声U自己是Client AQ他同样会得到Client A和Server的Session KeyQ这会不会有什么问题?实际上不存在问题Q因为Client B声称自己是Client AQKDC׃使用Client A的Passwordz的Master Key对Session Keyq行加密Q所以真正知道Client A 的Password的一Ҏ会通过解密获得Session Key?nbsp;

三、引入Authenticator - 为有效的证明自己提供证据

通过上面的过E,Client实际上获得了两组信息Q一个通过自己Master Key加密的Session KeyQ另一个被Sever的Master Key加密的数据包Q包含Session Key和关于自q一些确认信息。通过W一节,我们说只要通过一个双方知晓的Key可以对Ҏq行有效的认证,但是在一个网l的环境中,q种单的做法是具有安全漏z,为此,Client需要提供更多的证明信息Q我们把q种证明信息UCؓAuthenticatorQ在Kerberos的Authenticator实际上就?strong>关于Client的一些信?/strong>和当前时间的一?strong>TimestampQ关于这个安全漏z和Timestamp的作用,我将在后面解释)?/p>

在这个基上,我们再来看看Server如何对Clientq行认证QClient通过自己的Master Key对KDC加密的Session Keyq行解密从而获?strong>Session KeyQ随后创?strong>AuthenticatorQClient Info + TimestampQ?/strong>q用Session Key对其加密。最后连同从KDC获得的、被Server的Master Key加密q的数据包(Client Info + Session KeyQ一q发送到Server端。我们把通过Server的Master Key加密q的数据包称?strong>Session Ticket?/p>

当Server接收到这两组数据后,先用他自己的Master Key对Session Ticketq行解密Q从而获?strong>Session Key。随后用该Session Key解密AuthenticatorQ通过比较Authenticator中的Client Info?strong>Session Ticket中的Client Info从而实现对Client的认证?br>


Z么要使用TimestampQ?/strong>

到这里,很多人可能认L认证q程天衣无缝Q只有当Client提供正确的Session Key方能得到Server的认证。但是在现实环境中,q存在很大的安全漏洞?/p>

我们试想q样的现象:Client向Server发送的数据包被某个恶意|络监听者截P该监听者随后将数据包位自qCredential冒充该Client对Serverq行讉KQ在q种情况下,依然可以很顺利地获得Server的成功认证。ؓ了解册个问题,Client?strong>Authenticator中会加入一个当前时间的Timestamp?/p>

在Server对Authenticator中的Client Info和Session Ticket中的Client Infoq行比较之前Q会先提取Authenticator中的TimestampQƈ?strong>当前的时?/strong>q行比较Q如果他们之间的偏差出一个可?strong>接受的时间范_一般是5minsQ,Server会直接拒l该Client的请求。在q里需要知道的是,Serverl护着一个列表,q个列表记录着在这个可接受的时间范围内所有进行认证的Client和认证的旉。对于时间偏差在q个可接受的范围中的ClientQServer会从q个q个列表中获?strong>最q一个该Client的认证时?/strong>Q只有当Authenticator中的Timestamp晚于通过一个Client的最q的认证旉的情况下QServer采用q行后箋的认证流E?/p>

Time Synchronization的重要?/strong>

上述 ZTimestamp的认证机制只有在Client和Server端的旉保持同步的情冉|有意义。所以保持Time Synchronization在整个认证过E中昑־ؓ重要。在一个Domain中,一般通过讉K同一?strong>Time Service获得当前旉的方式来实现旉的同步?/p>

双向认证QMutual AuthenticationQ?/strong>

Kerberos一个重要的优势在于它能够提供双向认证:不但Server可以对Client q行认证QClient也能对Serverq行认证?/p>

具体q程是这LQ如果Client需要对他访问的Serverq行认证Q会在它向Server发送的Credential中设|一个是否需要认证的Flag。Server在对Client认证成功之后Q会把Authenticator中的Timestamp提出出来Q通过Session Keyq行加密Q当Client接收到ƈ使用Session Keyq行解密之后Q如果确?strong>Timestamp和原来的完全一_那么他可以认定Server正式他试图访问的Server?/p>

那么Z么Server不直接把通过Session Keyq行加密的Authenticator原样发送给ClientQ而要把Timestamp提取出来加密发送给Client呢?原因在于防止恶意的监听者通过获取的Client发送的Authenticator冒充Server获得Client的认证?br>

四、引入Ticket Granting  Service

通过上面的介l,我们发现Kerberos实际上一个基?strong>Ticket的认证方式。Client惌获取Server端的资源Q先得通过Server的认证;而认证的先决条g是Client向Server提供从KDC获得的一个有Server的Master Keyq行加密?strong>Session TicketQSession Key + Client InfoQ?/strong>。可以这么说QSession Ticket是Clientq入Server领域的一张门。而这张门必M一个合法的Ticket颁发机构获得Q这个颁发机构就?strong>Client和Server双方信Q的KDCQ?同时q张Ticketh强的防伪标识:它是被Server的Master Key加密的。对Client来说Q?获得Session Ticket是整个认证过E中最为关键的部分?/p>

上面我们只是单地从大体上说明了KDC向Client分发Ticket的过E,而真正在Kerberos中的Ticket Distribution要复杂一些。ؓ了更好的说明整个Ticket Distribution的过E,我在q里做一个类比。现在的股事很火爆,上v基本上是全民炒股Q我׃D一个认股权证的例子。有的上市公司在股票配股、增发、基金扩募、股份减持等情况会向公众发行认股权证Q认股权证的持有人可以凭借这个权证认购一定数量的该公司股,认股权证是一U具有看涨期权的金融衍生产品?/p>

而我们今天所讲的Client获得Ticket的过E也和通过认股权证购买股票的过E类伹{如果我们把Client提供lServerq行认证的Ticket比作股票的话Q那么Client在从KDC那边获得Ticket之前Q需要先获得q个Ticket的认购权证,q个认购权证在Kerberos中被UCؓTGTQTicket Granting TicketQTGT的分发方仍然是KDC?/p>

我们现在来看看Client是如何从KDC处获得TGT的:首先Client向KDC发v对TGT的申P甌的内容大致可以这栯C:“我需要一张TGT用以甌获取用以讉K所有Server的Ticket”。KDC在收到该甌h后,生成一个用于该Client和KDCq行安全通信?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>。ؓ了保证该Session Key仅供该Client和自׃用,KDC使用Client的Master Key?strong>自己的Master Key对生成的Session Keyq行加密Q从而获得两个加密的SKDC-Client的Copy。对于后者,?strong>SKDC-Client一赯加密的还包含以后用于鉴定Clientw䆾的关于Client的一些信息。最后KDC这两䆾Copy一q发送给Client。这里有一炚w要注意的是:Z免去KDC对于Z不同Client的Session Keyq行l护的麻烦,像Server不会保存Session KeyQ?span style="FONT-SIZE: 12pt">SServer-ClientQ?/strong>一PKDC也不会去保存q个Session KeyQ?strong>SKDC-ClientQ,而选择完全靠Client自己提供的方式?br>


当Client收到KDC的两个加密数据包之后Q先使用自己的Master Key对第一个Copyq行解密Q从而获得KDC和Client?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>Qƈ把该Session 和TGTq行~存。有了Session Key和TGTQClient自己的Master Key不再需要,因ؓ此后Client可以使用SKDC-Client向KDC甌用以讉K每个Server的TicketQ相对于Client的Master Keyq个Long-term KeyQSKDC-Client是一个Short-term KeyQ安全保证得到更好的保障Q这也是Kerberos多了q一步的关键所在。同旉要注意的是SKDC-Client是一个Session KeyQ他h自己的生命周期,同时TGT和Session怺兌Q当Session Keyq期QTGT也就宣告失效Q此后Client不得不重新向KDC甌新的TGTQKDC会生成一个不同Session Key和与之关联的TGT。同Ӟ׃Client Log off也导致SKDC-Client的失效,所以SKDC-Client又被UCؓLogon Session Key?/p>

接下来,我们看看Client如何使用TGT来从KDC获得Z某个Server的Ticket。在q里我要一下,Ticket是基于某个具体的Server的,而TGT则是和具体的Server无关的,Client可以使用一个TGT从KDC获得Z不同Server的Ticket。我们言归正传,Client在获得自己和KDC?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>之后Q生成自qAuthenticator以及所要访问的Server名称的ƈ使用SKDC-Clientq行加密。随后连同TGT一q发送给KDC。KDC使用自己的Master Key对TGTq行解密Q提取Client Info?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>Q然后用这?strong>SKDC-Client解密Authenticator获得Client InfoQ对两个Client Infoq行比较q而验证对方的真实w䆾。验证成功,生成一份基于Client所要访问的Server的TicketlClientQ这个过E就是我们第二节中介l的一样了?nbsp;


五、Kerberos?个Sub-protocolQ整个Authentication

通过以上的介l,我们基本上了解了整个Kerberos authentication的整个流E:整个程大体上包含以?个子q程Q?/p>

  1. Client向KDC甌TGTQTicket Granting TicketQ?/div>
  2. Client通过获得TGT向DKC甌用于讉KServer的Ticket?/div>
  3. Client最l向ZServer对自q认证向其提交Ticket?/div>

不过上面的介l离真正的Kerberos Authenticationq是有一点出入。Kerberos整个认证q程通过3个sub-protocol来完成。这?个Sub-Protocol分别完成上面列出?个子q程。这3个sub-protocol分别为:

  1. Authentication Service Exchange
  2. Ticket Granting Service Exchange
  3. Client/Server Exchange

下图单展CZ完成q个3个Sub-protocol所q行Message Exchange?br>


1Q?Authentication Service Exchange

通过q个Sub-protocolQKDCQ确切地说是KDC中的Authentication ServiceQ实现对Clientw䆾的确认,q发给该Client一个TGT。具体过E如下:

Client向KDC的Authentication Service发送Authentication Service RequestQ?strong>KRB_AS_REQQ? Z保KRB_AS_REQ仅限于自己和KDC知道QClient使用自己的Master Key对KRB_AS_REQ的主体部分进行加密(KDC可以通过Domain 的Account Database获得该Client的Master KeyQ。KRB_AS_REQ的大体包含以下的内容Q?/p>

  • Pre-authentication dataQ包含用以证明自pn份的信息。说白了Q就是证明自q道自己声U的那个account的Password。一般地Q它的内Ҏ一个被Client的Master key加密q的Timestamp?/div>
  • Client name & realm: 单地说就是Domain name\Client
  • Server NameQ注意这里的Server Nameq不是Client真正要访问的Server的名Uͼ而我们也说了TGT是和Server无关的(Client只能使用TicketQ而不是TGT去访问ServerQ。这里的Server Name实际上是KDC的Ticket Granting Service的Server Name?/div>

ASQAuthentication ServiceQ通过它接收到的KRB_AS_REQ验证发送方的是否是在Client name & realm中声U的那个人,也就是说要验证发送放是否知道Client的Password。所以AS只需从Account Database中提取Client对应的Master Key对Pre-authentication dataq行解密Q如果是一个合法的TimestampQ则可以证明发送放提供的是正确无误的密码。验证通过之后QAS一份Authentication Service ResponseQKRB_AS_REPQ发送给Client。KRB_AS_REQ主要包含两个部分Q本Client的Master Key加密q的Session KeyQSKDC-ClientQLogon Session KeyQ和被自己(KDCQ加密的TGT。而TGT大体又包含以下的内容Q?/p>

  • Session Key: SKDC-ClientQLogon Session Key
  • Client name & realm: 单地说就是Domain name\Client
  • End time: TGT到期的时间?/div>

Client通过自己的Master Key对第一部分解密获得Session KeyQSKDC-ClientQLogon Session KeyQ之后,携带着TGT便可以进入下一步:TGSQTicket Granting ServiceQExchange?/p>

2Q?TGSQTicket Granting ServiceQExchange

TGSQTicket Granting ServiceQExchange通过Client向KDC中的TGSQTicket Granting ServiceQ发送Ticket Granting Service RequestQ?strong>KRB_TGS_REQQ开始。KRB_TGS_REQ大体包含以下的内容:

  • TGTQClient通过AS Exchange获得的Ticket Granting TicketQTGT被KDC的Master Keyq行加密?/div>
  • AuthenticatorQ用以证明当初TGT的拥有者是否就是自己,所以它必须以TGT的办法方和自qSession KeyQSKDC-ClientQLogon Session KeyQ来q行加密?/div>
  • Client name & realm: 单地说就是Domain name\Client?/div>
  • Server name & realm: 单地说就是Domain name\ServerQ这回是Client试图讉K的那个Server?/div>

TGS收到KRB_TGS_REQ在发lClient真正的Ticket之前Q先得整个Client提供的那个TGT是否是AS颁发l它的。于是它不得不通过Client提供的Authenticator来证明。但是Authentication是通过Logon Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>q行加密的,而自己ƈ没有保存q个Session Key。所以TGS先得通过自己的Master Key对Client提供的TGTq行解密Q从而获得这个Logon Session KeyQSKDC-ClientQ,再通过q个Logon Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>解密Authenticatorq行验证。验证通过向对方发送Ticket Granting Service ResponseQKRB_TGS_REPQ。这个KRB_TGS_REP有两部分l成Q?strong>Logon Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>加密q用于Client和Server?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SServer-ClientQ?/strong>和?strong>Server的Master Keyq行加密的Ticket。该Ticket大体包含以下一些内容:

  • Session KeyQSServer-Client?/div>
  • Client name & realm: 单地说就是Domain name\Client?/div>
  • End time: Ticket的到期时间?/div>

Client收到KRB_TGS_REPQ?strong>Logon Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ClientQ?/strong>解密W一部分后获?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SServer-ClientQ?/strong>。有了Session Key和TicketQClient可以之间和Serverq行交互Q而无d通过KDC作中间h了。所以我们说Kerberos是一U高效的认证方式Q它可以直接通过Client和Server双方来完成,不像Windows NT 4下的NTLM认证方式Q每ơ认证都要通过一个双方信ȝW?Ҏ完成?/p>

我们现在来看?Client如果使用Ticket和Server怎样q行交互的,q个阶段通过我们的第3个Sub-protocol来完成:CSQClient/Server QExchange?/p>

3Q?CSQClient/Server QExchange

q个已经在本文的W二节中已经介绍q,对于重复发内容就不再累赘了。Client通过TGS Exchange获得Client和Server?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SServer-ClientQ?/strong>Q随后创建用于证明自己就是Ticket的真正所有者的AuthenticatorQƈ使用Session KeyQ?span style="FONT-SIZE: 12pt">SServer-ClientQ?/strong>q行加密。最后将q个被加密过的Authenticator和Ticket作ؓApplication Service RequestQKRB_AP_REQQ发送给Server。除了上qC内容之外,KRB_AP_REQq包含一个Flag用于表示Client是否需要进行双向验证(Mutual AuthenticationQ?/p>

Server接收到KRB_AP_REQ之后Q通过自己的Master Key解密TicketQ从而获得Session KeyQSServer-ClientQ。通过Session KeyQSServer-ClientQ解密AuthenticatorQ进而验证对方的w䆾。验证成功,让Client讉K需要访问的资源Q否则直接拒l对方的h?/p>

对于需要进行双向验证,Server从Authenticator提取TimestampQ用Session KeyQSServer-ClientQ进行加密,q将其发送给Client用于Client验证Server的n份?br>

六、User2User Sub-ProtocolQ有效地保障Server的安?/strong>

通过3个Sub-protocol的介l,我们可以全面地掌握整个Kerberos的认证过E。实际上Q在Windows 2000时代Q基于Kerberos的Windows Authentication是按照q样的工作流E来q行的。但是我在上面一节结束的时候也说了Q基?个Sub-protocol的Kerberos作ؓ一UNetwork Authentication是具有它自己的局限和安全隐患的。我在整文章一直在q样的一个原则:以某个Entity的Long-term Key加密的数据不应该在网l中传?/strong>。原因很单,所有的加密法都不能保?00%的安全,对加密的数据q行解密只是一个时间的q程Q最大限度地提供安全保障的做法就是:使用一个Short-term keyQSession KeyQ代替Long-term KeyҎ据进行加密,使得恶意用户对其解密获得加密的KeyӞ该Key早已失效。但是对?个Sub-Protocol的C/S ExchangeQClient携带的Ticket却是?strong>Server Master Keyq行加密的,q显CW合我们提出的原则,降低Server的安全系数?/p>

所以我们必d求一U解x案来解决上面的问题。这个解x案很明显Q就是采用一个Short-term的Session KeyQ而不是Server Master Key对Ticketq行加密。这是我们今天要介l的Kerberos的第4个Sub-protocolQ?strong>User2User Protocol。我们知道,既然是Session KeyQ仅必然涉及C方,而在Kerberos整个认证q程涉及?方:Client、Server和KDCQ所以用于加密Ticket的只可能是Server和KDC之间?strong>Session KeyQ?span style="FONT-SIZE: 12pt">SKDC-ServerQ?/strong>

我们知道Client通过在AS Exchange阶段获得的TGT从KDC那么获得讉KServer的Ticket。原来的Ticket是通过Server的Master Keyq行加密的,而这个Master Key可以通过Account Database获得。但是现在KDC需要用Server和KDC之间?strong>SKDC-Serverq行加密Q而KDC是不会维护这个Session KeyQ所?strong>q个Session Key只能靠申请Ticket的Client提供。所以在AS Exchange和TGS Exchange之间QClientq得对Serverq行h已获得Server和KDC之间的Session KeyQ?strong>SKDC-ServerQ。而对于Server来说Q它可以像Client一样通过AS Exchange获得他和KDC之间的Session KeyQ?strong>SKDC-ServerQ和一个封装了q个Session Keyq被KDC的Master Keyq行加密的TGTQ一旦获得这个TGTQServer会缓存它Q以待Client对它的请求。我们现在来详细地讨一q程?br>


上图基本上翻译了ZUser2User的认证过E,q个q程?个步骤组成。我们发现较之我在上面一节介l的Z传统3个Sub-protocol的认证过E,q次对了W?部。我们从头到单地q一遍:

  1. AS ExchangeQClient通过此过E获得了属于自己的TGTQ有了此TGTQClient可凭此向KDC甌用于讉K某个Server的Ticket?/div>
  2. q一步的主要d是获得封装了Server和KDC的Session KeyQSKDC-ServerQ的属于Server的TGT。如果该TGT存在于Server的缓存中Q则Server会直接将其返回给Client。否则通过AS Exchange从KDC获取?/div>
  3. TGS ExchangeQClient通过向KDC提供自己的TGTQServer的TGT以及Authenticator向KDC甌用于讉KServer的Ticket。KDC使用先用自己的Master Key解密Client的TGT获得SKDC-ClientQ通过SKDC-Client解密Authenticator验证发送者是否是TGT的真正拥有者,验证通过再用自己的Master Key解密Server的TGT获得KDC和Server 的Session KeyQSKDC-ServerQ,q用该Session Key加密Ticketq回lClient?/div>
  4. C/S ExchangeQClient携带者通过KDC和Server 的Session KeyQSKDC-ServerQ进行加密的Ticket和通过Client和Server的Session KeyQSServer-ClientQ的Authenticator讉KServerQServer通过SKDC-Server解密Ticket获得SServer-ClientQ通过SServer-Client解密Authenticator实现对Client的验证?/div>

q就是整个过E?/p>

七、Kerberos的优?/strong>

分析整个Kerberos的认证过E之后,我们来ȝ一下Kerberos都有哪些优点Q?/p>

1Q较高的Performance

虽然我们一再地说Kerberos是一个涉及到3方的认证q程QClient、Server、KDC。但是一旦Client获得用过讉K某个Server的TicketQ该ServerpҎq个Ticket实现对Client的验证,而无KDC的再ơ参与。和传统的基于Windows NT 4.0的每个完全依赖Trusted Third Party的NTLM比较Q具有较大的性能提升?/p>

2Q实C双向验证QMutual AuthenticationQ?/strong>

传统的NTLM认证Zq样一个前提:Client讉K的远E的Service是可信的、无需对于q行验证Q所以NTLM不曾提供双向验证的功能。这昄有点理想MQؓ此Kerberos弥补了这个不IClient在访问Server的资源之前,可以要求对Server的n份执行认证?/p>

3Q对Delegation的支?/strong>

Impersonation和Delegation是一个分布式环境中两个重要的功能。Impersonation允许Server在本C用Logon 的Account执行某些操作QDelegation需用Serverlogon的Account带入到另q一个Context执行相应的操作。NTLM仅对Impersonation提供支持Q而Kerberos通过一U双向的、可传递的QMutual 、TransitiveQ信L式实C对Delegation的支持?/p>

4Q互操作性(InteroperabilityQ?/strong>

Kerberos最初由MIT首创Q现在已l成Z行被q泛接受的标准。所以对于不同的q_可以q行q泛的互操作?br>



jinfeng_wang 2007-07-26 18:02 发表评论
]]>
ASP.NET应用E序的安全方?w䆾验证) zzhttp://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132603.htmljinfeng_wangjinfeng_wangThu, 26 Jul 2007 09:59:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132603.htmlhttp://m.tkk7.com/jinfeng_wang/comments/132603.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132603.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/132603.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/132603.htmlASP.NET应用E序的安全方?w䆾验证)

 

摘要Q本文ASP.NET应用E序w䆾验证的概念,介绍了各Un份验证模式ƈq行了比较,阐述了选择w䆾验证模式的机Ӟq给Z一U基于窗体n份验证模式的实现Ҏ?/p>

关键字:w䆾验证 authentication ASP.NET WEB应用

1.w䆾验证概念 M成功的应用程序安全策略的基础都是E_的n份验证和授权手段Q以及提供机密数据的保密性和完整性的安全通讯?br>w䆾验证QauthenticationQ是一个标识应用程序客L的过E,q里的客L可能包括l端用户、服务、进E或计算机,通过了n份验证的客户端被UCؓMQprincipalQ。n份验证可以跨应用程序的多个层发生。终端用戯v初由Web应用E序q行w䆾验证Q通常Ҏ用户名和密码q行Q随后终端用Lh׃间层应用E序服务器和数据库服务器q行处理Q这q程中也进行n份验证以侉K证ƈ处理q些h?br>?列出了各U安全技术以及每U技术所提供的主要验证方式?br>2. w䆾验证模式 如图1所C,Windows 2000上的.NET框架上提供了以下几种w䆾验证Q?br>ASP.NETw䆾验证模式 Enterprise Servicesw䆾验证 SQL Serverw䆾验证 2.1 ASP.NETw䆾验证模式 ASP.NETw䆾验证模式包括Windows、FormsQ窗体)、PassportQ护照)和NoneQ无Q?br>2.1.1 Windowsw䆾验证 使用q种w䆾验证模式ӞASP.NET依赖于IIS对用戯行验证,q创Z个Windows讉K令牌来表C已通过验证的标识。IIS提供以下几种w䆾验证机制Q?br>基本w䆾验证要n份验证集成Windowsw䆾验证证书w䆾验证匿名w䆾验证 2.1.2 护照w䆾验证 使用q种w䆾验证模式ӞASP.NET使用Microsoft Passport的集中式w䆾验证服务QASP.NET为Microsoft Passport软g开发包QSDKQ所提供的功能提供了一个方便的包装QWrapperQ。此SDK必须安装在WEB服务器上?br>2.1.3 H体w䆾验证 q种验证方式使用客户端重定向功能Q将未通过w䆾验证的用戯{发到特定的登录窗体,要求用户输入其凭据信息(通常是用户名和密码)。这些凭据信息被验证后,pȝ生成一个n份验证票证(ticketQƈ其q回客户端。n份验证票证可在用L会话期间l护用户的n份标识信息,以及用户所属的角色列表Q可选)?br>2.1.4 None 使用q种w䆾验证模式Q表CZ不希望对用户q行验证Q或是采用自定义的n份验证协议?br>2.2 Enterprise Servicesw䆾验证 Enterprise Servicesw䆾验证通过使用底层的远E过E调用(RPCQRemote Procedure CallQ传输结构来q行Q而这U结构又使用了操作系l安全服务提供程序接口(SSPIQSecurity Service Provider InterfaceQ。可以利用Kerberose或NTLMw䆾验证机制对Enterprise Services应用E序的客Lq行验证?br>2.3 SQL Serverw䆾验证 SQL Server可以通过Windowsw䆾验证机制QKerberose或NTLMQ,也可以通过其内|的w䆾验证Ҏ-SQLw䆾验证机制q行验证。通常有两U可用的验证Ҏ?br>2.3.1 SQL Server and Windows 客户端可用通过SQL Serverw䆾验证或Windowsw䆾验证机制来连接SQL Server的某个实例。这U方式有时也被称为؜合模式的w䆾验证?br>2.3.2 Windows Only 客户端必通过使用Windowsw䆾验证机制来连接到SQL Server的一个实例?br>3. 选择w䆾验证机制 设计分布式应用程序的w䆾验证是一具有挑战性的d。在应用E序开发的早期阶段Q进行适当的n份验证设计有助于降低许多安全风险?nbsp;3.1 各种w䆾验证机制的比?nbsp;用户是否需要在服务器域中拥有Windows帐户是否支持委托是否需要Windows 2000客户端和服务器凭据是否明文传输(需要SSLQ是否支持非IE览?nbsp;基本w䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;要n份验?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;NTLMw䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;Kerberosw䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;证书w䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;H体w䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;护照w䆾验证 ?nbsp;?nbsp;?nbsp;?nbsp;?nbsp;3.2 选择w䆾验证机制需要考虑的因?nbsp;标识 只有当应用程序的用户h的Windows帐户可以通过一个受信Q的权威机构(它可以被应用E序Web服务器访问)来进行验证时Q用Windowsw䆾验证机制才是合适的?br>凭据理 Windowsw䆾验证的一个关键优势在于它可以使用操作pȝq行凭据理。当使用非Windowsw䆾验证方式Q例如窗体n份验证时Q必Ml考虑在何处以及如何保存用户凭据。其中最常用的方式是使用SQL Server数据库或是用位于Active Directory中的User对象?br>标识动 是否需要实C个模?委托模型Qƈ原始调用者的安全上下文在操作pȝU进行跨层流?例如Q以便支持审核或针对每个用户的精l授权?br>览器类?nbsp;应用E序的所有用h否都拥有IE览器?或是你是否需要支持一个具有؜合型览器的用户? 我们选择w䆾验证旉要根据各U方式的特点Q综合考虑以上因素?br>

 
3.3 Intranetpȝ的选择决策程 参见??br>3.4 SQL Server用户验证 对SQL Server的客Lq行验证Q一般说来Windowsw䆾验证要比SQL Serverw䆾验证更安全,原因主要有以下几点: 前者负责管理用L凭据信息Q而且用户的凭据不会在|络上传输。可以避免在q接字符串中嵌入用户名和密码。可通过密码q期旉、最密码长度、以及多ơ无效登录后h的帐户锁定等措施改进d安全性。这样可以见词典攻ȝ威胁?nbsp;但是某些特定的应用程序方案中不允怋用Windowsw䆾验证Q例如: 数据库客L和数据库服务器由一个防火墙分隔开Q从而导致无法用Windowsw䆾验证。应用程序需要用多个标识连接到一个或多个数据库。连接到的数据库不是SQL Server。在ASP.NET中没有一U安全的方式以特定的Windows用户的n份运行代码?nbsp;在以上这些方案中Q将必须使用SQLw䆾验证Q或是数据库的本n份验证机制?nbsp;
4. ASP.NETw䆾验证实现 4.1 ҎҎ在q部分,仅提供了一UIntranet下交互式WEB应用E序的n份验证的实现Q本Ҏ假设h以下Ҏ: 只有通过了n份验证的客户端才能访问应用程序。数据库怿应用E序对用戯行了相应的n份验?卛_用程序代表用户对数据库进行调用?nbsp;WEB应用E序通过使用ASP.NETq程帐户q接到数据库。用L凭据信息是根据SQL Server数据库进行验证的。用窗体n份验证模式?nbsp;在WEB应用E序中,用户的凭据信息是ҎSQL Server数据库,采用H体w䆾验证模式Q便于实现用户个性化设计。采用应用程序代表用户对数据库进行调用的方式Q可采用受信dpȝ模型Q更好地利用数据库连接池Qƈ且可以保证用户不能直接访问后端数据库Q另外可以减后端的ACL理工作?br>4.2 安全配置步骤 4.2.1 IIS配置步骤 对Web服务的虚拟根目录启用匿名讉K?br>主要Ҏ是用IIS MMC理单元Q右d用程序的虚拟目录Q然后单d?--〉目录安全?-〉匿名访问和安全控制--〉编辑?br>4.2.2 ASP.NET配置步骤 1Q?nbsp;ASPNET帐户Q用于运行ASP.NETQ的密码重新讄Z个更安全的密码?br>q样允许在数据库服务器上复制一个本地帐Ph相同的用户名和密码)。ؓ了用Windowsw䆾验证q接到数据库Ӟ能够使ASPNET帐户Ҏ自数据库的网ln份验证要求进行响应,q是必须的?br>具体Ҏ是编辑位?windr%\Microsoft.NET\Framework\v1.1.4322\CONFIG目录下的 Machine.config文gQ将<processModel>元素上的密码属性重新配|,其默认?lt;!-UserName= "machine" password="AutoGenerate" -->改ؓ<!-UserName="machine" password="NewPassword" -->?br>2Q?nbsp;配置ASP.NETQ用窗体n份验证?br>~辑位于WEB服务的虚拟根目录下的Web.config文gQ将<authentication>元素讄为:
<authentication mode="Forms" >
<forms name="MyAppFormAuth" loginUrl="login.aspx" protection="All" timeout="20" path="/">
</forms>
</authentication>
4.2.3 配置SQL Server 1Q?nbsp;在SQL Server数据库上创徏一个和ASP.NETq程帐户匚w的Windows帐户?br>用户名和密码必须和ASP.NET应用E序帐号匚w?br>2Q?nbsp;配置SQL ServerQ其用Windowsw䆾验证?br>3Q?nbsp;定义的ASP.NET应用E序帐户创徏一个SQL ServerdQ授予对SQL Server的访问权?br>4Q?nbsp;创徏一个新的数据库用户Qƈ登录名映射为数据库用户?br>5Q?nbsp;创徏一个用户定义的新数据库角色Qƈ数据库用户d到该角色?br>6Q?nbsp;为数据库角色定数据库权限?nbsp;
4.3 E序代码 4.3.1 w䆾验证事g序列 当未通过w䆾验证的用戯图放一个受保护的文件或资源被拒l时Q触发的事g序列如图3所C?br>4.3.2 代码实现步骤 1Q?nbsp;Z个WEBdH体q证用h供的凭据信息
ҎSQL Server数据库来验证凭据信息?br>2Q?nbsp;从数据库里获取角色列?br>3Q?nbsp;创徏H体w䆾验证证
在票证中保存所获取的角色信息。示例代码如下:
private void btnLogin_Click(object sender, System.EventArgs e)
{
//ҎSQL Server数据库进行验证(具体实现略)?br>bool isAuthenticated = IsAuthenticated( txtUserName.Text, txtPassword.Text );
if (isAuthenticated == true )
{
//获取用户的角?br>string roles = GetRoles( txtUserName.Text, txtPassword.Text );    // 创徏w䆾验证证
FormsAuthenticationTicket authTicket = new 
FormsAuthenticationTicket(1, // version
txtUserName.Text, // user name
DateTime.Now, // creation
DateTime.Now.AddMinutes(60),// Expiration
false, // Persistent
roles ); // User data
 string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
// 创徏Cookie
HttpCookie authCookie = 
new HttpCookie(FormsAuthentication.FormsCookieName,
encryptedTicket);
 Response.Cookies.Add(authCookie); 
 // 用户重定向到最初请求页面?br>Response.Redirect( FormsAuthentication.GetRedirectUrl(
txtUserName.Text, 
false ));
}
}
 4Q?nbsp;创徏IPrincipal对象 可在Application_AuthenticateRequest事g中创Z个IPrincipal对象Q一般用GenericPrincipalcR?br>5Q?nbsp;IPrincipal对象|于当前的HTTP上下?nbsp;
 protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
// 提去H体w䆾验证cookie
string cookieName = FormsAuthentication.FormsCookieName;
HttpCookie authCookie = Context.Request.Cookies[cookieName];
 if(null == authCookie)
{
return;

 FormsAuthenticationTicket authTicket = null;
try
{
authTicket = FormsAuthentication.Decrypt(authCookie.Value);
}
catch(Exception ex)
{
return;
}
 if (null == authTicket)
{
return; 

 //提取角色
string[] roles = authTicket.UserData.Split(new char[]{'|'});
 // 创徏Identity object
FormsIdentity id = new FormsIdentity( authTicket ); 
 GenericPrincipal principal = new GenericPrincipal(id, roles);
Context.User = principal;
}
 具体的代码读者可以自行补充完成?br>5. 后记与授权与安全通讯有关的内容将另外?nbsp;Q-Q-Q-Q-Q-Q-Q-Q-Q-Q-Q- 服务器安全讨论区 http://www.safe263.cn 
 


jinfeng_wang 2007-07-26 17:59 发表评论
]]>
WindowsXP pȝ登陆原理及其验证机制概述 zzhttp://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132600.htmljinfeng_wangjinfeng_wangThu, 26 Jul 2007 09:58:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132600.htmlhttp://m.tkk7.com/jinfeng_wang/comments/132600.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132600.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/132600.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/132600.htmlq_我们在用WindowsXPӞL要先q行d。WindowsXP的登录验证机制和原理都要比Windows98严格q复杂得多,不会再出现按“取消”按钮pq入pȝ的丑事(可以通过修改注册表来止Q。理解ƈ掌握WindowsXP的登录验证机制和原理Ҏ们来说很重要Q能增强对系l安全的认识Qƈ能够有效预防、解决黑客和病毒的入c?br>一、了解WindowsXP的几U登录类型?br>1、交互式d
   交互式登录是我们q_最常见cdQ就是用户通过相应的用户帐?User Account)和密码在本机q行d。有些网友认?#8220;交互式登?#8221;是“本地d”Q其实这是错误的?#8220;交互式登?#8221;q包?#8220;域帐L?#8221;Q?#8220;本地d”仅限?#8220;本地帐号d”Q详l讲解请参看下文?br>  q里有必要提及的是,通过l端服务和远E桌面登录主机,可以看作“交互式登?#8221;Q其验证的原理是一L?br>  在交互式dӞpȝ会首先检验登录的用户帐号cdQ是本地用户帐号(Local User Account)Q还是域用户帐号(Domain User Account)Q再采用相应的验证机制。因Z用的用户帐号cdQ其处理Ҏ也不同?br> ?本地用户帐号
  采用本地用户帐号dQ系l会通过存储在本机SAM数据库中的信息进行验证。所以也׃ؓ什么Windows2000忘记Administrator密码时可以删除SAM文g的方法来解决。不q对于WindowsXP则不可以Q可能是Z安全斚w考虑吧。用本地用户帐号d后,只能讉K到具有访问权限的本地资源。(?Q?br>
 ◇域用户帐号
  采用域用户帐L录,pȝ则通过存储在域控制器的zd目录中的数据q行验证。如果该用户帐号有效Q则d后可以访问到整个域中h讉K权限的资源?br>提C:如果计算机加入域以后Q登录对话框׃昄“d刎ͼ”目Q可以从中选择d到域q是d到本机?br>2、网l登?br>  如果计算机加入到工作l或域,当要讉K其他计算机的资源Ӟ需?#8220;|络d”了。如?Q当要登录名UCؓHeelen的主机时Q输入该L的用户名U和密码后进行验证。这里需要提醒的是,输入的用户帐号必LҎL上的Q而非自己L上的用户帐号。因行网l登录时Q用户帐L有效性是由受访主行的?br>
3、服务登?br>  服务d是一U特D的d方式。^Ӟpȝ启动服务和程序时Q都是先以某些用户帐可行登录后q行的,q些用户帐号可以是域用户帐号、本地用户帐hSYSTEM帐号。采用不同的用户帐号dQ其对系l的讉K、控制权限也不同Q而且Q用本地用户帐号dQ只能访问到h讉K权限的本地资源,不能讉K到其他计机上的资源Q这点和“交互式登?#8221;cM?br>  从图3的Q务管理器中可以看刎ͼpȝ的进E所使用的帐h不同的。当pȝ启动Ӟ一些基与Win32的服务会被预先登录到pȝ上,从而实现对pȝ的访问和控制。运行services.mscQ可以设|这些服务。正是系l服务有着举轻重的地位,它们一般都以SYSTEM帐号d的,对系l有l对的控制权限,所以很多病毒和木马也争着加入q个贉|中。除了SYSTEMQ有些服务还以Local Service和Network Serviceq两个帐L录。而在pȝ初始化后Q用戯行的一切程序都是以用户本n帐号d的?br>
  从上面讲到的原理不难看出Qؓ什么很多电脑文章告诉一般用Pqx使用计算机时要以Usersl的用户dQ因为即使运行了病毒、木马程序,׃受到d用户帐号相应的权限限Ӟ最多也只能破坏属于用户本n的资源,而对l护pȝ安全和稳定性的重要信息无破坏性?
4、批处理d
  批处理登录一般用户很用刎ͼ通常被执行批处理操作的程序所使用。在执行批处理登录时Q所用帐可h批处理工作的权利Q否则不能进行登录?br>
  q_我们接触最多的?#8220;交互式登?#8221;Q所以下面笔者讲为大家详l讲?#8220;交互式登?#8221;的原理?br>
二、交互式dQ系l用了哪些组?br>1、winlogon.exe
  winlogon.exe?#8220;交互式登?#8221;时最重要的组Ӟ它是一个安全进E,负责如下工作Q?br> ◇加载其他登录组件?br> ◇提供同安全相关的用h作图形界面,以便用户能进行登录或注销{相x作?br> ◇根据需要,同GINA发送必要信息?br>2、GINA
  GINA的全UCؓ“Graphical Identification and Authentication”??囑Ş化识别和验证。它是几个动态数据库文gQ被winlogon.exe所调用Qؓ其提供能够对用户w䆾q行识别和验证的函数Qƈ用L帐号和密码反馈给winlogon.exe。在dq程中,“Ƣ迎屏幕”?#8220;d对话?#8221;是GINA昄的?br>  一些主题设|YӞ例如styleXPQ可以指定winlogon.exe加蝲商家自己开发的GINAQ从而提供不同的WindowsXP的登录界面。由于这个可修改性,现在出现了盗取帐号和密码的木马?br>  一U是针对“Ƣ迎屏幕”d方式的木马,它模拟了WindowsXP的欢q界面。当用户输入密码后,p木马E序所获取Q而用户却全然不知。所以徏议大家不要以Ƣ迎屏幕来登录,且要讄“安全d”?br>  另一U是针对d对话框的GINA木马Q其原理是在d时加载,以盗取用L帐号和密码,然后把这些信息保存到%systemroot%system32下的WinEggDrop.dat中。该木马会屏蔽系l以“Ƣ迎屏幕”方式d?#8220;用户切换”功能Q也会屏?#8220;Ctrl-Alt-Delete”的安全登录提C?br>  用户也不用太担心被安装了GINA木马Q笔者在q里提供解决Ҏl大家参考:
 ◇正所?#8220;解铃q需p铃?#8221;Q要查看自己电脑是否安装qGINA木马Q可以下载一个GINA木马E序Q然后运行InstGina -viewQ可以查看系l中GinaDLL那键值是否有被安装过DLLQ主要用来查看系l是否被人安装了Gina木马作ؓd所用。如果不q被安装了GINA木马Q可以运行InstGina -Remove来卸载它?br>3、LSA服务
  LSA的全UCؓ“Local Security Authority”??本地安全授权QWindowspȝ中一个相当重要的服务Q所有安全认证相关的处理都要通过q个服务。它从winlogon.exe中获取用L帐号和密码,然后l过密钥机制处理Qƈ和存储在帐号数据库中的密钥进行对比,如果Ҏ的结果匹配,LSAp为用Lw䆾有效Q允许用L录计机。如果对比的l果不匹配,LSAp为用Lw䆾无效。这时用户就无法d计算机?br>  怎么看这三个字母有些眼熟Q对了,q个是和前阵子闹得沸沸扬扬?#8220;震荡?#8221;撤上关系的?#8220;震荡?#8221;蠕虫是利用LSAq程~冲区溢出漏z而获得系l最高权限SYSTEM来攻ȝ脑的。解决的Ҏ|上很多资料Q这里就不多讲了?br>4、SAM数据?br>  SAM的全UCؓ“Security Account Manager”??安全帐号理器,是一个被保护的子pȝQ它通过存储在计机注册表中的安全帐h理和用户和用户l的信息。我们可以把SAM看成一个帐h据库。对于没有加入到域的计算机来_它存储在本地Q而对于加入到域的计算机,它存储在域控制器上?br>  如果用户试图d本机Q那么系l会使用存储在本Z的SAM数据库中的帐号信息同用户提供的信息进行比较;如果用户试图d到域Q那么系l会使用存储在域控制器中上的SAM数据库中的帐号信息同用户提供的信息进行比较?br>5、Net Logon服务
  Net Logon服务主要和NTLMQNT LAN ManagerQWindows NT 4.0 的默认验证协议)协同使用Q用户验证Windows NT域控制器上的SAM数据库上的信息同用户提供的信息是否匹配。NTLM协议主要用于实现同Windows NT的兼Ҏ而保留的?br>6、KDC服务
  KDCQKerberos Key Distribution Center??Kerberos密钥发布中心Q服务主要同Kerberos认证协议协同使用Q用于在整个zd目录范围内对用户的登录进行验证。如果你保整个域中没有Windows NT计算机,可以只用Kerberos协议Q以保最大的安全性。该服务要在Active Directory服务启动后才能启用?br>7、Active Directory服务
  如果计算机加入到Windows2000或Windows2003域中Q则需启动该服务以对Active DirectoryQ活动目录)功能的支持?br>
三、登录前后,winlogon到底q了什?br>  如果用户讄?#8220;安全d”Q在winlogon初始化时Q会在系l中注册一个SAS (Secure Attention Sequence??安全警告序列Q。SAS是一l组合键Q默认情况下为Ctrl-Alt-Delete。它的作用是保用户交互式登录时输入的信息被pȝ所接受Q而不会被其他E序所获取。所以说Q?#8220;安全d”q行dQ可以确保用L帐号和密码不会被黑客盗取。要启用“安全d”的功能,可以q行“control userpasswords2”命oQ打开“用户帐户”对话框,选择“高”。(如图4Q选中“要求用户按Ctrl-Alt-Delete”选项后确定即可。以后,在每ơ登录对话框出现前都有一个提C,要求用户按Ctrl-Alt-Deletel合键,目的是ؓ了在d时出现WindowsXP的GINAd对话框,因ؓ只有pȝ本n的GINA才能截获q个l合键信息。而如前面讲到的GINA木马Q会屏蔽?#8220;安全d”的提C,所以如?#8220;安全d”的提C无故被屏蔽也是发现木马的一个前兆?#8220;安全d”功能早在Windows2000时就被应用于保护pȝ安全性?br>
  在winlogon注册了SAS后,p用GINA生成3个桌面系l,在用户需要的时候用,它们分别为:
 ◇Winlogon桌面 用户在进入登录界面时Q就q入了Winlogon桌面。而我们看到的d对话框,只是GINA负责昄的。如果用户取消以“Ƣ迎屏幕”方式dQ在q入WindowsXP中Q何时候按?#8220;Ctrl-Alt-Delete”Q都会激zWinlogon桌面Qƈ昄??#8220;Windows安全”对话框。(注意QWinlogon桌面q不{同对话框,对话框只是Winlogon调用其他E序来显C的Q?br>
 ◇用h?用户桌面是我们日常操作的桌面,它是pȝ最主要的桌面系l。用户需要提供正的帐号和密码,成功d后才能显C?#8220;用户桌面”。而且Q不同的用户Qwinlogon会根据注册表中的信息和用户配|文件来初始化用h面?br> ◇屏q保护桌?屏幕保护桌面是屏幕保护Q包?#8220;pȝ屏幕保护”?#8220;用户屏幕保护”。在启用?#8220;pȝ屏幕保护”的前提下Q用hq行dq且长时间无操作Q系l就会进?#8220;pȝ屏幕保护”Q而对?#8220;用户屏幕保护”来说Q用戯d后才能访问,不同的用户可以设|不同的“用户屏幕保护”?br>
四、想dQ也要过GINAq一?br>  ?#8220;交互式登?#8221;q程中,Winlogon调用了GINAl文Ӟ把用h供的帐号和密码传辄GINAQ由GINA负责对帐号和密码的有效性进行验证,然后把验证结果反馈给WinlogonE序。在与Winlogon.exe对话ӞGINA会首先确定winlogon.exe的当前状态,再根据不同状态来执行不同的验证工作。通常Winlogon.exe有三中状态:
 1、已d状?br>֐思义Q用户在成功d后,p入了“已登录状?#8221;。在此状态下Q用户可以执行有控制权限的Q何操作?br> 2、已注销状?br>用户在已d状态下Q选择“注销”命o后,p入了“已注销状?#8221;Qƈ昄Winlogon桌面Q而由GINA负责昄d对话框或Ƣ迎屏幕?br> 3、已锁定状?br>当用h?#8220;Win+L”键锁定计机后,p入了“已锁定状?#8221;。在此状态下QGINA负责昄可供用户d的对话框。此时用h两种选择Q一U是输入当前用户的密码返?#8220;已登录状?#8221;Q另一U是输入理员帐号和密码Q返?#8220;已注销状?#8221;Q但原用L态和未保存数据丢失?br>
五、登录到本机的过E?br>1、用户首先按Ctrl+Alt+Dell合键?
2、winlogon到用户按下SAS键,p用GINAQ由GINA昄d对话框,以便用户输入帐号和密码?br>3、用戯入帐号和密码Q确定后QGINA把信息发送给LSAq行验证?br>4、在用户d到本机的情况下,LSA会调用msv1_0.dllq个验证E序包,用户信息处理后生成密钥Q同SAM数据库中存储的密钥进行对比?br>5、如果对比后发现用户有效QSAM会将用户的SIDQSecurity Identifier??安全标识Q,用户所属用L的SIDQ和其他一些相关信息发送给LSA?br>6、LSA收到的SID信息创徏安全讉K令牌Q然后将令牌的句柄和d信息发送给winlogon.exe?br>7、winlogon.exe对用L录稍作处理后Q完成了整个dq程?br>
六、登录到域的q程
 d到域的验证过E,对于不同的验证协议也有不同的验证Ҏ。如果域控制器是Windows NT 4.0Q那么用的是NTLM验证协议Q其验证q程和前面的“d到本机的q程”差不多,区别在于验证帐L工作不是在本地SAM数据库中q行Q而是在域控制器中q行Q而对于Windows2000和Windows2003域控制器来说Q用的一般ؓ更安全可靠的Kerberos v5协议。通过q种协议d到域Q要向域控制器证明自q域帐h效,用户需先申请允许请求该域的TGSQTicket-Granting Service??据授予
服务Q。获准之后,用户׃为所要登录的计算机申请一个会话票据,最后还需甌允许q入那台计算机的本地pȝ服务?br>
其过E如下:
1、用户首先按Ctrl+Alt+Dell合键?br>2、winlogon到用户按下SAS键,p用GINAQ由GINA昄d对话框,以便用户输入帐号和密码?br>3、用户选择所要登录的域和填写帐号与密码,定后,GINA用戯入的信息发送给LSAq行验证?br>4、在用户d到本机的情况下,LSA请求发送给Kerberos验证E序包。通过散列法Q根据用户信息生成一个密钥,q将密钥存储在证书缓存区中?br>5、Kerberos验证E序向KDCQKey Distribution Center??密钥分配中心Q发送一个包含用戯n份信息和验证预处理数据的验证服务hQ其中包含用戯书和散列法加密旉的标记?br>6、KDC接收到数据后Q利用自q密钥对请求中的时间标记进行解密,通过解密的时间标记是否正,可以判断用h否有效?br>7、如果用h效,KDC向用户发送一个TGTQTicket-Granting Ticket??据授予据Q。该TGTQAS_REPQ将用户的密钥进行解密,其中包含会话密钥、该会话密钥指向的用户名U、该据的最大生命期以及其他一些可能需要的数据和设|等。用h甌的票据在KDC的密钥中被加密,q着在AS_REP中。在TGT的授权数据部分包含用户帐LSID以及该用h属的全局l和通用l的SID。注意,q回到LSA的SID包含用户的访问o牌。票据的最大生命期是由域策略决定的。如果票据在zd的会话中过期限Q用户就必须甌新的据?br>8、当用户试图讉K资源Ӟ客户pȝ使用TGT从域控制器上的Kerberos TGSh服务据QTGS_REQ)。然后TGS服务票据(TGS_REPQ发送给客户。该服务据是用服务器的密钥进行加密的。同ӞSID被Kerberos服务从TGT复制到所有的Kerberos服务包含的子序列服务据中?br>9、客户将据直接提交到需要访问的|络服务上,通过服务据p证明用户的标识和针对该服务的权限Q以及服务对应用L标识?br>
七、我要偷??讄自动d
 Z安全赯Q^时我们进入WindowsXPӞ都要输入帐号和密码。而一般我们都是用一个固定的帐号d的。面Ҏơ烦琐的输入密码Q有的朋友干脆设|ؓI密码或者类?#8220;123”{弱口oQ而这些帐号也多数为管理员帐号。殊不知黑客用一般的扫描工具Q很Ҏp扫描CDIPD中所有弱口o的计机?br> 所以,q是大家要把密码量讄得复杂些。如果怕麻烦,可以讄自动dQ不q自动登录也是很不安全的。因动登录意味着能直接接触计机的h都能q入pȝQ另一斚wQ帐号和密码是明文保存在注册表中的,所以Q何hQ只要具有访问注册表的权限,都可以通过|络查看。因此如果要讄dQ最好不要设|ؓ理员帐P可以讄为USERSl的用户帐号。设|自动登录的Ҏ是:q行“control userpasswords2”Q(如图6Q?br>
?#8220;用户帐户”H口中取?#8220;要用本机,用户必须输入用户名和密码”选项Q确定后会出C个对话框Q输入要自动d的帐号和密码卛_。注意,q里不对密码q行验证Q用戯保密码和帐L正确性?br>



jinfeng_wang 2007-07-26 17:58 发表评论
]]>
windowsdq程 winlogon/gina/Kerberos/kdc (zz)http://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132599.htmljinfeng_wangjinfeng_wangThu, 26 Jul 2007 09:56:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132599.htmlhttp://m.tkk7.com/jinfeng_wang/comments/132599.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2007/07/26/132599.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/132599.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/132599.htmlhttp://topic.csdn.net/t/20060301/15/4585911.html#


先说说登录过E吧,首先声明,winlogon.exe可不是随意可更换?我们更换的是GINA,而非winlogon.exe,如果处理不当,可能WINDOWSpv不来?  
   
  ?#8220;交互式登?#8221;q程中,Winlogon调用了GINAl文Ӟ把用h供的账号和密码传辄GINAQ由GINA负责对̎号和密码的有效性进行验证,然后把验证结果反馈给WinlogonE序。在与Winlogon.exe对话ӞGINA会首先确定Winlogon.exe的当前状态,再根据不同状态来执行不同的验证工作。通常Winlogon.exe有三U状态:  
   
    1Q已d状? 
   
    ֐思义Q用户在成功d后,p入了“已登录状?#8221;。在此状态下Q用户可以执行有控制权限的Q何操作? 
   
    2Q已注销状? 
   
    用户在已d状态下Q选择“注销”命o后,p入了“已注销状?#8221;Qƈ昄Winlogon桌面Q而由GINA负责昄d对话框或Ƣ迎屏幕? 
   
    3Q已锁定状? 
   
    当用h?#8220;Win+L”键锁定计机后,p入了“已锁定状?#8221;。在此状态下QGINA负责昄可供用户d的对话框。此时用h两种选择Q一U是输入当前用户的密码返?#8220;已登录状?#8221;Q另一U是输入理员̎号和密码Q返?#8220;已注销状?#8221;Q但原用L态和未保存数据丢失? 
   
    ////d到本机的q程  
   
    1.用户首先按Ctrl+Alt+Dell合键?   
   
    2.Winlogon到用户按下SAS键,p用GINAQ由GINA昄d对话框,以便用户输入账号和密码? 
   
    3.用户输入账号和密码,定后,GINA把信息发送给LSAq行验证? 
   
    4.在用L录到本机的情况下QLSA会调用Msv1_0.dllq个验证E序包,用户信息处理后生成密钥Q同SAM数据库中存储的密钥进行对比? 
   
    5.如果Ҏ后发现用h效,SAM会将用户的SID(Security   Identifier--安全标识)Q用h属用L的SIDQ和其他一些相关信息发送给LSA? 
   
    6.LSA收到的SID信息创徏安全讉K令牌Q然后将令牌的句柄和d信息发送给Winlogon.exe? 
   
    7.Winlogon.exe对用L录稍作处理后Q完成整个登录过E? 
   
    ////d到域的过E? 
   
    d到域的验证过E,对于不同的验证协议也有不同的验证Ҏ。如果域控制器是Windows   NT   4.0Q那么用的是NTLM验证协议Q其验证q程和前面的“d到本机的q程”差不多,区别在于验证̎L工作不是在本地SAM数据库中q行Q而是在域控制器中q行Q而对于Windows   2000和Windows   2003域控制器来说Q用的一般ؓ更安全可靠的Kerberos   V5协议。通过q种协议d到域Q要向域控制器证明自q域̎h效,用户需先申请允许请求该域的TGS(Ticket-Granting   Service--据授予服务)。获准之后,用户׃为所要登录的计算机申请一个会话票据,最后还需甌允许q入那台计算机的本地pȝ服务? 
   
    其过E如下:  
   
    1.用户首先按Ctrl+Alt+Dell合键? 
   
    2.Winlogon到用户按下SAS键,p用GINAQ由GINA昄d对话框,以便用户输入账号和密码? 
   
    3.用户选择所要登录的域和填写账号与密码,定后,GINA用戯入的信息发送给LSAq行验证? 
   
    4.在用L录到本机的情况下QLSA请求发送给Kerberos验证E序包。通过散列法Q根据用户信息生成一个密钥,q将密钥存储在证书缓存区中? 
   
    5.Kerberos验证E序向KDC(Key   Distribution   Center--密钥分配中心)发送一个包含用戯n份信息和验证预处理数据的验证服务hQ其中包含用戯书和散列法加密旉的标记?   
   
    6.KDC接收到数据后Q利用自q密钥对请求中的时间标记进行解密,通过解密的时间标记是否正,可以判断用h否有效?   
    7.如果用户有效QKDC向用户发送一个TGT(Ticket-Granting   Ticket--据授予据)。该TGT(AS_REP)用L密钥q行解密Q其中包含会话密钥、该会话密钥指向的用户名U、该据的最大生命期以及其他一些可能需要的数据和设|等。用h甌的票据在KDC的密钥中被加密,q着在AS_REP中。在TGT的授权数据部分包含用戯̎LSID以及该用h属的全局l和通用l的SID。注意,q回到LSA的SID包含用户的访问o牌。票据的最大生命期是由域策略决定的。如果票据在zd的会话中过期限Q用户就必须甌新的据? 
   
    8.当用戯图访问资源时Q客Ll用TGT从域控制器上的Kerberos   TGSh服务据(TGS_REQ)。然后TGS服务票?TGS_REP)发送给客户。该服务据是用服务器的密钥进行加密的。同ӞSID被Kerberos服务从TGT复制到所有的Kerberos服务包含的子序列服务据中?      
   
    9.客户票据直接提交到需要访问的|络服务上,通过服务据p证明用户的标识和针对该服务的权限Q以及服务对应用L标识?nbsp;  
 

jinfeng_wang 2007-07-26 17:56 发表评论
]]>
创业10大病症及疗法http://m.tkk7.com/jinfeng_wang/archive/2007/07/10/129393.htmljinfeng_wangjinfeng_wangTue, 10 Jul 2007 09:13:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2007/07/10/129393.htmlhttp://m.tkk7.com/jinfeng_wang/comments/129393.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2007/07/10/129393.html#Feedback1http://m.tkk7.com/jinfeng_wang/comments/commentRss/129393.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/129393.html    病征Q现时生z较E_Q?
  觉得没意思和没新鲜感Q有一U创业的冲动Q但又怕万一p|反而比现在q糟p?
  
    疗法Q想清楚自己最愿意q甚么生zR如q求E_Q想办法q得有滋有味p了,不必自讨苦吃d业;如是惛_业,p有一M回头的打,无论怎么样都要熬下去?
  
    ?病名Q茫然症
  
    病征Q甚么都惛_Q甚么都可以做,甚么都有困难Q无从下手?
  
    疗法Q想清楚自己最喜欢和最擅长Q两者皆有最好,有其一也行Q没有就先培M下)甚么Q沿q个方向Md是了Q不要跟风,不要看别人,360行,行行能赚钱,关键是自己怎么去赚?
  
    ?病名Q多疑症
  
    病征Q害怕合作伙伴损完q利益Q处处防范,搞到不欢而散?
  
    疗法Q初期ؓ求安心,合作伙伴应在自己熟悉的朋友、同学、同事、亲戚中LQ但以后只能靠制度和契约保证各方的责权利Q因Zh会变Q感情也会变Q变有不一致的时候,有制度和契约可以^静地处理或退出,不会造成兄弟反目、朋友变仇h的情c因此,合伙协议或公司章E的条文一定要考虑清楚Q不要公文化了事?
  
    ?病名Q老大?
  
    病征Q合作各斚w认ؓ自己很强Q互怸服气Q都惛_董事长或ȝ理,当不成就处处昄自己在企业中的媄响,辑ֈ“不是老大的老大”境界最好,成ؓ“了我老大q不{?#8221;的h也不错?
  
    疗法Q徏?#8220;最没本事的人做老大”的共识,老大只负责决{和协调Q需要真本事的地方由有本事的人完成,如果你自认还有一Ҏ事就别争当老大了?
  
    ?病名Q虚荣症
  
    病征Q开张依始,p坐大班台Q装修办公室Q请姐接电?#8230;….
  
    疗法Q先多想x么赚得更多Q而不是把p掉?
  
    ?病名Q急躁?
  
    病征Q恨不得一天赚100万或更多Q一万年太久Q只争朝?
  
    疗法Q制定半q甚至一q没p如何坚持下去的计?
  
    ?病名Q狂妄症
  
    病征Q老子天下W一Q一出手惊天动地大手笔?
  
    疗法Q将狂妄加速进行,再从p|中得到教训?
  
    ?病名Q消化不良症
  
    病征Q每一生意前景都很好Q但现在没有一样作好的
  
    疗法Q壮士断臂,集中一ҎH破?
  
    ?病名Q忧郁症
  
    病征Q忧心忡忡,茉不思,不知明天会如何?
  
    疗法Q与其忧心明天,不如研究明天Q一点一滴完善今天,船到桥头自然直?
  
    ?病名Q政ȝ
  
    病征Q思考问题和看问题从政治家角度出发,a行如政府官员或党zN袖,牟其中是杰出代表Q动不动到了造福全hcȝ层次?
  
    疗法Q经帔R问自p了多,是如何赚的,能不能赚得更多更长远Q在商言商,以利益ؓ中心Q学会做企业?


jinfeng_wang 2007-07-10 17:13 发表评论
]]>
IE javascript被禁止,Dbughttp://m.tkk7.com/jinfeng_wang/archive/2007/03/29/107149.htmljinfeng_wangjinfeng_wangThu, 29 Mar 2007 02:59:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2007/03/29/107149.htmlhttp://m.tkk7.com/jinfeng_wang/comments/107149.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2007/03/29/107149.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/107149.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/107149.html http://b.zhongsou.com/bbs/newbbs/manage_ip-out.asp

|页中用javascriptq行跌{Q?br />但是止javascript后,
E序l箋执行?br />




jinfeng_wang 2007-03-29 10:59 发表评论
]]>
HOW-TO: Adobe Photoshop CS2 on Ubuntu - 8 steps! (zz)http://m.tkk7.com/jinfeng_wang/archive/2007/03/27/106802.htmljinfeng_wangjinfeng_wangTue, 27 Mar 2007 15:40:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2007/03/27/106802.htmlhttp://m.tkk7.com/jinfeng_wang/comments/106802.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2007/03/27/106802.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/106802.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/106802.html- What you need?

  • A fresh install of Ubuntu Dapper + all the updates
  • A Windows box with a fully installed and activated version of Adobe Photoshop CS2

- Fire up a terminal session and type the next commands;

TIP: Instead of using apt-get, you can install them with the Synaptic Package Manager located in the System/Administration menu

  • $ sudo apt-get update
  • $ sudo apt-get install wine and then type “yes?
  • $ sudo wine /*To create the wine file structure*/
  • $ sudo apt-get install recode and then type “yes?

- Then you need to copy all the necessary files from the Windows box;

  • Copy the whole Adobe folder from “c:\Program Files\?to ?strong>/home/YOURNAME/.wine/drive_c/Program Files/?/strong>

- Now you need to export the registry keys of the Adone Photoshop CS2;

  • In your Windows box, type “regedit?/strong> in the command-line and export the whole “HKEY_LOCAL_MACHINE/Software/Adobe/?/strong> to “adobe.reg?/strong>.
  • The next step is to copy that file to your Ubuntu box and convert it to the encoding of YOUR system. For example, if your Ubuntu box has as default charset ascii and your Windows box has ucs-2 then ? recode ucs-2..ascii adobe.reg?/strong> would do the trick. After you converted your adobe.reg file, type ? sudo wine regedit adobe.reg?to import it to wine.
  • That’s it! Type ? sudo wine –winver winxp “[path to Photoshop]/photoshop.exe?or create a launcher and enjoy Adobe Photoshop CS2 on Ubuntu ;)

If you are having a problem regarding ?em>unregistered?versions, you will need to crack your photoshop.exe file.



jinfeng_wang 2007-03-27 23:40 发表评论
]]>
在线译|站大全http://m.tkk7.com/jinfeng_wang/archive/2007/03/16/104168.htmljinfeng_wangjinfeng_wangFri, 16 Mar 2007 02:24:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2007/03/16/104168.htmlhttp://m.tkk7.com/jinfeng_wang/comments/104168.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2007/03/16/104168.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/104168.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/104168.html

p译|站:
http://www.readworld.com

中日׃?q能上蝲译
http://165net.com

http://www.worldlingo.com/

http://www.netat.net/

http://www.translate.ru/eng/

日语译|站
1.goo 辞書:收录4部三省堂字典
http://dictionary.goo.ne.jp/index.htmlc

2.インフォ゗?:支持在线译文本和网?br />http://www.infoseek.co.jp/Honyaku/

3.@nifty訳:英和辞典Q和p?国語辞典 デジѝ用語辞典
http://www.nifty.com/dictionary/?top4

4.万物大辞?所有日常用专业辞典
http://www.prcity.co.jp/oichan/dic/index.html

5.在线字典集合|页
http://www.kyotsu.com/level2/culture/dictionary.htm

6.Bit.ex日中 中日辞書
http://www.bitex-cn.com

7.Kiki's Kanji Dictionary:日汉字发韛_?br />http://www.kanjidict.com/

8.????乐器斚w的辞?br />http://www.cablenet.ne.jp/~atari/music09.htm

9.ライフサイエミ낹辞書:提供一些日文输入法的下载及电子辞典部分内容下蝲
http://lsd.pharm.kyoto-u.ac.jp/FTP3-dos-J.html
http://lsd.pharm.kyoto-u.ac.jp/Others-J.html

10.日语学习资源发布:日语相关的资料脓?暴多|站)
http://bbs.online.sh.cn/elitearticle.php?elite_id=231124

11.excite訳:支持在线译文本
http://www.excite.co.jp/world/text_cn/

12.三省堂在U字?br />http://www.sanseido.net/

13.カタカナ?外来语辞?br />http://homepage2.nifty.com/YONE/

14.パソゟ냳辞典:电脑专业用语辞典
http://www.qiuyue.com/index.html

15.デジѝ用語辞典:基礎的なパソゟ냳用語から難しい専門用語まで、コミ냔ューѝ関連する用語をq広く収錌Ӂたイミ낿ヹ{ット上の用語辞典です
http://yougo.ascii24.com/

16.奟끮子の名前辞書
http://www.dd.iij4u.or.jp/~ume20/f_name/

17.アニメと人Ş劇のキャラクѝのスペル辞典
http://web.kyoto-inet.or.jp/peop ... sons/animechara.htm

18.日语文章汉字假名自动全篇标注
http://www.yaru.com/

19.房英似辞典 外来语研I辞?br />http://www.awa.or.jp/home/hiroomi/b-jdic/b-jindex.htm



jinfeng_wang 2007-03-16 10:24 发表评论
]]>
Visual SourceSafe 教程QzzQ?/title><link>http://m.tkk7.com/jinfeng_wang/archive/2007/02/05/97939.html</link><dc:creator>jinfeng_wang</dc:creator><author>jinfeng_wang</author><pubDate>Mon, 05 Feb 2007 02:57:00 GMT</pubDate><guid>http://m.tkk7.com/jinfeng_wang/archive/2007/02/05/97939.html</guid><wfw:comment>http://m.tkk7.com/jinfeng_wang/comments/97939.html</wfw:comment><comments>http://m.tkk7.com/jinfeng_wang/archive/2007/02/05/97939.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jinfeng_wang/comments/commentRss/97939.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jinfeng_wang/services/trackbacks/97939.html</trackback:ping><description><![CDATA[ 作ؓ版本控制的管理工P虽然微Y的Visual SourceSafe有许多不如人意的地方,q也是很多h所抱怨的。但是我认ؓQ更多时候的使用不便Q是因ؓ对工L不熟悉而导致的。这个教E是W者在几个月前考察版本控制时根据VSS的联机帮助文档改~而成的。与其说是教E,C如说是一本简明手册,因ؓ其内Ҏ盖了VSS的全部功能,q从中提取了自认为重要的和有价值的东西Q将之翻译成中文。其中不乏有好的和用技巧,比如Q定期备份完整的VSS数据目录Q定期清除时目录的内容Q尽量用一个数据库存放所有文Ӟ使用虚拟回滚QVirtual RollBackQ代替普通回滚,排他性签出的使用QCloak操作{等Q不一而? <p>  对于Branch/Share/Pin/Labelq几功能的融合使用Q正文及附录的相关部分提供了相当不错的范例,演示了如何通过灉|q用诔R功能Q以自如应对不同的开发场景。笔者在看到q部分内ҎQ一旉有了恍然大悟之感Q心中不想刎ͼ原来VSS也可以如此用法。相信这些范例对大家也会有不的启示和“震撼”的? </p><p>  此外Q附录部分的“VSS命o-权限U别对应表”是W者整理之后的l果Q有了它Q大家对不同权限的用户可以用何U功能,自会变得一目了然? </p><p>  希望q个教程可以对ƈ不十分熟悉VSS的开发h员和理人员有所帮助Q同时也希望可以借此Z澄清一下大家对VSS的一些“偏见”:Q? </p><hr /><p class="middletitle"></p><table width="450" bgcolor="#cccccc" border="1"><tbody><tr><td><p> <b>目录</b></p><a ><font color="#223355"><u>1 说明</u></font></a><br /><br /><a ><font color="#223355"><u>2 概述</u></font></a><br /><br /><a ><font color="#223355"><u>3 理员部?/u></font></a><ul><li><a ><font color="#223355"><u>3.1 l护用户列表</u></font></a><ul><li><a ><font color="#223355"><u>3.1.1 d用户</u></font></a></li><li><a ><font color="#223355"><u>3.1.2 更改密码</u></font></a></li><li><a ><font color="#223355"><u>3.1.3 创徏用户列表</u></font></a></li><li><a ><font color="#223355"><u>3.1.4 删除用户</u></font></a></li><li><a ><font color="#223355"><u>3.1.5 ~辑用户属?/u></font></a></li></ul></li><li><a ><font color="#223355"><u>3.2 理数据?/u></font></a><ul><li><a ><font color="#223355"><u>3.2.1 分析数据目录</u></font></a></li><li><a ><font color="#223355"><u>3.2.2 数据库打?/u></font></a></li><li><a ><font color="#223355"><u>3.2.3 清除临时目录</u></font></a></li><li><a ><font color="#223355"><u>3.2.4 锁定数据?/u></font></a></li><li><a ><font color="#223355"><u>3.2.5 数据库恢?/u></font></a></li><li><a ><font color="#223355"><u>3.2.6 使用多个数据?/u></font></a></li></ul></li><li><a ><font color="#223355"><u>3.3 有关权限的话?/u></font></a><ul><li><a ><font color="#223355"><u>3.3.1 权限的传?/u></font></a></li><li><a ><font color="#223355"><u>3.3.2 安全讉K权限</u></font></a></li></ul></li></ul><a ><font color="#223355"><u>4 普通用户部?/u></font></a><ul><li><a ><font color="#223355"><u>4.1 对工E、文件的一般性?/u></font></a><ul><li><a ><font color="#223355"><u>4.1.1 打开/关闭数据?/u></font></a></li><li><a ><font color="#223355"><u>4.1.2 创徏新工E?/u></font></a></li><li><a ><font color="#223355"><u>4.1.3 d文g、目录、工E?/u></font></a></li><li><a ><font color="#223355"><u>4.1.4 删除和恢复文件、工E?/u></font></a></li><li><a ><font color="#223355"><u>4.1.5 Ud文g和工E?/u></font></a></li><li><a ><font color="#223355"><u>4.1.6 重命名文件、工E?/u></font></a></li><li><a ><font color="#223355"><u>4.1.7 讄工作目录</u></font></a></li></ul></li><li><a ><font color="#223355"><u>4.2 {օ、签出、获取、查看及相关操作</u></font></a><ul><li><a ><font color="#223355"><u>4.2.1 {օ{և操作</u></font></a></li><li><a ><font color="#223355"><u>4.2.2 撤销{և</u></font></a></li><li><a ><font color="#223355"><u>4.2.3 获取最q版?/u></font></a></li><li><a ><font color="#223355"><u>4.2.4 获取早期版本</u></font></a></li><li><a ><font color="#223355"><u>4.2.5 获取和查看文件、工E?/u></font></a></li><li><a ><font color="#223355"><u>4.2.6 回滚C前版?/u></font></a></li><li><a ><font color="#223355"><u>4.2.7 多h同时{և一个文?/u></font></a></li><li><a ><font color="#223355"><u>4.2.8 合ƈ</u></font></a></li><li><a ><font color="#223355"><u>4.2.9 排他性签?/u></font></a></li><li><a ><font color="#223355"><u>4.2.10 对工E的Cloak操作</u></font></a></li></ul></li><li><a ><font color="#223355"><u>4.3 Branch、Share、Label和Pin操作</u></font></a><ul><li><a ><font color="#223355"><u>4.3.1 Ҏ件和工程的Branch/Share操作</u></font></a></li><li><a ><font color="#223355"><u>4.3.2 l文件、工E指定标{?/u></font></a></li><li><a ><font color="#223355"><u>4.3.3 Pin操作</u></font></a></li></ul></li><li><a ><font color="#223355"><u>4.4 其他操作</u></font></a><ul><li><a ><font color="#223355"><u>4.4.1 扩展关键?/u></font></a></li><li><a ><font color="#223355"><u>4.4.2 使用Shadow目录</u></font></a></li><li><a ><font color="#223355"><u>4.4.3 性能优化</u></font></a></li><li><a ><font color="#223355"><u>4.4.4 查找文g</u></font></a></li><li><a ><font color="#223355"><u>4.4.5 讄密码</u></font></a></li><li><a ><font color="#223355"><u>4.4.6 ~写批处理文?/u></font></a></li><li><a ><font color="#223355"><u>4.4.7 定制SS.INI和SRCSAFE.INI文g</u></font></a></li></ul></li></ul><a ><font color="#223355"><u>附录</u></font></a><ul><li><a ><font color="#223355"><u>A1 同时l护一个工E的多个版本</u></font></a></li><li><a ><font color="#223355"><u>A2 VSS中部分命令的对应权限U别 </u></font></a></li></ul></td></tr></tbody></table><font color="#223355"><u><hr /></u></font><p class="middletitle"><a name="1"><strong><font color="#223355"><br />1 说明</font></strong></a></p><p>一、本教程针对不同使用对象提供Visual SourceSafe 6.0的若q用指|阅读对象包括Visual SourceSafe的管理员和普通用P以及希望了解如何采用Visual SourceSafeq行软g版本控制的管理h员。管理员或普通用户在使用Visual SourceSafe的过E中Q如果遇C知如何操作,或者对某些操作的注意事不甚了解等cM情况Ӟ可以查阅本教E?/p><p>二、本教程?理员部?是管理员必读的,如果理员在除行其自n职责之外Q还gQ普通用L角色Q则可以参阅教程中的"普通用户部?。作Z般的普通用P只需阅读"普通用户部?卛_?/p><p>三、教E中列D的操作,加星可,为高U用法(Advanced UsageQ,其余为基本用法(Basic UsageQ。所谓基本用法是指一些通常使用频繁的,或者是使用Ҏ较ؓ单的操作。所谓高U用法是指通常使用频率不多Q或者较为重要的Q或者用法复杂的操作?/p><p>四、本教程内容摘选ƈ改编自Visual SourceSafe 6.0英文版联机帮助,从中提取了诸多重要信息、容易忽略的内容以及若干注意事项。一些基本内容(主要指某些基本操作的使用ҎQ只单列举了条目Q欲了解q些条目的详l情况请查看联机帮助的相关部分,可以通过列于q些条目之后的英文说明在联机帮助中搜索到相关内容?/p><p>五、本教程不涉及Visual SourceSafe囑Ş用户界面操作的解释说明,Ҏ定功能的具体操作步骤h看联机帮助的相关部分。可以通过列于该功能之后的英文说明在联机帮助中搜烦到相兛_宏V?/p><p>六、在其他Visual Studio产品中(例如QVisual C++Q可以集成Visual SourceSafe的功能,本教E不涉及有关在其他集成开发环境下如何使用Visual SourceSafe功能的内容,q部分内容主要针Ҏ通用戗对q些内容的了解,在阅d本教E之后,会变得Ҏ。此外,某些操作在Visual SourceSafe环境下用更为方ѝ?/p><p class="middletitle"><a name="2"><strong><font color="#223355">2 概述</font></strong></a></p><p>  Visual SourceSafeQ以下简UVSSQ是一U版本控制管理工兗它通过各U类型的文gQ包括:文本文g、图像文件、二q制文g、声x件、视频文件等Q存入其内部数据库的方式Q帮助你有效地管理工E(ProjectQ关于VSS中工E的概念误下面Q。它允许你在多个工程间共享同一l文Ӟ你可以将一个文件添加到数据库中Q以便其他相关h员用;MҎ件的更改被记录下来Q以便在M时候可以恢复到该文件的某个旧版本?/p><p>  VSS的工E组l方式团队协作开发变得更为容易和直观?em class="important">一个工E是一l存放于VSS数据库内的Q意类型的文gQ一个工E类g操作pȝ中的目录Q但VSS为其提供了版本控制、历史记录、文件合q等更多的功能支持?/em></p><p class="middletitle"><a name="3"><strong><font color="#223355">3 理员部?/font></strong></a></p><p class="middletitle"><a name="31">3.1 l护用户列表(Maintain the User List)</a></p><p class="middletitle"><a name="311">3.1.1 d用户(Add a User)</a></p><p class="middletitle">  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="312">3.1.2 更改密码(Change Passwords)</a></p><p class="middletitle">  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="313">3.1.3 创徏用户列表(Create a User List)</a></p><p class="middletitle">  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="314">3.1.4 删除用户(Delete a User)</a></p><p class="middletitle">  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="315">3.1.5 ~辑用户属?Edit User Attributes)</a></p><p class="middletitle">  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="32">3.2 理数据?Manage the Database)</a></p><p class="middletitle"><a name="321">3.2.1 分析数据目录(Analyze the Data Folder)*<br />你定期备份完整的VSS数据目录Q参见数据库打包Q。VSS数据目录中包含有全部工程和文件的数据库信息。由于网l或操作pȝ的某些故障,VSS中的文g可能存在错误和不一致问题,Analyze VSS DB工具被用来查扑֒修复q些问题。在q行该工具前Q需要锁定(LockQ所有用户ƈ要求他们退出VSSQ用户可以在一个数据库被锁定时保持文g的签出状态(参见锁定数据库)。徏议分两次q行Analyze VSS DB工具Q第一ơ修复错误,W二ơ核查是否仍然存在没有被修复的错误。数据目录的具体位置是由Data_Path初始化变量在SRCSAFE.INI文g中指定的Q参见定制SS.INI和SRCSAFE.INI文gQ?/a></p><p class="middletitle"><a name="322">3.2.2 数据库打?Archive Databases)*</a></p><p class="middletitle">  你可能需要定期地备䆾VSS数据库,或者数据库的某一部分。VSS Administrator工具提供了此功能。它可以Q?</p><p class="middletitle">节省VSS数据库服务器的磁盘空间?<br />加快昄历史记录操作QShow HistoryQ的速度?<br />便于在多个VSS数据库间传递文件和工程Q保持历史记录完整无~?<br />备䆾全部或部分VSS数据库内容ƈ压羃成文件?<br /><br /><a name="323">3.2.3 清除临时目录(Clean Temporary Folder)</a></p><p class="middletitle">  VSS通常在运行时把时结果放在时目录里Qƈ在退出前之删除。由于某些原因,例如非正帔R启,可能D临时内容D留在目录中。作为管理员Q你有责d期清除时目录的内容。每隔几周一ơ,当没有Q何用戯行VSS或VSS AdministratorӞh除时目录的内容。时目录的具体位置是由Temp_Path初始化变量在SRCSAFE.INI文g中指定的Q参见定制SS.INI和SRCSAFE.INI文gQ?</p><p class="middletitle"><a name="324">3.2.4 锁定数据?Lock a Database)</a></p><p class="middletitle">  数据库锁定功能将不会自动锁定那些当前已经d的用P你应该在锁定数据库之前要求登录用户退出VSS。在重新允许用户使用VSS之前Q需要解除对数据库的锁定?br /><br /><br /><a name="325">3.2.5 数据库恢?Restore Databases)</a></p><p class="middletitle">  此处略,详细内容h阅联机帮助?br /><br /><a name="326">3.2.6 使用多个数据?Work with Multiple Databases)*</a></p><p class="middletitle">  ~省ӞVSS所有文仉中放在一个数据库中。如果可能,应尽量用一个数据库存放所有文Ӟq比分多个数据库存放要好Q因为: <br />你不能在多个数据库间׃nQShareQ文Ӟ参见Ҏ件和工程的Branch/Share操作Q?<br />位于多个数据库中的内容集中在一h比较困难的,需要用VSS Administrator的Archive功能Q参见数据库打包Q?<br />Z安全的考虑QVSS的用户信息,包括密码在内Q是和数据一起存攄?br />如果Z安全赯Q要信息拆分成多个独立的数据库Q?br /><br />  ~省ӞVSS所有文仉中放在一个数据库中。如果可能,应尽量用一个数据库存放所有文Ӟq比分多个数据库存放要好Q因为:你不能在多个数据库间׃nQShare Q文Ӟ参见Ҏ件和工程的Branch/Share操作Q?<br />位于多个数据库中的内容集中在一h比较困难的,需要用VSS Administrator 的Archive功能Q参见数据库打包Q?<br />Z安全的考虑QVSS的用户信息,包括密码在内Q是和数据一起存攄。如果ؓ了安全v见,要将信息拆分成多个独立的数据库,q种信息存储方式带来极大的便利,但你必须为每个数据库都单独添加用戗?<br /><br /><br /><a name="33">3.3 有关权限的话?About Rights)</a></p><p class="middletitle"><a name="331">3.3.1 权限的传?Rights Propagation)</a></p><p class="middletitle">  当你d了一个新用户Qƈ用户讄了针Ҏ个工E的权限Ӟ在VSS数据库中建立起一个assignment。该 assignment会沿着工程树向下传递直至遇到另一个assignment?/p><p class="middletitle">  例如Q针对工E?$/" Q你为用户A指定了Add权限Q参见安全访问权限)Q而对于工E?$/Sample"Q你没有为用h式指定权限,则该用户对工程"$/Sample"自动拥有Add权限。当你在工程"$/Sample/BusinessObject"处ؓ其指定了Read权限后,阻止早先assignment的向下传递过E,所以用户A对该工程Q指"$/Sample/BusinessObject"Q及其子工程都只hRead权限了?/p><p class="middletitle">  当你首次d一个用hQ该用户在工E?$/"处被赋予的权限由"~省权限"军_Q缺省权限是通过在VSS Administrator里设|Project Security属性页的内Ҏ定义的。你可以通过修改该页内容Q全局性地变更所有用L~省权限?/p><p class="middletitle"><a name="332">3.3.2 安全讉K权限(Security Access Rights)</a></p><p class="middletitle"><a name="3321">3.3.2.1 ~省安全讄</a></p><p class="middletitle">  当安装VSS后,~省安全讄被启用。你可以利用定制的方式,使某些用h有对某些工程和某些VSS命o的特定权限?/p><p class="middletitle">  ~省安全讄很简单,当添加新用户Ӟ你只有两U别的讉K权限可供选择Q?</p><p class="middletitle">只读权限QRead-only rightsQ:用户可以查看VSS中的M内容Q但不能更改?<br />可读写权限(Read/write rightsQ:用户可以查看和修改VSS中的M内容?</p><p class="middletitle">  如果q样的访问权限别以应Ҏ怋用,那么无需再增强安全控制的U别了?/p><p class="middletitle">  所有的VSS安全理都在VSS Administrator中进行。Q何能q行该程序的用户都可以改变VSS的Q意特性,所以最好只有管理员才用该E序?/p><p class="middletitle"><a name="3322">3.3.2.2 更高U别的安全控?/a></p><p class="middletitle">  在VSS中,对工E的安全性控Ӟ是通过制定用户讉K权限来实现的。每个工E仅能被那些h相应权限的用戯问到Q每个命令仅能被那些h相应权限的用户用。可以通过VSS Administrator来定制权限,以达到更高别的安全控制?/p><p class="middletitle">  以下是VSS的权限别列表,下列每种权限都拥有该权限之前的全部权限。例如:拥有Check Out权限的用P也将同时拥有Read权限。(参见附录A2QVSS中部分命令的对应权限U别Q?/p><p class="middletitle">权限 描述 <br />Read (R) cM于缺省安全设|中的只L?<br />Check Out (C) 可以使用Check Out/Check In/Undo Check Out{命令对文gq行修改 <br />Add (A) 可以使用Add/Delete/Label/Rename{命令对文gq行修改 <br />Destroy(D) 可以使用 Destroy/Purge/Rollback{命令对文g实施怹删除操作 <br /></p><p class="middletitle"><a name="4"><strong>4 普通用户部?/strong></a></p><p class="middletitle"><a name="41"><strong><font color="#223355">4.1 对工E、文件的一般性?Normal Use about Projects and Files)</font></strong></a></p><p class="middletitle"><a name="411"><strong>4.1.1 打开/关闭数据?Open/Close a Database)</strong></a></p><p>  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="412"><strong>4.1.2 创徏新工E?Create New Projects)</strong></a></p><p>  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="413"><strong>4.1.3 d文g、目录、工E?Add FilesQFoldersQand Projects)</strong></a></p><p>  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="414"><strong>4.1.4 删除和恢复文件、工E?Delete and Recover Files and Projects)</strong></a></p><p>  VSS提供?U删除文件的ҎQ? </p><ul><li>DeleteQVSS只把指定文g从当前工E中删除Q而在VSS数据库中仍留有该文g的记录。此外,其他׃n了该文g的工E仍保留此文Ӟ参见<a ><font color="#000080"><u>Ҏ件和工程的Branch/Share操作</u></font></a>Q? </li><li>DestroyQVSS把指定文g从VSS数据库中d删除Q其后将无法恢复? </li><li>PurgeQ永久性删除已被Delete掉的文gQ其后将无法恢复?</li></ul><p></p><p>  对于׃n文gQDelete和Destroy仅将文g从当前所选工E中删除掉,其他׃n了该文g的工E,以及VSS数据库中Q仍留有此文件?</p><p class="middletitle"><a name="415"><strong><font color="#223355">4.1.5 Ud文g和工E?Move Files and Projects) </font></strong></a></p><p>  Ud一个文件的唯一Ҏ是,在文件新所在位|的上一U工E(parent projectQ处使该文g׃nQ参?a ><font color="#000080"><u>Ҏ件和工程的Branch/Share操作</u></font></a>Q,然后原有工E(original projectQ下的该文gDelete或?DestroyQ参?a ><font color="#000080"><u>删除和恢复文件、工E?/u></font></a>Q。移动后Q文件的历史记录被保留?</p><p>  通过使用Move命oQ你可以一个子工程QsubprojectQ从某个上工程重置到另一个工E下。该操作不会改变子工E的内容和历史记录,但它会媄响上U工E的历史记录Q包括子工程所在的原有上工程和新的上U工E)。当Ud一个工E后Q你无法重建原有上U工E的某个旧版本?/p><p class="middletitle"><a name="416"><strong><font color="#223355">4.1.6 重命名文件、工E?Rename Files or Projects) </font></strong></a></p><p>  若某个文件被多个工程所׃nQ对该文件的重命名将影响所有工E,而在Branch状态下Q则不媄响(参见<a ><font color="#000080"><u>Ҏ件和工程的Branch/Share操作</u></font></a>Q?/p><p class="middletitle"><a name="417"><strong><font color="#223355">4.1.7 讄工作目录(Set Working Folders)</font></strong></a></p><p>  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="42"><strong>4.2 {օ、签出、获取、查看及相关操作(Check In/Out、Get、View and Other Related Use) </strong></a></p><p class="middletitle"><a name="421"><strong>4.2.1 {օ{և操作(Check In and Check Out Files)</strong></a></p><p>  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="422"><strong>4.2.2 撤销{և(Undo Check Out)</strong></a></p><p>  执行该操作时Q若用户选择了替换本地文Ӟ则用户将丢失最q一ơ签出后对该文g在本地的更改?/p><p class="middletitle"><a name="423"><strong>4.2.3 获取最q版?Get Latest Version)</strong></a></p><p>  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="424"><strong>4.2.4 获取早期版本(Get Earlier Version)</strong></a></p><p>  此处略,详细内容h阅联机帮助?/p><p class="middletitle"><a name="425"><strong>4.2.5 获取和查看文件、工E?Get and View Files and Projects)</strong></a></p><p>  Get操作文件或工程拯x地的工作目录Qƈ讄为read-only属性。可以用View操作查看文g内容Q此时用h需讄工作目录?</p><p>  量不要删除vssver.scc文g。本地工作目录及每个子目录下都包含一个这L文gQVSS利用其中记录的信息确定本地目录中哪个文g已经更改了。删除后Q将使新一ơ的Get操作速度减慢?/p><p class="middletitle"><a name="426"><strong>4.2.6 回滚C前版?Rollback to Previous Versions)</strong></a></p><p>  该操作将使文件的内容恢复到先前某个版本时的状态,它将使所有在该版本后所做的改动丢失。如果你所回滚的文件被多个工程׃nQ则操作只媄响你所指定的那个工E,q且它会自动实行Branch操作Q参?a ><font color="#000080"><u>Ҏ件和工程?Branch/Share操作</u></font></a>Q。徏议你使用虚拟回滚QVirtual RollbackQ,它将不会佉K后的改动怹丢失。具体操作如下: </p><ul><li>选择你要回滚的文件ƈ{և </li><li>使用Get命o获取某个原有版本到本? </li><li>{օ该文?</li></ul><p></p><p class="middletitle"><a name="427"><strong><font color="#223355">4.2.7 多h同时{և一个文?Check Out Multiple Files) *</font></strong></a></p><p>  ~省状态下Q一个文件只允许一个h{ևQ管理员可以通过修改配置Q允许多人同时签出。此ӞVSS跟t所有签文g的用戗每当用L入时QVSS都将和当前存于数据库内的最新版本进行比较,若用户修改的是同一文g的不同处QVSS进行简单的合ƈQMergeQ,否则提示用户Qƈ且不允许{օ。用户可以通过VSS提供的Visual Merge工具Q比较存放于VSS数据库中的文件和本地文g的异同,手工修改本地文gQ直到认为已l可以签入时Q方才执行最l签入操作。(参见<a ><font color="#000080"><u>合ƈ</u></font></a>Q?/p><p class="middletitle"><a name="428"><strong><font color="#223355">4.2.8 合ƈ(Merge)*</font></strong></a></p><p>  在VSS中,合ƈ可能发生?U场合下Q用Multiple Checkout的工作方式;合ƈ原先已经Branch了的文gQ获取(GetQ文件? </p><ul><li>Multiple CheckoutQ若多个用户同时{և一个文ӞW一个用户只要简单的{օ可以了。后l用户也可以{օQ但他们的更改将需要和其他所有用L更改合ƈQVSS得到完整的更改内容Q参?a ><font color="#000080"><u>多h同时{և一个文?</u></font></a>Q? </li><li>BranchQ当被Branch的文件合q到其中一个分支时QVSS会把在另一个分支上所做的改动合ƈ到该分支上(参见<a ><font color="#223355"><u>Ҏ件和工程的Branch/Share操作</u></font></a>Q? </li><li>Merge on GetQ在Multiple Checkout工作方式下,当用Get Latest Version操作时可能引发合q操作,此时保存在VSS数据库中的内容将合ƈ到本地文件。但如果某个文g是排他性签出的Q则不会引发合ƈ操作Q参?a ><font color="#223355"><u>排他性签?</u></font></a>Q?</li></ul><p></p><p>  在完成一个合q之后,VSS遵@如下规则Q? </p><ul><li>如果仍有冲突QVSSl持文g的签出状态,Z使文件能利{օQ你必须排除q些冲突? </li><li>如果你用Merge Branches命oQ将一个文件合q到一个工E中Q而该工程中的对应文g已被{ևQ该文gl保持签出状态(参见<a ><font color="#223355"><u>Ҏ件和工程的Branch/Share操作</u></font></a>Q? </li><li>在Q何其他时候,VSS会提示你,或者在合ƈ后自动签入,或者保持文件的{և状态以使你在更新VSS数据库中内容之前再核查一辏V?</li></ul><p></p><p>  ~省情况下,当发生冲H时QVSS启用其Visual Merge工具?/p><p class="middletitle"><a name="429"><strong><font color="#223355">4.2.9 排他性签?Exclusive Check Out)*</font></strong></a></p><p>  允许多h同时{և一个文件是针对整个VSS数据库而言的,但用户仍可以Ҏ实际情况Q针Ҏ些文件修改该规则。对某个文g实施排他性签出,则其他用户将无法{և该文Ӟ直至该用户用了{օ操作?/p><p class="middletitle"><a name="42a"><strong>4.2.10 对工E的Cloak操作(Cloak Projects)*</strong></a></p><p>  若对某工E实行了Cloak操作Q则当对该工E的上一U工E进行Get/Check In/Check Out/Undo Check Out/Project Difference操作Ӟ不会媄响该工程及其子工E。而在该工E上q行cM操作Ӟ则和q_得到的结果一栗这一属性将传递给其下的子工程?/p><p>  例如Q某个工E其路径?/ApplicationQ下面有三个子工E:$/Application/CodeQ?/Application/TestQ?/Application/DocsQ?Docs工程下的内容可能对你没有M用处。当你每ơ从$/Application处进行Get操作后,都需要从本地删除多余的Docs目录。此时可以对Docs q行Cloak操作。这P每次的Get操作只把Code和Test下的内容攑ֈ本地。如果你需要获取Docs工程下的内容Q则可以单独从Docs处进行Get 操作?/p><p class="middletitle"><a name="43"><strong>4.3 Branch、Share、Label和Pin操作(Branch、Share、Label and Pin)</strong></a></p><p class="middletitle"><a name="431"><strong>4.3.1 Ҏ件和工程的Branch/Share操作(Branch and Share Files and Projects) *</strong></a></p><p>  在VSS中,通过Share操作Q一个文件可以被多个工程׃nQ在M一个工E中对该文g的更改,都将反映到其他相兛_E里?/p><p>  Branch操作则消除这U共享,每次一个被׃n的文件拆成两个分支,在不同工E中分别跟踪该文件。通过查看文g属性的Links属性页可以了解该文件被哪些工程׃nQ通过查看Paths属性页可以了解文g的分支状c?/p><p>  例如Q品目前的正式版本?.0Q工E\径ؓ$/ApplicationQ,在加入新功能后将升?.0。但在开始升U的q程中,光的一个过渡版?.1存在bugQ需要修攏V此时可以进行如下操作:选择被Label标识?.0的那个版本(参见<a ><font color="#000080"><u>l文件、工E指定标{?/u></font></a>Q,利用Share功能创徏q渡版本Q工E\径ؓ$/Application2.1Q,此时两个工程中的文g是共享的Q且$/Application2.1中的所有文仉处于Pin状态(参见<a ><font color="#000080"><u> Pin操作Q?</u></font></a>Q即Q在?.0升的过E中Q对$/Application中相x件的更改Q将不媄?/Application2.1下的内容Q但此时文g仍是׃n的。仅寚w要修改bug的文仉取Branch操作。这样做的好处是Q中间版本的bug修改工作?.0的升U工作可以同时进行,q且最大限度的降低了所需的存储空间?/p><p class="middletitle"><a name="432"><strong><font color="#223355">4.3.2 l文件、工E指定标{?Label Files and Projects) *</font></strong></a></p><p>  VSS使用3U方式跟t文件的历史记录Q内部版本号Q日期,用户自定义标{?/p><p>  标签可以是一个不过31个字W长度的Ԍ例如Q?1.0"?2.01b"?Final Beta"?Approved for QA"。应用Label功能Q用户就可以获取某个特定时期的Y件内容了。所有当前工E下的文件和子工E都承该标签?/p><p>  注意下面几点Q? </p><ul><li>当用Label功能Ӟ表明你在所选工E的历史记录里创Z一个新的版本,但文件和工程本n的内容ƈ未发生变化? </li><li>Ҏ个工E的某个标签再次使用Label操作覆盖原来的标签内容?</li></ul><p></p><p>  请参见附录A1Q?a ><font color="#000080"><u>同时l护一个工E的多个版本</u></font></a></p><p class="middletitle"><a name="433"><strong><font color="#223355">4.3.3 Pin操作(Pin)*</font></strong></a></p><p>  该功能对׃n文g很有用,管它的使用不仅限于׃n文gQ也包括其他M文g。当你对一个文件实施Pin操作后,你将不能对之做Q何修攏V如果一个文件在Pin之后又被实施了Share操作Q而被Pin的那个版本同时也是被׃n的版本,则所有共享该文g的工E都不能更改该文件。如果一个文件先被实施了Share操作Q而后在某个工E中被Pin了,则除了这个工E外的其余工E仍可以更改该文Ӟ参见<a ><font color="#000080"><u>Ҏ件和工程的Branch/Share操作</u></font></a>Q?br /></p><p class="middletitle"><a name="44"><strong><font color="#223355">4.4 其他操作(Other Use)</font></strong></a></p><p class="middletitle"><a name="441"><strong>4.4.1 扩展关键?Expand Keywords)*</strong></a></p><p>  VSS可以某些指定信息(例如QVSS内部版本P直接插入文本文g中。用户只要将某些关键字放入文件的注释中,每次dQAddQ或{օQCheck InQ文件时QVSS都会自动查找q些关键字,q将相关信息|于其后?/p><p>  VSS中常用的关键字: </p><table border="1"><tbody><tr><td>关键?/td><td>描述</td></tr><tr><td>$Archive: $</td><td>文g在VSS中的路径?/td></tr><tr><td>$Author: $</td><td>最q一ơ更Ҏ件的用户</td></tr><tr><td>$Date: $</td><td>最q一ơ签入的旉</td></tr><tr><td>$History: $</td><td>文g的历史记?/td></tr><tr><td>$Revision: $</td><td>VSS内部版本?/td></tr><tr><td>$NoKeywords: $</td><td>使VSS对其后的所有关键字不进行扩?/td></tr></tbody></table><p>  例如Q?/p><p>  在某文g中加入如下一行:</p><p>  $Revision: $</p><p>  若当前该文g在VSS内部的版本号?2Q则{օ后VSS会将之修改ؓQ?/p><p>  $Revision: 23 $</p><p class="middletitle"><a name="442"><strong>4.4.2 使用Shadow目录(Work with Shadow Folders)*</strong></a></p><p>  Shadow目录位于服务器端Q包含了工程中所有的文g。这些文件既非位于VSS数据库中的master copyQ亦非位于本地工作目录的local copyQ而是最q一ơ签入的所有内宏VShadow目录应该q理员来设|?/p><p>  是否使用Shadow目录功能是可选的Q通常在如下两U情况下可以考虑使用该功能: </p><ul><li>Z某些用户能查看文Ӟ但不能更改)Q这些用户可能没有对VSS的访问权限? </li><li>不让你的本地工作目录保留可编译的软g副本。ؓ使每个用户都能得C个最新版本的软gQ所有用户可能希望在某个目录下集中进行编译,而非在各自的工作目录下编译。在q种情况下,Shadow目录功能通常和添加(AddQ、签入(Check InQ之后的Remove Local Copyl合使用?</li></ul><p></p><p>  Shadow目录不会跟踪子工E的变化Q例如:你有一个被Shadow的工E?/AQ包含两个子工程Q?/A/1?/A/2Q而你又将$/A/2重命名ؓ $/A/BQ这U变化将不会被反映到Shadow目录中。你可以手工修改Q或者利用Reconcile All功能Q之保持同步?/p><p class="middletitle"><a name="443"><strong>4.4.3 性能优化(Optimize Performance)*</strong></a></p><p>  有两U方法可以改善VSS的性能Q尽可能多的内定w过|络拯x地来做;修改初始化文件对VSS的性能q行微调?/p><p>  具体优化措施Q? </p><ul><li>在SS.INI或SRCSAFE.INI文g中设|如下变量: <p>Diff_Ignore (PC) = c-e-s-w-</p><p>使VSS在进行文件比较时忽略end-of-line标记Q从而加快运行效?/p><p>CP_OnSelection = No</p><p>在用VSS ExplorerӞ~省状态下Q用户用鼠标单L使用键盘的方向键在工E列表上UdӞ׃选中工程。设为No后,只有双击鼠标或按回R键才会选中?/p></li><li>讄临时目录 <p>~省情况下,VSS时文件存于服务器端,但管理员可以通过修改SS.INI中的Temp_Path变量Q将临时路径讄在本地?/p></li><li>让管理员在SRCSAFE.INI文g中将Lock_Mode变量讄为Native <p>q是SRCSAFE.INI中该变量的缺省设|,把该变量讄为Native几乎所有的VSS操作都得到加速。该变量只能q理员来设|?/p></li><li>理员通过Disable下面的功能,也可以一定程度地改善性能Q? <ul><li>Shadow foldersQ参?a ><font color="#000080"><u>使用Shadow目录</u></font></a>Q? </li><li>Journal files </li><li>Project security systemQ参?a ><font color="#223355"><u>安全讉K权限</u></font></a>Q? </li><li>Keyword expansionQ参?a ><font color="#223355"><u>扩展关键?/u></font></a>Q?</li></ul></li></ul><p></p><p class="middletitle"><a name="444"><strong><font color="#223355">4.4.4 查找文g(Search for Files)</font></strong></a></p><p>  VSS Explore的list view~省时只昄当前工程中的所有文件。通过使用Search命oQ可以只昄W合指定要求的文件。例如:只显C?.h文gQ只现实被签出的文g。Search命o是允讔R归的?/p><p class="middletitle"><a name="445"><strong>4.4.5 讄密码(Set Passwords)</strong></a></p><p>  如果VSS理员指定域账号为VSSd账号Q则用户dVSS时将不会提示输入密码?/p><p class="middletitle"><a name="446"><strong>4.4.6 ~写批处理文?Writing Batch Files)*</strong></a></p><p>  在编写批处理文gӞ一些在命o行方式下使用的交互手D需要改变?/p><p></p><ul><li>屏蔽输入QDisable InputQ? <p>如果你的批处理文件中包含了一pdVSS命oQ它们可能需要整夜运行)Q你一定不希望E序执行期间会停下来提示用户输入信息。有3个命令行选项可以解决此类问题?/p><p>~省ӞVSS在执行诸如添加(AddQ、签入(Check InQ等操作时会提示你输入注释(CommentQ,利用-c选项可以避免该类提示Q? </p><table border="1"><tbody><tr><td>命o</td><td>描述</td></tr><tr><td>-c-</td><td>不添加注?/td></tr><tr><td>"-cHello"</td><td>使用Hello字串作ؓ注释</td></tr><tr><td>-c@COMMENT.TXT</td><td>使用comment.txt文g的内容作为注?/td></tr></tbody></table><p>此外QVSS通常会要求用户回{yes或noQ你可以使用-i选项避免此类问题Q? </p><table border="1"><tbody><tr><td>命o</td><td>描述</td></tr><tr><td>-i-y</td><td>Ҏ有此cL问自动回{Yes</td></tr><tr><td>-i-n</td><td>Ҏ有此cL问自动回{No</td></tr><tr><td>-i</td><td>使用~省回答</td></tr></tbody></table><p>VSS也可能会提示d名,你可以?y选项提供_多的信息?/p></li><li>重定向输? <p>~省ӞVSS所有输出定向到屏幕Q在命o行状态下你可以?o选项分页输出Q而在批处理文件中你同样可以利?o屏蔽输出或重定向输出? </p><table border="1"><tbody><tr><td>命o</td><td>描述</td></tr><tr><td>-o-</td><td>屏蔽输出</td></tr><tr><td>-oRESULTS.TXT</td><td>重定向所有输出到文本文gresults.txt中,如果该文件已存在Q输出内容将q加到该文g末尾?/td></tr></tbody></table></li><li>使用命o行返回? <p>在命令行状态下q行VSSӞVSS会设|一些返回值来标明q行状态。你可以在批处理文g中根据VSS的返回值采取相应措施? </p><table border="1"><tbody><tr><td>q回?/td><td>描述</td></tr><tr><td>100</td><td>表明出错Q例如:VSS无法扑ֈ数据库文Ӟ或者你试图{և某个早已被签出的文g?/td></tr><tr><td>1</td><td>表明一个不是很严重的错误,在如下三种情况下发生:<br />当你使用ss DirӞ没有扑ֈM条目?br />当你使用ss StatusӞ臛_有一被{և?br />当你使用ss DiffӞ臛_有一个文件不一致?br />所有这些情况表明,即本次操作是成功的Q你执行的下一个VSS命o也可能操作失败?/td></tr><tr><td>0</td><td>VSS成功执行?/td></tr></tbody></table></li></ul><p></p><p class="middletitle"><a name="447"><strong>4.4.7 定制SS.INI和SRCSAFE.INI文g(Customize the SS.INI and SRCSAFE.INI Files) </strong></a></p><p>  VSS有两cd始化文gQ它们包含了VSS的一些环境变量:SS.INIQ每个用户都有一个这L文gQSRCSAFE.INIQ仅有一个,定义了VSS 的一些全局变量Q只有管理员才有权修改它?/p><p class="middletitle"><a name="a"><font color="#421ae6"><strong>附录</strong></font></a><font color="#421ae6"><strong> </strong></font><a name="a1"><font color="#421ae6"><strong> 同时l护一个工E的多个版本(Maintain Multiple Versions of a Project)</strong></font></a></p><p>  你可以用Share/Pin/Branch的方式,也可以用Label方式。如果你所处的环境只要求少量的改动Q比如:轻量U的patchQ?Label比较合适;如果你正在规划大量的开发内容,使用Share/Pin/Branch比较合适。例如:在Y件处于Beta版时Q你可以通过Label功能ȝQfreezeQ之Qƈ同时修改Beta版的bug。当你正同时l护着某个产品?.1版和2.0版时Q合理的做法是,为每个版本创Z个新的工E, ShareqPin所有的文gQ在需要的时候Branch。当1.1发布Ӟ你可以将1.1版的工程LabelQ而后对1.1版的改动重新Merge?.0版中。下面的几个场景Z使用Label功能提供指导Q?/p><p><b>场景1Q理x?/b></p><p>1、对卛_到达Beta 1版的工程q行开发和试?br />2、当你认为时机适宜Ӟ之Label?Beta 1"?br />3、开始Beta 2版的工作?</p><p><b>场景2Q文件A的某个版本被错误地包含在Beta 1版中</b></p><p>1、对卛_到达Beta 1版的工程q行开发和试?br />2、当你认为时机适宜Ӟ之Label?Beta 1"?br />3、开始Beta 2版的工作?<br />4、如果发现文件A某一时期的版本被错误的包含在了Beta 1版中Q选择该文件的正确版本qLabel?Beta 1"?br />5、获取(GetQBeta 1 版的工程?</p><p><b>场景3Q需bug-fix后的文gA被包含在Beta 1版中Q而其余文件未曾改?/b></p><p>1、对卛_到达Beta 1版的工程q行开发和试?br />2、当你认为时机适宜Ӟ之Label?Beta 1"?br />3、开始Beta 2版的工作?<br />4、你发现Q包含在Beta 1版中文gA的那个版本存在bugQ必L正,而工E中的其余文件则不须改动?br />5、签文gQ改正,然后{օ?br />6、将工程重新Lable?Beta 1"Q你被询问是否认删除原有标记Q?</p><p><b>场景4Q需bug-fix后的文gA包含在Beta 1版中Q而其余文件也作了改动</b></p><p>1、对卛_到达Beta 1版的工程q行开发和试?br />2、当你认为时机适宜Ӟ之Label?Beta 1"?br />3、开始Beta 2版的工作?<br />4、你发现Q包含在Beta 1版中文gA的那个版本存在bugQ必L正,而工E中的其余文件已l改动过且已l被{օ?br />5、签文gQ改正,然后{օQ此时该文g的VSS内部版本号将自动?Q?br />6、将该文件Label?Beta 1"Q和工程的Label同名Q,q将使该文g的现有版本被指定?Beta 1"?</p><p><b>场景5Q文件A的一个原有版本需要进行bug-fixQƈ加入Beta 1版中</b></p><p>1、对卛_到达Beta 1版的工程q行开发和试?br />2、当你认为时机适宜Ӟ之Label?Beta 1"?br />3、开始Beta 2版的工作?<br />4、你发现Q包含在Beta 1版中文gA的那个版本存在bugQ必L正。例如:文g的当前内部版本号?Q且包含了ؓ辑ֈBeta 2版所做的某些改动Q而你不希望将q些改动q入Beta 1版中?br />5、签出文件AQVersion 6Q?br />6、获取Version 4Q覆盖Version 6的本地版本?<br />7、修改该文gBeta 1版中的bugQ然后签入。这文gA的内部版本号升至7QVersion 4的内容加上bug-fix后的内容Q但没有包含 Version 5和Version 6的内容)<br />8、将Version 7 Label?Beta 1"。这文gA的Version 7版被指定?Beta 1"。现在,如果你尝试获取Beta 1版的工程Ӟ你将会得到包含bug-fix后的文gAQ被单独LabelQ连同原来Label?Beta 1"的工E中的其余文件?br />9、ؓ了l?Beta 2版的工作Q需要恢复在Version 5和Version 6上的改动Q再ơ签出文件AQVersion 7Q?br />10、获取Version 6?br />11、覆盖Version 7的本地版本,或合q之Q这本地版本变成Version 6的内容加上你在Version 7中ؓ"Beta 1"所做的bug-fixQ?br />12、l修Ҏ件A的本地版本直C满意Q然后签入。这生文件A的Version 8Q现在你可以lBeta 2版的工作了?br /></p><p class="middletitle"><a name="a2"><b><font color="#223355">附表 VSS中部分命令的对应权限U别</font></b></a></p><p>下表中打星号表示h该类权限的用户可以用该命o? </p><table border="1"><tbody><tr align="middle"><td align="middle"><b>功能</b></td><td align="middle" width="50"><b>R</b></td><td align="middle" width="50"><b>C</b></td><td align="middle" width="50"><b>A</b></td><td align="middle" width="50"><b>D</b></td></tr><tr><td align="middle">Add</td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Branch</td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Check In</td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Check Out</td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Cloak</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Create [1]</td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Delete</td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Destroy</td><td align="middle"> </td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td></tr><tr><td align="middle">Difference</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Get Latest Version</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">History</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Label</td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Links</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Merge [2]</td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Merge</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Move [3]</td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Move</td><td align="middle"> </td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td></tr><tr><td align="middle">Pin</td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Purge</td><td align="middle"> </td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td></tr><tr><td align="middle">Recover</td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Rename</td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Rollback</td><td align="middle"> </td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td></tr><tr><td align="middle">Share [4]</td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Share</td><td align="middle"> </td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Undo Check Out</td><td align="middle"> </td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr><tr><td align="middle">Set Working Folder</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td><td align="middle">*</td></tr></tbody></table><p>[1] 此处指用户必L对Parent Project的AcL限?br />[2] 此处指用户必L对目的Project的CcL限,同时有对原Project的RcL限?br />[3] 此处指用户必L对目的Parent Project的AcL限,同时有对原Parent Project的DcL限?br />[4] 此处指用户必L对原 Project的CcL限,同时有对目的Project的AcL限?</p><p class="middletitle"><font color="#0099ff">如需复制、传播,请附上本声明Q谢谢。原文出处:http://morningspace.51.net/Q?moyingzz@etang.com</font><a name="a1"></a></p><img src ="http://m.tkk7.com/jinfeng_wang/aggbug/97939.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jinfeng_wang/" target="_blank">jinfeng_wang</a> 2007-02-05 10:57 <a href="http://m.tkk7.com/jinfeng_wang/archive/2007/02/05/97939.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>郑重推荐一ƾYӞ http tunnelhttp://m.tkk7.com/jinfeng_wang/archive/2006/01/04/26616.htmljinfeng_wangjinfeng_wangWed, 04 Jan 2006 14:29:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2006/01/04/26616.htmlhttp://m.tkk7.com/jinfeng_wang/comments/26616.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2006/01/04/26616.html#Feedback1http://m.tkk7.com/jinfeng_wang/comments/commentRss/26616.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/26616.html软g介绍Q?/SPAN> 现在有很多公叔Rq|络加装了防火墙Q虽焉火墙主要是ؓ了抵抗外敌,但很多公怹拉K火墙L员工L使用 Internet。如果你有某个位?Internet 的服务是公司政策所不允许的Q你会就此放弃吗Q别担心Q防火墙所挡住的,HTTP-Tunnel NG 现在q给?/SPAN>



http://www.http-tunnel.com/html/




jinfeng_wang 2006-01-04 22:29 发表评论
]]>
some words from csdn (ZZ)http://m.tkk7.com/jinfeng_wang/archive/2005/06/17/6272.htmljinfeng_wangjinfeng_wangFri, 17 Jun 2005 03:51:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2005/06/17/6272.htmlhttp://m.tkk7.com/jinfeng_wang/comments/6272.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2005/06/17/6272.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/6272.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/6272.html 2) Improve your English skill.
 3) Improve your computer science skill.
 4) Improve your communication skill.
 5) Remove BS from your vocabulary, learn from everyone, as long as they have one thing stronger than you.
 6) Try define every vague term you're using precisely.
 7) Do not stop at surface, think deeper, dig deeper.
 8) Do not stop at surface, think higher, look at bigger picture.
 9) Be the best at your current job, learn something new, and then try to get a better job.
10) Help people less experienced than you.
11) Believe you can be expert too, reward yourself for your progress, even if it's small.
12) Do something grand with your life, realize your childhood dream.
13) Enjoy life.
14) Pass it to your kids.


jinfeng_wang 2005-06-17 11:51 发表评论
]]>
记一?/title><link>http://m.tkk7.com/jinfeng_wang/archive/2005/04/25/3731.html</link><dc:creator>jinfeng_wang</dc:creator><author>jinfeng_wang</author><pubDate>Mon, 25 Apr 2005 09:08:00 GMT</pubDate><guid>http://m.tkk7.com/jinfeng_wang/archive/2005/04/25/3731.html</guid><wfw:comment>http://m.tkk7.com/jinfeng_wang/comments/3731.html</wfw:comment><comments>http://m.tkk7.com/jinfeng_wang/archive/2005/04/25/3731.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jinfeng_wang/comments/commentRss/3731.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jinfeng_wang/services/trackbacks/3731.html</trackback:ping><description><![CDATA[<P> </P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"> <DIV><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">一切看的E淡的<BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>金钱看的轻轻?BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>目光看的q远?BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>健康看的重重?BR><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>.<BR>q四句话Q应该是值得C的,其最后一句,切记切记Q?img src ="http://m.tkk7.com/jinfeng_wang/aggbug/3731.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jinfeng_wang/" target="_blank">jinfeng_wang</a> 2005-04-25 17:08 <a href="http://m.tkk7.com/jinfeng_wang/archive/2005/04/25/3731.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用JMeterq行性能试http://m.tkk7.com/jinfeng_wang/archive/2005/04/19/3463.htmljinfeng_wangjinfeng_wangTue, 19 Apr 2005 07:45:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2005/04/19/3463.htmlhttp://m.tkk7.com/jinfeng_wang/comments/3463.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2005/04/19/3463.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/3463.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/3463.html http://www-128.ibm.com/developerworks/cn/java/l-jmeter/?ca=dwcn-newsletter-java

注: 可以对下面的文gq行改写QŞ成测试程序,供JMmeter试调用?BR>jakarta-jmeter-2.0.3\src\protocol\java\org\apache\jmeter\protocol\java\test\JavaTest.java

改写后的内容必须打包Q放到jmeter的lib目录?BR>



使用JMeterq行性能试
 


内容Q?/B>
JMeter作用领域
使用JMeter试Web应用
ȝ
工具下蝲Q?/A>
参考资?
关于作?/A>
Ҏ文的评h
订阅:
developerWorks 时事通讯

肖菁
软g工程?BR>2004 q?2 ?13 ?/P>

JMeter ?Apache l织的开放源代码目Q它是功能和性能试的工P100%的用java实现Q最新的版本?.9.1。本文中作者将向大家介l如何?JMeter q行试?/BLOCKQUOTE>

JMeter是Apachel织的开放源代码目Q它是功能和性能试的工P100%的用java实现Q最新的版本?.9.1Q大家可以到 http://jakarta.apache.org/jmeter/index.html下蝲源代码和查看相关文档?

JMeter作用领域

JMeter可以用于试静态或者动态资源的性能Q文件、Servlets、Perl脚本、java对象、数据库和查询、ftp服务器或者其他的资源Q。JMeter用于模拟在服务器、网l或者其他对象上附加高负载以试他们提供服务的受压能力,或者分析他们提供的服务在不同负载条件下的L能情况。你可以用JMeter提供的图形化界面分析性能指标或者在高负载情况下试服务?脚本/对象的行为?/P>

使用JMeter试Web应用

接下来的章节里,作者将详细的演C如何用JMeter来测试Web应用的完整过E?/P>

2.1 试环境

作者用了Tomcat作ؓWeb服务器进行测试,被测试的内容是一个jsp文g和一个servletQjsp文g调用JavaBean、打印相关信息,servlet接受用户参数、调用javabean、输出相关信息。详l的内容请参考作者提供的JMeter.war的内宏V?/P>

2.2 安装启动JMeter

大家可以到通过http://apache.linuxforum.net/dist/jakarta/jmeter/binaries/jakarta-jmeter-1.9.1.zip下蝲JMeter的release版本Q然后将下蝲?zip文g解压~到C:/JMeterQ后面的文章中将使用%JMeter%来引用这个目录)目录下?/P>

现在Q请使用%JMeter%/bin下面的jmeter.bat批处理文件来启动JMeter的可视化界面Q下面的工作都将在这个可视化界面界面上进行操作。下面的囄是JMeter的可视化界面的屏q截图?/P>

图一Q?JMeter打开时的屏幕截图
图一Q?JMeter打开时的屏幕截图

2.3 建立试计划QTest PlanQ?/SPAN>

试计划描述了执行测试过E中JMeter的执行过E和步骤Q一个完整的试计划包括一个或者多个线E组(Thread Groups)、逻辑控制QLogic ControllerQ、实例生控制器QSample Generating ControllersQ、侦听器(Listener)、定时器QTimerQ、比较(AssertionsQ、配|元素(Config ElementsQ。打开JMeterӞ它已l徏立一个默认的试计划,一个JMeter应用的实例只能徏立或者打开一个测试计划?/P>

现在我们开始填充一个测试计划的内容Q这个测试计划向一个jsp文g和一个servlet发出hQ我们需要JMeter模拟五个h者(也就是五个线E)Q每个请求者连l请求两ơ,下面的章节介l了详细的操作步骤?/P>

2.4 增加负蝲信息讄

q一步,我们向试计划中增加相兌载设|?是Jmeter知道我们需要模拟五个请求者,每个h者在试q程中连l请求两ơ。详l步骤如下:

1. 选中可视化界面中左边树的Test Plan节点Q单d键,选择Add'Thread GroupQ界面右边将会出C的设|信息框?/P>

2. Thread Group有三个和负蝲信息相关的参敎ͼ
Number of ThreadsQ?讄发送请求的用户数目
Ramp-up periodQ?每个h发生的L间间隔,单位是秒。比如你的请求数目是5Q而这个参数是10Q那么每个请求之间的间隔是10Q?Q也是2U?
Loop CountQ?h发生的重复次敎ͼ如果选择后面的foreverQ默认)Q那?h一直l,如果不选择foreverQ而在输入框中输入数字Q那么请求将重复 指定的次敎ͼ如果输入0Q那么请求将执行一ơ?

Ҏ我们演示例子的设计,我们应该Number of Threads讄?QRamp-up period讄?Q也是同时q发hQ,不选中foreverQ在Loop Count后面的输入框中输?Q设|后的屏q截囑֦下:

图二Q设|好参数的Thread Group?/B>
图二Q设|好参数的Thread Group? src=

2.5 增加默认Http属性(可选)

实际的测试工作往往是针对同一个服务器上Web应用展开?所以Jmeter提供了这样一U设|? 在默认Http属性设|需要被试服务器的相关属性,以后的httph讄中就可以忽略q些相同参数的设|?减少讄参数录入的时间?/P>

我们q里采用这U属性。你可以通过下面的步骤来讄默认http属性:

1. 选中可视化界面中左边树的Test Plan节点Q单d键,选择Add'config element'http request defaultsQ界面右边将会出C的设|信息框?/P>

2. 默认http属性的主要参数说明如下Q?
protocalQ发送测试请求时使用的协?
server name or ipQ被试服务器的ip地址或者名?
pathQ?默认的v始位|。比如将path讄为/jmeterQ那么所有的httph的url中都增加/jmeter路径?
port numberQ?服务器提供服务的端口?

我们的测试计划将针对本机的Web服务器上的Web应用q行试Q所以protocal应该是httpQip使用localhostQ因个web应用发布的context路径是/jmeterQ所以这里的path讄为/jmeterQ因Z用Tomcat服务器,所以port number?080。设|后的屏q截囑֦下:

图三Q?试计划中用的默认Http参数
图三Q?试计划中用的默认Http参数

2.6 增加Httph

现在我们需要增加httph了,他也是我们测试的内容M部分。你可以通过下面的步骤来增加性的httphQ?/P>

1. 选中可视化界面中左边树的Thread Group节点Q单d键,选择Add'sampler'http requestQ界面右边将会出C的设|信息框?/P>

2. 他的参数?.5中介l的http属性差不多Q增加的属性中有发送http时方法的选择Q你可以选择为get或者post?/P>

我们现在增加两个http hQ因为我们设|了默认的http属性,所以和默认http属性中相同的属性不再重复设|。设|后的屏q截囑֦下:

囑֛Q设|好的jsp试h
囑֛Q设|好的jsp试h

图五Q设|好的Servlet试hQ带参数Q?/B>
图五Q设|好的Servlet试hQ带参数Q?src="http://www-128.ibm.com/developerworks/cn/java/l-jmeter/images/image009.png"

2.7 增加Listener

增加listener是ؓ了记录测试信息ƈ且可以用Jmeter提供的可视化界面查看试l果Q里面有好几U结果分析方式可供选择Q你可以Ҏ自己习惯的分析方式选择不同的结果显C方式,我们q里使用表格的Ş式来查看和分析测试结果。你可以通过下面的步骤来增加listenerQ?/P>

1. 选中可视化界面中左边树的Test Plan节点Q单d键,选择Add'listener'view result in tableQ界面右边将会出C的设|信息和l果昄框?/P>

2. 你可以设|界面上面的filename属性设|将试l果保存到某个文件中界面下面用表格显C测试结果,表格的第一列sampleno昄h执行的顺序和~号Qurl昄h发送的目标QsampleQms列显C个请求完成耗费的时_最后的success列显C改h是否成功执行?/P>

界面的最下面你还可以看到一些统计信息,最兛_的应该是Average吧,也就是相应的q_旉?/P>

2.8 开始执行测试计?/SPAN>

现在你可以通过单击菜单栏run -> Start开始执行测试计划了。下面这两个图是作者第一ơ、第二次执行该测试计划的l果?

囑օQ第一ơ执行后的结果显C?/B>
囑օQ第一ơ执行后的结果显C?src="http://www-128.ibm.com/developerworks/cn/java/l-jmeter/images/image011.png"

图七Q第二次执行的结果显C?/B>
图七Q第二次执行的结果显C?src="http://www-128.ibm.com/developerworks/cn/java/l-jmeter/images/image013.png"

大家可以看到W一ơ执行时的几个大旉值均来自于jsp requestQ这可以通过下面的理p行解释:jsp执行前都需要被~译?class文g。所以第二次的结果才是正常的l果?/P>

ȝ

JMeter用于q行供能或者性能试Q通过使用JMeter提供的供能,我们可以可视化的制定试计划Q包括规定用什么样的负载、测试什么内宏V传入的参数Q同Ӟ他提供了好多U图形化的测试结果显C方式,使我们能够简单的开始测试工作和分析试l果?/P>

本文中,作者根据自q使用l验Q详l演CZ如何使用JMeter来进行Web试的全部过E,单的介绍了JMeter提供试l果的图形化昄界面中相兛_数的含义。希望能够帮助大家学会用JMeter的基本知识,同时Q大家可以参考这个过E和JMeter的帮助文档来实现对java对象、数据库{的试q程?/P>

工具下蝲Q?/SPAN>

1. tomcat http://jakarta.apache.org/tomcat/index.html

2. JMeter http://jakarta.apache.org/jmeter/index.html

参考资?

JMeter 的用h?Q?http://jakarta.apache.org/jmeter/usermanual/index.html

关于作?/SPAN>
姓名: 肖菁Q?jing.xiao@chinacreator.comQ作者目前是湖南省长沙铁道学院科创计机pȝ集成有限公司软g中心软g工程师,IBM developerworksQBEA dev2dev撰稿人,主要研究J2EE~程技术、Web Service技术以及他们在websphere、weblogic、apacheq_上的实现Q拥有IBM ?Developing With Websphere Studio证书。个人网站: vivianj.go.nease.net


jinfeng_wang 2005-04-19 15:45 发表评论
]]>
艰苦持久的战争! Q(http://m.tkk7.com/jinfeng_wang/archive/2005/04/10/3088.htmljinfeng_wangjinfeng_wangSun, 10 Apr 2005 13:01:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2005/04/10/3088.htmlhttp://m.tkk7.com/jinfeng_wang/comments/3088.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2005/04/10/3088.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/3088.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/3088.html通通通的服务不行了,免费用户基本不稳定了Q找了另外一个YӞ声点哦Q:Q?BR>
使用Http通道H破防火墙限Ӟ
http://cj1215.blogchina.com/blog/article_23763.686125.html




jinfeng_wang 2005-04-10 21:01 发表评论
]]>
hibernate's session和《企业应用架构模式》第11?/title><link>http://m.tkk7.com/jinfeng_wang/archive/2005/04/05/2869.html</link><dc:creator>jinfeng_wang</dc:creator><author>jinfeng_wang</author><pubDate>Tue, 05 Apr 2005 03:13:00 GMT</pubDate><guid>http://m.tkk7.com/jinfeng_wang/archive/2005/04/05/2869.html</guid><wfw:comment>http://m.tkk7.com/jinfeng_wang/comments/2869.html</wfw:comment><comments>http://m.tkk7.com/jinfeng_wang/archive/2005/04/05/2869.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jinfeng_wang/comments/commentRss/2869.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jinfeng_wang/services/trackbacks/2869.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><B><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN">hibernate实现了《企业应用架构模式》第11章的许多模式Q结合v来则更能理解hibernate的session的作用。只是双方的一些术语未必能直接对应上?BR>Q=Q=Q=Q=Q=Q?BR>Session接口<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></B></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN">SessionQ会话)接口是Hibernate应用使用的主要接口。会话接口的实例是轻量的ƈ且创Z销毁的代h也不昂贵。这很重要因Z的应用可能始l在创徏与销毁会话,可能每一ơ请求都会如此。Hibernate会话q不是线E安全的因此应该被设计ؓ每次只能在一个线E中使用?o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN"> <o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN">Hibernate会话是一个介于连接和事务之间的概c?FONT color=#ff1493>你可以简单地认ؓ会话是对于一个单独的工作单元已装载对象的~存或集合。Hibernate可以到q个工作单元中对象的改变?/FONT>我们有时也将会话UCؓ持箋性管理器Q因为它也是与持l性有关的操作例如存储和取出对象的接口。注意,Hibernate会话与Web层的HttpSession没有M关系。当我们在本书中使用会话Ӟ我们指的是Hibernate会话。ؓ了区别,有时我们HttpSession对象UCؓ用户会话?o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN"> <o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><B><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Arial; mso-font-kerning: 0pt">SessionFactory</SPAN></B><B><SPAN style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Arial; mso-font-kerning: 0pt">接口</SPAN></B><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN">应用?/SPAN><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 9.5pt; mso-bidi-font-family: Arial; mso-font-kerning: 0pt">SessionFactory</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN; mso-bidi-font-size: 9.5pt; mso-bidi-font-family: Arial; mso-font-kerning: 0pt">Q会话工厂)里获得会话实例。与会话接口相比Q这个对象不够o人兴奋?/SPAN><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN"> <o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN">会话工厂当然不是轻量U的Q它打算在多个应用线E间q行׃n。典型地Q?FONT color=#ff1493>整个应用只有唯一的一个会话工厂——例如在应用初始化时被创建。然而,如果你的应用使用<SPAN lang=EN-US>Hibernate讉K多个数据库,你需要对每一个数据库使用一个会话工厂?o:p></o:p></SPAN></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN"> <o:p></o:p></SPAN></P><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-fareast-language: ZH-CN; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-bidi-language: AR-SA">会话工厂~存了生成的<SPAN lang=EN-US>SQL语句和Hibernate在运行时使用的映元数据。它也保存了在一个工作单元中d的数据ƈ且可能在以后的工作单元中被重用(只有cd集合映射指定了这U二U缓存是惌的时才会如此Q?BR><BR><BR></SPAN></SPAN><img src ="http://m.tkk7.com/jinfeng_wang/aggbug/2869.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jinfeng_wang/" target="_blank">jinfeng_wang</a> 2005-04-05 11:13 <a href="http://m.tkk7.com/jinfeng_wang/archive/2005/04/05/2869.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Best practice for risk-free deploymenthttp://m.tkk7.com/jinfeng_wang/archive/2005/03/30/2600.htmljinfeng_wangjinfeng_wangWed, 30 Mar 2005 02:35:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2005/03/30/2600.htmlhttp://m.tkk7.com/jinfeng_wang/comments/2600.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2005/03/30/2600.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/2600.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/2600.htmlOverview

The cost impact to a company of a failed project can be severe indeed. The impact on the reputation of the project manager can be disastrous.

Software project management is not easy, and it requires considerable skill to successfully manage the many different risks that conspire to de-rail a project:

Numerous methodologies are available for mitigating these risks ?PRINCE2, RUP, DSDN, eXtreme programming ?and these have helped to some extent.

This document introduces the 3D?methodology ?a set of best practices and quality tools developed by BuildMonkey, which can be summarised as.

De-risk. Deploy. Deliver.

In any software project, deployment is a milestone on the project plan that is usually associated with payment ?or staged payment. Through the course of development, any number of problems can arise to derail efforts to reach this milestone.

The 3D?methodology and supporting toolset is based on many years of experience at the sharp end of projects, understanding what has worked and what has not, and the lessons learned from each.

Competent practitioners, and experienced project staff, will find resonance with many of the contents of this document and may find themselves saying ?EM>this is just common sense? This is certainly true, but the main problem with common sense is that it is not as common as people think it is.

This document, and the 3D?methodology, is an attempt to bring that common sense together in a single location, as a coherent set of best practices supported by proven tools to help you to release on-time, on-budget, with no defects.

The Problem To Be Solved

No methodology has yet focused on the component that all development projects share ?the build.

One of the reasons for this is that the term “build?is interpreted differently by different people:

  • The development team sees it as compilation and assembly;
  • The integration team see it as the bringing together of all of the components in the application in a format suitable for release;
  • The deployment team see it as something which produces the artifacts that they have to install and configure;
  • The testing team see it as something which produces the artifacts that they have to test;
  • The Project Manager sees it as an opaque step that nobody is entirely responsible for;;
  • The end customer should not see it at all;

The BuildMonkey view is that the build is the combination of processes and technology that take software from design to deployment ?_where the return on investment starts to be seen.

It is clear that a methodology is required to de-risk development projects and to standardise use of the term “Build Management?

Best Practice: ?EM>Build Management?encompasses everything from compilation, all the way through to release to the customer.

No Release, No Revenue

Any Finance Director knows that development is just an activity that needs to be tolerated in order to produce something that will deliver a return on investment.

It may sound strange, but a large number of software developers do not appreciate and embrace this basic truth. This is in part due to their closeness to the application being constructed.

A common problem faced by development projects is therefore that it is the software developers who manage the build. This creates a situation where the build is focused on the needs of development, and is not geared towards releasing the output of coding such that business value can be realised.

Build Management should therefore focus on the end result of development ?a return on investment ?and ensure that all of the inputs to the process are incorporated in pursuit of this goal:

Best Practice: Focus on the end, and accommodate the inputs

Software Tools Are Only Part of the Answer

Software projects are a complex set of interdependent people and teams and can be likened to a convoy of ships. A convoy has to move at the rate of the slowest ship. Increasing the speed of a single ship in the convoy will not increase the speed of the convoy ?it will simply increase the amount of wasted capacity in the speeded-up ship.

Speeding up the slowest ship will, however, have a positive effect since the whole convoy can now move faster.

Many Project Managers try to improve productivity by implementing some degree of automation in development projects ?particularly in the area of the build ?and often purchase ?EM>magic bullet?build software that provides this.

Simply using automated build software does not improve productivity any more than the example above improves convoy speed - as it only increases the speed of a single ship in the convoy.

There is no point in speeding up development, if the target production infrastructure cannot keep pace ?this just increases the inefficiency. A lot of organisations make this mistake ?highly agile development processes trying to feed into considerably less agile deployment processes. The result is inefficiency, waste and over-run.

Before considering using an automated build tool it is essential to ensure that the inputs to, and outputs from, the build can cope with the improved build speed. It is imperative to ensure that the processes and technology employed are geared towards taking the project to a successful conclusion ?on-time and on-budget.

Best Practice: Don’t rely on software tools alone, they may solve symptoms whilst creating problems elsewhere

Configuration Management Best Practices

Software Configuration Management (SCM) is a relatively mature discipline with much written about methodologies and techniques, and these will not be recreated here.

We will focus instead on leveraging the SCM repository, and the facilities that it offers, to further the goals of the project rather than to consider SCM in its own right.

It All Starts Here

The SCM repository - how it is managed and used ?is the keystone of good build management and successful delivery of projects.

The SCM repository is the slave of the project, not the other way round. It should be solid and reliable, yet flexible enough to accommodate the needs of new projects. Project Managers should not have to retrofit their planning to accommodate an inflexible SCM setup.

If used correctly, the SCM repository will enhance productivity, and minimize risk, through being able to provide exactly what the project ?and project management ?require. If used incorrectly, it can cause delay and slippage through having to do things inefficiently further down the chain.

Best Practice: The SCM repository is the slave of the project, not the other way round.

Configuration Management is not Version Control

Most software developers regard the SCM repository as a massive storage area where they simply check versions in and out ?a common cause of problems.

Simply checking things into an SCM repository is not Configuration Management any more than karaoke is opera.

A well-maintained SCM repository is so much more than version control, and should provide:

  • The ability to recreate any identified baseline, at any time;
  • Meaningful statistics on what is changing, when and by whom;
  • Management information, such as ?EM>how many new defects were introduced by the refactoring of component ‘X??

In order to be truly effective in a project, the SCM repository should store all of the artifacts that form part of a baseline or a release.

Source Code

Most development projects simply store the code that is being developed and their use of the SCM repository is no more sophisticated than this.

Data

Most applications nowadays are not just source code. Take the example of a modern computer game ?the vast majority of the code base is made up of artifacts other than code such as audio clips, pictures and movie clips.

Database Structure and Contents

Where an application relies on a database this database will have a schema and structure that may change from release to release ?this schema must be captured.

There will normally also be seed data for the database which should be considered as part of the baseline.

Application Configuration

In a large distributed application, the software being developed will sit atop a number of pieces of software (e.g. application servers, web servers and message queues).

The configuration of these underlying applications have an effect on the quality ?or otherwise ?of the software being developed and should, therefore, be considered part of the baseline for a release.

Environment Configuration

The underlying environment and infrastructure is a key component of the project, particularly in the case of distributed applications.

Such banal considerations as DNS zone files, user account information and system parameters have to be considered as some of the moving parts which affect the application and therefore be placed under configuration control.

This is of particular importance when there is more than one environment involved in the project (e.g. a development environment and a separate test environment) since the question of ?EM>are these environments the same??crops up again and again.

Best Practice: Everything that can be changed, and affect the behaviour of the application, is a candidate for configuration control

The Point of Labelling

It is a common misconception that simply applying labels, or tags, to the SCM repository creates a baseline but this is only partly true without corresponding records of:

  • What label has been applied;
  • When that label has been applied;
  • Why it has been applied (i.e. what milestone, or other external event, the label is associated with);

The use of a naming convention for labels can deceive even further. For example, a project that uses a date-based labeling convention (dd_mm_yyyy) will have several labels of the form (03_05_2004, or 09_06_2004) and will reasonably assume that they have some kind of record of the baseline on those dates.

But what was happening in the project on those dates? Was the 03_05_2004 label applied immediately before a release to test, or immediately after?

Best Practice: Labels should be used to identify and inform about events in the project

Don’t Label If There Is No Point

This may seem like stating the obvious, but there should be a reason for a label being applied ?the whole purpose of labeling is to identify some event in the development cycle that may need to be re-visited.

To this end, labels can be divided into two categories:

  • Point-in-time
    Associates particular versions with a particular calendar date, or other event that is fixed in time (e.g. MONTH_END_JAN_2004, or RELEASE_1_0_1);
  • Point-in-process
    Associates particular versions with events in the project that may recur at a later stage (e.g. LATEST_RELEASE, or CURRENTLY_IN_UAT);

Best Practice: Every label should have a point, whether point-in-time or point-in-process

Management Information

The job of the Project Manager, ultimately, is to bring the project to a successful conclusion. If this were an easy task that happened by default, then there would be no need for a Project Manager.

In order to be able to do this job well, a Project Manager needs information. He needs to know what is going on in the project ?who is doing what, who is working on which components, and a wealth of information can be obtained from a well-managed SCM repository:

  • What is changing in the environment ?what has changed since a given point in time or how often particular elements are changing;
  • Who is changing things in the environment;
  • Why things are changing in the environment;

Of course, the final item in the list requires that committers are using descriptive comments to indicate why they are marking a particular change. A well-managed SCM repository should enforce this.

Best Practice: The SCM repository should provide meaningful, and accessible, management information

Build Best Practices

As explained at the beginning of this document, the term “build?means different things to different people. The most common interpretation is the one used by developers, where the term “build?describes the compilation and assembly step of their development activities but this narrow interpretation is a common cause of problems and over-runs, on development projects.

Building is not Compiling

At the outset of the project, the Project Manager will ask the question ?EM>how long to set up the build??and a developer ?thinking of compilation and assembly ?will answer something like ?EM>1 day?/EM> ?a task and duration which is then duly marked on the project plan and development begins.

Later in the project, when it is time to start deploying and testing the application, this “build?needs to be refactored to accommodate the deployment and test tasks. In doing so, it turns out that the way the application is being assembled is not conducive to it being deployed or tested correctly ?so the compilation and assembly staged need to be refactored as well.

In the meantime, the development team sits on its hands whilst the “build?is refactored to accommodate the needs of the project ?valuable time is lost whilst the deadline continues to advance.

Best Practice: Know what will be required of the build before starting to write the scripts

Don’t Throw Out The Baby With The Bathwater

From a build perspective, projects with similar architecture (both in terms of the team and the application) will have similar attributes. There will obviously be some changes required, but these will tend to follow the 80/20 rule to a large degree.

For example, a web application that is being developed by an in-house team and that will be deployed to a Tomcat servlet container and Oracle database will follow largely the same steps and require largely the same deployable artifacts.

A good SCM repository will enable the latest versions of boiler-plate build scripts for such an application to be found. These can be used almost off-the-shelf ?meaning that development can start apace without having to wait on the build to be constructed for similar applications .

Best Practice: Well-crafted builds are re-usable and should be re-used

The Architecture Drives The Build<

Following on from the previous section, it should be clear that the architecture of what is being developed ?and the structure of the team(s) developing it ?will dictate how the build should look.

There is little value to be gained in trying to retrofit build scripts for a computer game (developed by 12 people all in the same room) into a project to produce a large J2EE application with development occurring at six different sites around the world.

Best Practice: Well-crafted builds are flexible, but a “one-size-fits-all?approach can be costly

Management Information

There are a number of people who need information that the build can provide:

  • The Project Manager needs to track overall progress against defined milestones ?number of outstanding defects, whether a committed release date will be met etc;
  • Development leads need to be sure that the code is of the quality that they require ?test reports, bug analysis patterns, code metrics, document and UML generation etc;
  • The deployment team need to know that the artifacts will work in their target environment, and that the environment is as the application expects it to be. They also need to know whether two (or more) environments are ?EM>the same?
  • The test team need to have confidence that they are testing against a known baseline, and whether defects that they see have been rectified in development (or whether they are re-appearing after already being fixed);
  • Everybody needs to be able to communicate effectively using the same language, and have a common terminology for release versions ?particularly if there are multiple threads of development;

A good build infrastructure will provide all of the above information, and more besides.

Best Practice: The build should tell all project participants what they need to know

Deployment Best Practices

Considering that it is generally an important milestone on a project plan, normally resulting in payment or a staged payment, deployment is one of the most overlooked areas of software development.

The normal course of events is:

  1. Release artifacts are created;
  2. Some installation and release notes are cobbled together in the form of a README;
  3. The deployment team work frantically to install and configure the application ?the testing team (or, worse still, the customer) are idle and unproductive in the meantime;
  4. Some symptoms are found which are suspected to be application defects;
  5. The development team blame the environment;
  6. The deployment team blame the application;
  7. Repeat (5) and (6) ad nauseam.

When a documentation team are also considered - responsible for creating documentation that the end user will need to install, configure and use the application ?the situation becomes even more difficult.

This situation can be avoided by planning for deployment from the beginning. Deployment is an inevitable part of software development, yet it always seems to take people by surprise.

Best Practice: Know that deployment is inevitable, and incorporate it into the automated processes

Deployment Is Not Installation

As part of normal development activities, artifacts are installed into sandbox environments ?and test environments ?many times. But this is not deployment, this is installation.

In order to get an application into its production environment, be that an internal environment or on hosted-infrastructure, a number of hurdles must be overcome:

  • The application must pass UAT;
  • The application must be installed and configured correctly:
  • All pre-requisites for the application must be satisfied;
  • The end customer must accept the handover;

Deployment is that point in the life of an application where it starts to produce a return on investment. ?EM>Launch? ?EM>Go-live? ?EM>Release? ?EM>First Customer Shipment?are all phrases which describe the same event.

Best Practice: Deployment is the point where an application starts to provide a return on the development investment.

The Environment Is a Refactorable Component

This point cannot be stressed enough, particularly in large distributed applications.

Every application, large or small, has a runtime environment in which it operates. In a simple desktop application, this is a standalone machine (such as a PC). In larger applications, this will be a combination of machines (e.g. an application server and a database) operating together to provide the runtime environment.

In either case, the application expects certain facilities to be available from the runtime environment and will function incorrectly ?or cease to function ?if these are not present .

The environment itself, whether standalone or a network, contains many moving parts that can be independently configured. IP addresses, or hostnames, can be changed. User privileges can be modified or revoked. Files and directories can be removed. Each of these can have an effect on the way that the application behaves.

In an environment that is owned and managed internally this can be bad enough. In an environment that is owned and managed by an external third party, and where project success is contingent upon successful UAT in that environment, this can be disastrous.

Best Practice: Be able to identify whether the deployment environment is as prescribed, and ?EM>fit for deployment?/P>Environment Verification Testing

One of the most common questions that arises in development projects containing more than one environment is, simply, ?EM>are these environments the same??and its answer can be elusive.

It is essential to be able to answer that question ?quickly and accurately ?so that any perceived defects in the application can be categorised as ?EM>defect?or ?EM>environmental?

This ability becomes particularly poignant where on or more of the environments are owned by different teams, or organisations.

Best Practice: Be able to prescribe what the deployment environment should look like, and have a capability to test it quickly.

Regression Testing

The environment, as explained earlier, is a refactorable component. It can be changed, and parts can be moved or deleted. However, unlike application code, changes may need to be made to the environment in response to external events (e.g. hardware failure, or security policies).

Applications, particularly complex ones, use regression tests to ensure that observed behaviour after a change is exactly as it was before the change was made. The same should be true of the environment.

Best Practice: Automated regression tests for the environment that will compare observed behaviour both before and after changes are made.

For example, suppose that a number of operating system patches or service packs are applied to an environment where the application has been, or will be, deployed. How are these tested? Do you wait for users, or testers, to start calling to say that there are problems?

Or do you make sure that you know what problems have been introduced before your users do?

Configuration Management

As stated earlier, the SCM repository should be used to store any artifact that can be changed and that may have an effect on the environment.

It may not seem obvious, but some of the most obscure environmental changes can cause an application to fail:

  • Hostname resolution;
  • Non-existent user or group accounts;
  • IP and network connectivity;
  • Existence, or otherwise, of files and directories ;
  • Application or operating system configuration files;

It is essential that these environmental variables be placed under configuration control and able to be identified as part of a baseline.

Best Practice: Environmental artifacts that are not part of the application should be part of the baseline

Automate, Automate, Automate

Every single task that is performed as part of a development project ?throughout the entire lifecycle ?can be placed into one of two categories:

  1. Tasks which require some form of human judgment;
  2. Tasks which do not;

Tasks which fall into the first category can use some degree of automation, but should stop and wait for human intervention wherever judgment is required.

Tasks in the second category should be automated. There is no value in having expensive resources employed to do mechanical or repetitive tasks that a computer could do more quickly, accurately and consistently.

Best Practice: Automate anything that does not require human judgment

A note of caution - it may be tempting to think that automation will increase productivity on its own, but this is not necessarily the case. Automating an inefficient process will simply magnify its inefficiency ?as explained in the section on Software Tools are Only Part of the Answer.

This, and it is worth repeating, is a common error ?to assume that automated build software alone will improve productivity.

Best Practice: Do not automate inefficient processes, or you will only maximize the inefficiency

About BuildMonkey

BuildMonkey is a division of Nemean Technology Limited - a leading technical innovator specialising in Agile Deployment and build management.

We have over a decade of experience in helping clients increase productivity in their build, integration and test cycles. We have a track record of massively reducing costs and defects through process automation and proven methodologies.

Formed in 1999, and profitable every quarter, we invented the discipline of BuildMaster - we are the original and the best.

We provide specialist Build Management products and services - when all you do is Build Management, you get pretty good at Build Management. Our world-class Professional Services staff are the best in their field, complemented by original software products of the finest quality.

We aim to be the leading provider of Build Management products and services in the UK by providing excellent service to our customers, and by empowering Software Project Managers to aim for release on-time, on-budget, with no defects.



jinfeng_wang 2005-03-30 10:35 发表评论
]]>
TSS 2005 Java Symposium votion(zz)http://m.tkk7.com/jinfeng_wang/archive/2005/03/22/2307.htmljinfeng_wangjinfeng_wangTue, 22 Mar 2005 00:36:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2005/03/22/2307.htmlhttp://m.tkk7.com/jinfeng_wang/comments/2307.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2005/03/22/2307.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/2307.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/2307.html

http://www.theserverside.com/articles/article.tss?l=TSSJS2005

Attendee Opinions

Every morning at the Symposium we asked the audience a set of questions (submitted by the attendees) about their opinions of things, using a live hand-held survey technology that would then spit the results up onto a powerpoint slide. What followed was a fascinating look at the perspectives of the Java developers in attendance:

Should Java be open sourced?     Yes 58.6% No 41.4% Vote count: 239 How does your organization treat open source software?     No policy. Do what you want 31.8% Use it if a senior team member can approve it 23.4% Mgt or higher has to approve its use 16.9% Formal review process including legal dept. approval 22.9% What is open source? We buy everything 5.0% Vote count: 201     What is the biggest challenge in designing web applications?     Application maintainability 34.3% Ease of development 27.1% Fit with existing architecture 18.1% The ability to leverage existing developers' skills 9.5% Code re-use 11.0% Vote count: 210     What does "RIA" Stand for?     Really Interesting Architecture 1.4% Rich Internet Application 63.3% Rolling in Acronyms 11.4% All of the above 23.8% Vote count: 210     What is your preferred Java IDE?     Eclipse 53.3% emacs 2.1% IDEA 19.8% Java Studio 0.8% JBuilder 6.6% JDeveloper 3.3% Netbeans 2.5% vim 3.3% WSAD 7.4% other 0.8% Vote count: 242     What is your preferred Web framework     Struts 47.0% Spring 20.9% Tapestry 7.9% Webwork 8.8% Other 15.3% Vote count: 215

jinfeng_wang 2005-03-22 08:36 发表评论
]]>
使用PippoProxy替代Apache-TomcatQ提高Tomcat的静态内容的性能Q{载)http://m.tkk7.com/jinfeng_wang/archive/2005/03/06/1767.htmljinfeng_wangjinfeng_wangSun, 06 Mar 2005 06:38:00 GMThttp://m.tkk7.com/jinfeng_wang/archive/2005/03/06/1767.htmlhttp://m.tkk7.com/jinfeng_wang/comments/1767.htmlhttp://m.tkk7.com/jinfeng_wang/archive/2005/03/06/1767.html#Feedback0http://m.tkk7.com/jinfeng_wang/comments/commentRss/1767.htmlhttp://m.tkk7.com/jinfeng_wang/services/trackbacks/1767.html阅读全文

jinfeng_wang 2005-03-06 14:38 发表评论
]]>
վ֩ģ壺 պٸѲ| hƵѹۿ| ߹ۿ˳վҹ| ޹ۺϾƷĻ| avҹƷר| һ| ڵɫƵƵ| ޾ƷŮ| ɫѹۿ| ؼƬѿ| һ| պƷרҹ| ֻˬһëƬѹۿ| mvƷmvձmv| ձ߿Ƭ| Ʒ޾Ʒպѷ| ŷ޹SUV| һƵ߹ۿİ| ҹ717| ӰӴȫ߲| Ʒþ޾þþþûʿ | av벻һ| ŮֻѵƵ| 18ڵվ| ŷ͵ҹɫ| þþþþAVվ | avרߵӰ| 1000ƬƵѿ| þùƷһ| ƷƵ| ĻƵ| avһ | ޺Ʒһ | Ƶרһ| þۺͼۺͼ| йѹۿ߹ۿ | þav޾Ʒɫҹ| ҹ18ѿ| һŷ| ˾Ʒҹapp | Ʒ޳a߹ۿ|