login.c (d899be7d43d8df9cb485af5705e2724165a461c7) | login.c (92847ee1f364687be3ec9aed6e1837e0b3c349f5) |
---|---|
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 --- 813 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 | 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 --- 813 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 --- |