小编Sti*_*eur的帖子

GDB没有这样的文件或目录

我正在从OpenSecurityTraining学习这些课程.

我已到达实验室部分,我将在CMU炸弹上训练自己.他们提供了一个x86_64编译的CMU炸弹,你可以在这里找到训练:CMU Bomb x86-64最初来自CMU实验室计算机系统的32位炸弹:程序员视角(CS:APP)第1版.

我有一个虚拟化的64位Elementary OS发行版,在那里我使用GDB解压缩CMU Bomb没有问题.现在,我有一个64位Ubuntu 14.04 LTS(未虚拟化),当我尝试重现我在Elementary OS上的原因时,我得到了一个着名的错误.

我运行这些命令:

gdb ./bomb-x64
(gdb) b main
Breakpoint 1 at 0x400dbd: file bomb.c, line 37. -- why bomb.c ?
(gdb) r
...
bomb.c: no such file or directory
Run Code Online (Sandbox Code Playgroud)

编辑:我可以在CMU炸弹的其他功能上创建断点,它可以按预期工作.
示例:

(gdb) b phase_1
Breakpoint 3 at 0x400f00
(gdb) r

Breakpoint 1, 0x0000000000400f00 in phase_1 ()
(gdb) disas
Dump of assembler code for function phase_1:
=> 0x0000000000400f00 <+0>: sub    $0x8,%rsp
   0x0000000000400f04 <+4>: mov …
Run Code Online (Sandbox Code Playgroud)

c linux debugging assembly gdb

10
推荐指数
2
解决办法
2万
查看次数

处理UserRedirectRequiredException(需要重定向才能获得用户批准)

介绍

一周前,我开始使用OAuth2框架(使用Spring Boot v1.3.0.M4)开发应用程序.对我来说是一次全新的体验.所以我尽量让它变得更简单,以便更好地理解它.我正在使用Spring Security OAuth2,我正面临着正确使用它的困难.

我想做的事

当用户授权我的应用程序时,对用户进行身份验证.实际上,我不希望他在我的申请上注册,这样他就可以自由使用它,而无需填写无聊的表格进行注册.

遇到问题

我找不到处理UserRedirectRequired Exception的方法.因为我没有这样做,所以用户永远不会被重定向到授权页面并抛出异常(并且未处理).


我的应用程序

StandardController.java

package org.test.oauth.web;

import java.security.Principal;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StandardController {

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String getHelloWorld() {
        return "Hello world !";
    }

    @RequestMapping(value = "/user", method = RequestMethod.GET)
    public Principal getUser(Principal principal) {
        return principal;
    }
}
Run Code Online (Sandbox Code Playgroud)

StandardConfiguration.java

package org.test.oauth.configuration;

import java.util.Arrays;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.oauth2.client.OAuth2ClientContext;
import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter;
import …
Run Code Online (Sandbox Code Playgroud)

spring spring-security spring-boot spring-security-oauth2

7
推荐指数
2
解决办法
2万
查看次数

无法在Spring Boot 1.3或1.2.5中设置我的自定义favicon.ico

几天前我开始使用一个全新的项目FreeMarker第一次使用Spring Boot 1.3.但是,我正在努力展示我自己的图标.事实上,它在项目的最初阶段运作良好,但几天前,它没有,我无法找到原因.我已经通过stackoverflow上的三个线程谈论它,但没有解决我的问题.我在谷歌搜索但我找不到任何解决方案.

如何重现

试图摆脱这个问题,我已经开始了一个新项目(这次是Spring 1.2.5),我遇到了同样的问题.使用Spring Tool Suite:新的►SpringStarterProject►然后我勾选了Web和FreeMarker,►完成.

项目准备好后,我在demo.web包中创建了HomeController,其中一个测试函数返回"home".我还在src/main/resources/templates中创建了一个home.ftl,并将两个文件放在src/main/resources/static:demo.pngfavicon.ico中(我也尝试将它放在src/main/resources下).

demo.png正确显示,但不显示favicon.ico.也许我做错了,因为我是网络开发的新手.

HomeController.java

package demo.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class HomeController {

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String get() {
        return "home";
    }
}
Run Code Online (Sandbox Code Playgroud)

home.ftl

<!DOCTYPE html>
<html>
<head>
    <title>Demo</title>
    <link rel="icon" type="image/x-icon" href="/favicon.ico">
</head>
<body>
    <img src="/demo.png" alt=""> …
Run Code Online (Sandbox Code Playgroud)

java favicon spring spring-mvc spring-boot

3
推荐指数
1
解决办法
9341
查看次数