Deleted Added
full compact
login.c (276613) login.c (279006)
1/*-
2 * Copyright (c) 2012 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Edward Tomasz Napierala under sponsorship
6 * from the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 15 unchanged lines hidden (view full) ---

24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2012 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Edward Tomasz Napierala under sponsorship
6 * from the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 15 unchanged lines hidden (view full) ---

24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: stable/10/usr.sbin/ctld/login.c 276613 2015-01-03 13:08:08Z mav $");
32__FBSDID("$FreeBSD: stable/10/usr.sbin/ctld/login.c 279006 2015-02-19 14:52:01Z mav $");
33
34#include <assert.h>
35#include <stdbool.h>
36#include <stdint.h>
37#include <stdio.h>
38#include <stdlib.h>
39#include <string.h>
40#include <unistd.h>

--- 781 unchanged lines hidden (view full) ---

822 assert(conn->conn_target == NULL);
823 if (conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) {
824 target_name = keys_find(request_keys, "TargetName");
825 if (target_name == NULL) {
826 login_send_error(request, 0x02, 0x07);
827 log_errx(1, "received Login PDU without TargetName");
828 }
829
33
34#include <assert.h>
35#include <stdbool.h>
36#include <stdint.h>
37#include <stdio.h>
38#include <stdlib.h>
39#include <string.h>
40#include <unistd.h>

--- 781 unchanged lines hidden (view full) ---

822 assert(conn->conn_target == NULL);
823 if (conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) {
824 target_name = keys_find(request_keys, "TargetName");
825 if (target_name == NULL) {
826 login_send_error(request, 0x02, 0x07);
827 log_errx(1, "received Login PDU without TargetName");
828 }
829
830 conn->conn_target = target_find(pg->pg_conf, target_name);
831 if (conn->conn_target == NULL) {
830 conn->conn_port = port_find_in_pg(pg, target_name);
831 if (conn->conn_port == NULL) {
832 login_send_error(request, 0x02, 0x03);
833 log_errx(1, "requested target \"%s\" not found",
834 target_name);
835 }
832 login_send_error(request, 0x02, 0x03);
833 log_errx(1, "requested target \"%s\" not found",
834 target_name);
835 }
836 conn->conn_target = conn->conn_port->p_target;
836 }
837
838 /*
839 * At this point we know what kind of authentication we need.
840 */
841 if (conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) {
837 }
838
839 /*
840 * At this point we know what kind of authentication we need.
841 */
842 if (conn->conn_session_type == CONN_SESSION_TYPE_NORMAL) {
842 ag = conn->conn_target->t_auth_group;
843 ag = conn->conn_port->p_auth_group;
844 if (ag == NULL)
845 ag = conn->conn_target->t_auth_group;
843 if (ag->ag_name != NULL) {
844 log_debugx("initiator requests to connect "
845 "to target \"%s\"; auth-group \"%s\"",
846 conn->conn_target->t_name,
847 ag->ag_name);
848 } else {
849 log_debugx("initiator requests to connect "
850 "to target \"%s\"", conn->conn_target->t_name);

--- 140 unchanged lines hidden ---
846 if (ag->ag_name != NULL) {
847 log_debugx("initiator requests to connect "
848 "to target \"%s\"; auth-group \"%s\"",
849 conn->conn_target->t_name,
850 ag->ag_name);
851 } else {
852 log_debugx("initiator requests to connect "
853 "to target \"%s\"", conn->conn_target->t_name);

--- 140 unchanged lines hidden ---