我正在使用mod_auth_kerb和Apache HTTPD来针对Kerberos服务器对网站用户进行身份验证.我在Apache错误日志中收到一条奇怪的错误消息.(请注意,出于安全原因,我已在本帖中更改了主体,但格式保持不变).打开Apache的调试级别输出允许我获取更多信息性日志:
[debug] src/mod_auth_kerb.c(1932): [client x.x.x.x] kerb_authenticate_user entered with user (NULL) and auth_type Kerberos
[debug] src/mod_auth_kerb.c(1277): [client x.x.x.x] Acquiring creds for HTTP/kerberos_server.example.com@REALM.EXAMPLE.COM
[debug] src/mod_auth_kerb.c(1470): [client x.x.x.x] Credentials cache FILE:/tmp/krb5cc_48 not found, create one
[error] [client x.x.x.x] Could not parse principal HTTP/kerberos_server.example.com@REALM.EXAMPLE.COM/server_hostname: Malformed representation of principal (-1765328250)
[debug] src/mod_auth_kerb.c(1598): [client x.x.x.x] Failed to obtain credentials for s4u2proxy
[debug] src/mod_auth_kerb.c(1137): [client x.x.x.x] GSS-API major_status:000d0000, minor_status:0000000d
[error] [client x.x.x.x] gss_acquire_cred() failed: Unspecified GSS failure. Minor code may provide more information (, Permission denied) …Run Code Online (Sandbox Code Playgroud) 我很好奇这段代码在C++ 0x中是否合法.具体来说,函数中声明的对象move_it()是否会正确地移动到声明的对象main()?
#include <iostream>
#include <string>
#include <tr1/memory>
using namespace std;
class x
{
public:
x() { cout << "create " << this << endl; }
~x() { cout << "destroy " << this << endl; }
};
x&& move_it()
{
x r;
return move(r);
}
int main()
{
x n = move_it();
return 0;
}
Run Code Online (Sandbox Code Playgroud) 我尝试在这个简单的测试应用程序中使用boost deadline_timer,但遇到了一些麻烦.目标是定时器使用expires_at()成员函数每45毫秒触发一次deadline_timer.(我需要一个绝对的时间,所以我不考虑expires_from_now().我现在也不关心漂移).当我运行程序时,wait()不等待45毫秒!然而,没有报告错误.我是否以某种方式错误地使用了库?
示例程序:
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <iostream>
using namespace std;
int main()
{
boost::asio::io_service Service;
boost::shared_ptr<boost::thread> Thread;
boost::asio::io_service::work RunForever(Service);
Thread = boost::shared_ptr<boost::thread>(new boost::thread(boost::bind(&boost::asio::io_service::run, &Service)));
boost::shared_ptr<boost::asio::deadline_timer> Timer(new boost::asio::deadline_timer(Service));
while(1)
{
boost::posix_time::time_duration Duration;
Duration = boost::posix_time::microseconds(45000);
boost::posix_time::ptime Start = boost::posix_time::microsec_clock::local_time();
boost::posix_time::ptime Deadline = Start + Duration;
boost::system::error_code Error;
size_t Result = Timer->expires_at(Deadline, Error);
cout << Result << ' ' << Error << ' ';
Timer->wait(Error);
cout << Error …Run Code Online (Sandbox Code Playgroud) 我正在尝试将 Boost 用于某些 IPv6 和多播网络通信。我需要构造一个使用特定网络接口索引的 IPv6 多播套接字。
我能够在 boost/asio/ip/detail/socket_option.hpp 中找到正确的多播选项来设置网络接口索引:explicit multicast_request(const boost::asio::ip::address_v6& multicast_address, unsigned long network_interface = 0)
问题是,我不知道如何找到“network_interface”参数的正确值。有没有办法使用我可以提供的本地 IPv6 地址获取 network_interface 值?我查看了文档和示例,但找不到任何内容。
——迪伦
我一直在使用jsTree并在IE8中遇到问题.所有数据都在树中正确显示,但是当我尝试折叠树的一个分支时,它无法正确显示.也就是说,平滑崩溃动画会发生,但是当数据不应该时,数据再次可见.
相同的代码在Firefox 3.6.27和Chrome 18.0.1025.151上运行良好.知道为什么IE8会有不同的表现吗?
这是网页的代码:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jstree/jquery.jstree.js"></script>
</head>
<body style="margin:0px">
<script type="text/javascript">
$(function() {
$("#equipment_tree")
.jstree({ "plugins" : ["themes","html_data","ui"] });
});
</script>
<div id="equipment_tree" style="width:185px; float:left; height:100%; overflow:auto;">
<ul>
<li class="jstree-open"><a href="#">Root node 1</a>
<ul>
<li><a href="#">Child node 1</a></li>
<li><a href="#">Child node 2</a></li>
<li><a href="#">Child node 3</a></li>
<li><a href="#">Child node 4</a></li>
</ul></li>
<li><a href="#">Root node 2</a></li>
</ul>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
还有一个错误行为的图片:

我有一个Bootstrap警报,我希望宽度适合内容.在Bootstrap文档中,默认情况下显示宽度为100%.在所有屏幕尺寸上使警报完全符合其内容的最有效方法是什么?
<div class="container">
<div class="alert alert-danger">
My short alert message.
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我有一个表单中的按钮(使用jQuery UI设置样式),并使用JavaScript动态更改文本.出于某种原因,更改文本会使按钮大小缩小到不寻常的大小.我该怎么做才能解决这个问题?
这是问题的图片:

boost-asio ×2
c++ ×2
css ×2
javascript ×2
apache ×1
boost ×1
c++11 ×1
html ×1
ipv6 ×1
jquery ×1
jquery-ui ×1
jstree ×1
kerberos ×1
networking ×1
security ×1