Changeset 988 for vendor/current/source3/nmbd
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/source3/nmbd
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/nmbd/asyncdns.c
r740 r988 3 3 a async DNS handler 4 4 Copyright (C) Andrew Tridgell 1997-1998 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 3 of the License, or 9 9 (at your option) any later version. 10 10 11 11 This program is distributed in the hope that it will be useful, 12 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 GNU General Public License for more details. 15 15 16 16 You should have received a copy of the GNU General Public License 17 17 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 20 20 #include "includes.h" 21 21 #include "nmbd/nmbd.h" 22 #include "lib/util/sys_rw_data.h" 22 23 23 24 /*************************************************************************** … … 31 32 32 33 pull_ascii_nstring(qname, sizeof(qname), question->name); 33 34 34 35 if (!addr.s_addr) { 35 36 /* add the fail to WINS cache of names. give it 1 hour in the cache */ … … 91 92 NTSTATUS status; 92 93 93 status = read_data (fd_in, (char *)&r, sizeof(r));94 status = read_data_ntstatus(fd_in, (char *)&r, sizeof(r)); 94 95 95 96 if (!NT_STATUS_IS_OK(status)) { … … 136 137 create a child process to handle DNS lookups 137 138 ****************************************************************************/ 138 void start_async_dns( void)139 void start_async_dns(struct messaging_context *msg) 139 140 { 140 141 int fd1[2], fd2[2]; … … 148 149 } 149 150 150 child_pid = sys_fork();151 child_pid = fork(); 151 152 152 153 if (child_pid) { … … 167 168 CatchSignal(SIGTERM, sig_term); 168 169 169 status = reinit_after_fork(nmbd_messaging_context(), 170 nmbd_event_context(), 171 procid_self(), true); 170 status = reinit_after_fork(msg, nmbd_event_context(), true, NULL); 172 171 173 172 if (!NT_STATUS_IS_OK(status)) { … … 206 205 check the DNS queue 207 206 ****************************************************************************/ 208 void run_dns_queue( void)207 void run_dns_queue(struct messaging_context *msg) 209 208 { 210 209 struct query_record r; … … 219 218 close(fd_in); 220 219 close(fd_out); 221 start_async_dns( );222 } 223 224 status = read_data (fd_in, (char *)&r, sizeof(r));220 start_async_dns(msg); 221 } 222 223 status = read_data_ntstatus(fd_in, (char *)&r, sizeof(r)); 225 224 226 225 if (!NT_STATUS_IS_OK(status)) { -
vendor/current/source3/nmbd/nmbd.c
r746 r988 26 26 #include "serverid.h" 27 27 #include "messages.h" 28 #include "../lib/util/pidfile.h" 29 #include "util_cluster.h" 28 30 29 31 int ClientNMB = -1; … … 43 45 time_t StartupTime = 0; 44 46 45 struct event_context *nmbd_event_context(void)47 struct tevent_context *nmbd_event_context(void) 46 48 { 47 49 return server_event_context(); 48 }49 50 struct messaging_context *nmbd_messaging_context(void)51 {52 struct messaging_context *msg_ctx = server_messaging_context();53 if (likely(msg_ctx != NULL)) {54 return msg_ctx;55 }56 smb_panic("Could not init nmbd's messaging context.\n");57 return NULL;58 50 } 59 51 … … 62 54 **************************************************************************** */ 63 55 64 static void terminate( void)56 static void terminate(struct messaging_context *msg) 65 57 { 66 58 DEBUG(0,("Got SIGTERM: going down...\n")); 67 59 68 60 /* Write out wins.dat file if samba is a WINS server */ 69 61 wins_write_database(0,False); 70 62 71 63 /* Remove all SELF registered names from WINS */ 72 64 release_wins_names(); 73 65 74 66 /* Announce all server entries as 0 time-to-live, 0 type. */ 75 67 announce_my_servers_removed(); … … 79 71 80 72 gencache_stabilize(); 81 serverid_deregister( procid_self());82 83 pidfile_unlink( );73 serverid_deregister(messaging_server_id(msg)); 74 75 pidfile_unlink(lp_pid_directory(), "nmbd"); 84 76 85 77 exit(0); … … 93 85 void *private_data) 94 86 { 95 terminate(); 96 } 97 98 static bool nmbd_setup_sig_term_handler(void) 87 struct messaging_context *msg = talloc_get_type_abort( 88 private_data, struct messaging_context); 89 90 terminate(msg); 91 } 92 93 /* 94 handle stdin becoming readable when we are in --foreground mode 95 */ 96 static void nmbd_stdin_handler(struct tevent_context *ev, 97 struct tevent_fd *fde, 98 uint16_t flags, 99 void *private_data) 100 { 101 char c; 102 if (read(0, &c, 1) != 1) { 103 struct messaging_context *msg = talloc_get_type_abort( 104 private_data, struct messaging_context); 105 106 DEBUG(0,("EOF on stdin\n")); 107 terminate(msg); 108 } 109 } 110 111 static bool nmbd_setup_sig_term_handler(struct messaging_context *msg) 99 112 { 100 113 struct tevent_signal *se; … … 104 117 SIGTERM, 0, 105 118 nmbd_sig_term_handler, 106 NULL);119 msg); 107 120 if (!se) { 108 121 DEBUG(0,("failed to setup SIGTERM handler")); 109 122 return false; 123 } 124 125 return true; 126 } 127 128 static bool nmbd_setup_stdin_handler(struct messaging_context *msg, bool foreground) 129 { 130 if (foreground) { 131 /* if we are running in the foreground then look for 132 EOF on stdin, and exit if it happens. This allows 133 us to die if the parent process dies 134 Only do this on a pipe or socket, no other device. 135 */ 136 struct stat st; 137 if (fstat(0, &st) != 0) { 138 return false; 139 } 140 if (S_ISFIFO(st.st_mode) || S_ISSOCK(st.st_mode)) { 141 tevent_add_fd(nmbd_event_context(), 142 nmbd_event_context(), 143 0, 144 TEVENT_FD_READ, 145 nmbd_stdin_handler, 146 msg); 147 } 110 148 } 111 149 … … 126 164 void *private_data) 127 165 { 166 struct messaging_context *msg = talloc_get_type_abort( 167 private_data, struct messaging_context); 168 128 169 DEBUG(0,("Got SIGHUP dumping debug info.\n")); 129 msg_reload_nmbd_services(nmbd_messaging_context(), 130 NULL, MSG_SMB_CONF_UPDATED, 131 procid_self(), NULL); 132 } 133 134 static bool nmbd_setup_sig_hup_handler(void) 170 msg_reload_nmbd_services(msg, NULL, MSG_SMB_CONF_UPDATED, 171 messaging_server_id(msg), NULL); 172 } 173 174 static bool nmbd_setup_sig_hup_handler(struct messaging_context *msg) 135 175 { 136 176 struct tevent_signal *se; … … 140 180 SIGHUP, 0, 141 181 nmbd_sig_hup_handler, 142 NULL);182 msg); 143 183 if (!se) { 144 184 DEBUG(0,("failed to setup SIGHUP handler")); … … 159 199 DATA_BLOB *data) 160 200 { 161 terminate(); 162 } 163 164 /**************************************************************************** ** 165 Possibly continue after a fault. 166 **************************************************************************** */ 167 168 static void fault_continue(void) 169 { 170 dump_core(); 201 terminate(msg); 171 202 } 172 203 … … 178 209 { 179 210 static time_t lastrun = 0; 180 211 181 212 if ( !lastrun ) 182 213 lastrun = t; … … 250 281 } 251 282 252 ip = (( struct sockaddr_in *)(void *)&iface->ip)->sin_addr;253 nmask = (( struct sockaddr_in *)(void *)283 ip = ((const struct sockaddr_in *)(const void *)&iface->ip)->sin_addr; 284 nmask = ((const struct sockaddr_in *)(const void *) 254 285 &iface->netmask)->sin_addr; 255 286 … … 260 291 */ 261 292 262 if (is_loopback_addr(( struct sockaddr *)(void *)&iface->ip)) {293 if (is_loopback_addr((const struct sockaddr *)(const void *)&iface->ip)) { 263 294 DEBUG(2,("reload_interfaces: Ignoring loopback " 264 295 "interface %s\n", … … 366 397 367 398 if ( lp_loaded() ) { 368 char *fname = lp_ configfile();399 char *fname = lp_next_configfile(talloc_tos()); 369 400 if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) { 370 401 set_dyn_CONFIGFILE(fname); … … 377 408 return(True); 378 409 379 ret = lp_load (get_dyn_CONFIGFILE(), True , False, False, True);410 ret = lp_load_global(get_dyn_CONFIGFILE()); 380 411 381 412 /* perhaps the config filename is now set */ … … 384 415 reload_nmbd_services( True ); 385 416 } 417 418 reopen_logs(); 386 419 387 420 return(ret); … … 470 503 **************************************************************************** */ 471 504 472 static void process( void)505 static void process(struct messaging_context *msg) 473 506 { 474 507 bool run_election; … … 491 524 */ 492 525 493 if (listen_for_packets(run_election)) {526 if (listen_for_packets(msg, run_election)) { 494 527 TALLOC_FREE(frame); 495 528 return; … … 675 708 { 676 709 struct sockaddr_storage ss; 677 const char *sock_addr = lp_ socket_address();710 const char *sock_addr = lp_nbt_client_socket_address(); 678 711 679 712 /* … … 741 774 int main(int argc, const char *argv[]) 742 775 { 743 static bool is_daemon;744 static bool opt_interactive;745 staticbool Fork = true;746 static bool no_process_group;747 static bool log_stdout;776 bool is_daemon = false; 777 bool opt_interactive = false; 778 bool Fork = true; 779 bool no_process_group = false; 780 bool log_stdout = false; 748 781 poptContext pc; 749 782 char *p_lmhosts = NULL; 750 783 int opt; 784 struct messaging_context *msg; 751 785 enum { 752 786 OPT_DAEMON = 1000, … … 770 804 TALLOC_CTX *frame; 771 805 NTSTATUS status; 806 bool ok; 772 807 773 808 /* … … 777 812 frame = talloc_stackframe(); 778 813 779 load_case_tables(); 814 /* 815 * We want total control over the permissions on created files, 816 * so set our umask to 0. 817 */ 818 umask(0); 819 820 setup_logging(argv[0], DEBUG_DEFAULT_STDOUT); 821 822 smb_init_locale(); 780 823 781 824 global_nmb_port = NMB_PORT; … … 809 852 810 853 global_in_nmbd = true; 811 854 812 855 StartupTime = time(NULL); 813 814 sys_srandom(time(NULL) ^ sys_getpid());815 856 857 sys_srandom(time(NULL) ^ getpid()); 858 816 859 if (!override_logfile) { 817 860 char *lfile = NULL; … … 822 865 SAFE_FREE(lfile); 823 866 } 824 825 fault_setup( (void (*)(void *))fault_continue);826 dump_core_setup("nmbd" );827 867 868 fault_setup(); 869 dump_core_setup("nmbd", lp_logfile(talloc_tos())); 870 828 871 /* POSIX demands that signals are inherited. If the invoking process has 829 872 * these signals masked, we will have problems, as we won't receive them. */ … … 842 885 #endif 843 886 887 /* Ignore children - no zombies. */ 888 CatchChild(); 889 844 890 if ( opt_interactive ) { 845 891 Fork = False; … … 851 897 exit(1); 852 898 } 899 853 900 if (log_stdout) { 854 setup_logging( 901 setup_logging(argv[0], DEBUG_STDOUT); 855 902 } else { 856 903 setup_logging( argv[0], DEBUG_FILE); … … 863 910 864 911 if (!lp_load_initial_only(get_dyn_CONFIGFILE())) { 865 DEBUG(0, ("error opening config file \n"));912 DEBUG(0, ("error opening config file '%s'\n", get_dyn_CONFIGFILE())); 866 913 exit(1); 867 914 } 868 915 869 if (nmbd_messaging_context() == NULL) { 916 reopen_logs(); 917 918 if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC 919 && !lp_parm_bool(-1, "server role check", "inhibit", false)) { 920 /* TODO: when we have a merged set of defaults for 921 * loadparm, we could possibly check if the internal 922 * nbt server is in the list, and allow a startup if disabled */ 923 DEBUG(0, ("server role = 'active directory domain controller' not compatible with running nmbd standalone. \n")); 924 DEBUGADD(0, ("You should start 'samba' instead, and it will control starting the internal nbt server\n")); 925 exit(1); 926 } 927 928 if (!cluster_probe_ok()) { 929 exit(1); 930 } 931 932 msg = messaging_init(NULL, server_event_context()); 933 if (msg == NULL) { 870 934 return 1; 871 935 } … … 887 951 888 952 if (!is_daemon && !is_a_socket(0)) { 889 DEBUG( 0,("standard input is not a socket, assuming -D option\n"));953 DEBUG(3, ("standard input is not a socket, assuming -D option\n")); 890 954 is_daemon = True; 891 955 } 892 956 893 957 if (is_daemon && !opt_interactive) { 894 DEBUG( 2, ( "Becoming a daemon.\n" ));958 DEBUG(3, ("Becoming a daemon.\n")); 895 959 become_daemon(Fork, no_process_group, log_stdout); 896 960 } … … 905 969 #endif 906 970 907 if (nmbd_messaging_context() == NULL) {908 return 1;909 }910 911 971 #ifndef SYNC_DNS 912 972 /* Setup the async dns. We do it here so it doesn't have all the other 913 973 stuff initialised and thus chewing memory and sockets */ 914 if(lp_we_are_a_wins_server() && lp_ dns_proxy()) {915 start_async_dns( );974 if(lp_we_are_a_wins_server() && lp_wins_dns_proxy()) { 975 start_async_dns(msg); 916 976 } 917 977 #endif 918 978 919 if (!directory_exist(lp_lockdir())) { 920 mkdir(lp_lockdir(), 0755); 921 } 922 923 pidfile_create("nmbd"); 924 925 status = reinit_after_fork(nmbd_messaging_context(), 926 nmbd_event_context(), 927 procid_self(), false); 979 ok = directory_create_or_exist(lp_lock_directory(), 0755); 980 if (!ok) { 981 exit_daemon("Failed to create directory for lock files, check 'lock directory'", errno); 982 } 983 984 ok = directory_create_or_exist(lp_pid_directory(), 0755); 985 if (!ok) { 986 exit_daemon("Failed to create directory for pid files, check 'pid directory'", errno); 987 } 988 989 pidfile_create(lp_pid_directory(), "nmbd"); 990 991 status = reinit_after_fork(msg, nmbd_event_context(), false, NULL); 928 992 929 993 if (!NT_STATUS_IS_OK(status)) { 930 DEBUG(0,("reinit_after_fork() failed\n")); 994 exit_daemon("reinit_after_fork() failed", map_errno_from_nt_status(status)); 995 } 996 997 /* 998 * Do not initialize the parent-child-pipe before becoming 999 * a daemon: this is used to detect a died parent in the child 1000 * process. 1001 */ 1002 status = init_before_fork(); 1003 if (!NT_STATUS_IS_OK(status)) { 1004 exit_daemon(nt_errstr(status), map_errno_from_nt_status(status)); 1005 } 1006 1007 if (!nmbd_setup_sig_term_handler(msg)) 1008 exit_daemon("NMBD failed to setup signal handler", EINVAL); 1009 if (!nmbd_setup_stdin_handler(msg, !Fork)) 1010 exit_daemon("NMBD failed to setup stdin handler", EINVAL); 1011 if (!nmbd_setup_sig_hup_handler(msg)) 1012 exit_daemon("NMBD failed to setup SIGHUP handler", EINVAL); 1013 1014 if (!messaging_parent_dgm_cleanup_init(msg)) { 931 1015 exit(1); 932 1016 } 933 1017 934 if (!nmbd_setup_sig_term_handler())935 exit(1);936 if (!nmbd_setup_sig_hup_handler())937 exit(1);938 939 1018 /* get broadcast messages */ 940 1019 941 if (!serverid_register(procid_self(), 942 FLAG_MSG_GENERAL|FLAG_MSG_DBWRAP)) { 943 DEBUG(1, ("Could not register myself in serverid.tdb\n")); 944 exit(1); 945 } 946 947 messaging_register(nmbd_messaging_context(), NULL, 948 MSG_FORCE_ELECTION, nmbd_message_election); 1020 if (!serverid_register(messaging_server_id(msg), 1021 FLAG_MSG_GENERAL | 1022 FLAG_MSG_NMBD | 1023 FLAG_MSG_DBWRAP)) { 1024 exit_daemon("Could not register NMBD process in serverid.tdb", EACCES); 1025 } 1026 1027 messaging_register(msg, NULL, MSG_FORCE_ELECTION, 1028 nmbd_message_election); 949 1029 #if 0 950 1030 /* Until winsrepl is done. */ 951 messaging_register( nmbd_messaging_context(), NULL,952 MSG_WINS_NEW_ENTRY,nmbd_wins_new_entry);1031 messaging_register(msg, NULL, MSG_WINS_NEW_ENTRY, 1032 nmbd_wins_new_entry); 953 1033 #endif 954 messaging_register( nmbd_messaging_context(), NULL,955 MSG_SHUTDOWN,nmbd_terminate);956 messaging_register( nmbd_messaging_context(), NULL,957 MSG_SMB_CONF_UPDATED,msg_reload_nmbd_services);958 messaging_register( nmbd_messaging_context(), NULL,959 MSG_SEND_PACKET,msg_nmbd_send_packet);1034 messaging_register(msg, NULL, MSG_SHUTDOWN, 1035 nmbd_terminate); 1036 messaging_register(msg, NULL, MSG_SMB_CONF_UPDATED, 1037 msg_reload_nmbd_services); 1038 messaging_register(msg, NULL, MSG_SEND_PACKET, 1039 msg_nmbd_send_packet); 960 1040 961 1041 TimeInit(); … … 973 1053 /* Create an nmbd subnet record for each of the above. */ 974 1054 if( False == create_subnets() ) { 975 DEBUG(0,("ERROR: Failed when creating subnet lists. Exiting.\n"));976 1055 kill_async_dns_child(); 977 exit (1);1056 exit_daemon("NMBD failed when creating subnet lists", EACCES); 978 1057 } 979 1058 … … 987 1066 /* If we are acting as a WINS server, initialise data structures. */ 988 1067 if( !initialise_wins() ) { 989 DEBUG( 0, ( "nmbd: Failed when initialising WINS server.\n" ) );990 1068 kill_async_dns_child(); 991 exit (1);1069 exit_daemon( "NMBD failed when initialising WINS server.", EACCES); 992 1070 } 993 1071 … … 1001 1079 1002 1080 if( False == register_my_workgroup_and_names() ) { 1003 DEBUG(0,("ERROR: Failed when creating my my workgroup. Exiting.\n"));1004 1081 kill_async_dns_child(); 1005 exit (1);1082 exit_daemon( "NMBD failed when creating my workgroup.", EACCES); 1006 1083 } 1007 1084 1008 1085 if (!initialize_nmbd_proxy_logon()) { 1009 DEBUG(0,("ERROR: Failed setup nmbd_proxy_logon.\n"));1010 1086 kill_async_dns_child(); 1011 exit (1);1087 exit_daemon( "NMBD failed to setup nmbd_proxy_logon.", EACCES); 1012 1088 } 1013 1089 1014 1090 if (!nmbd_init_packet_server()) { 1015 1091 kill_async_dns_child(); 1016 exit(1); 1017 } 1092 exit_daemon( "NMBD failed to setup packet server.", EACCES); 1093 } 1094 1095 if (is_daemon && !opt_interactive) { 1096 daemon_ready("nmbd"); 1097 } 1018 1098 1019 1099 TALLOC_FREE(frame); 1020 process( );1100 process(msg); 1021 1101 1022 1102 kill_async_dns_child(); -
vendor/current/source3/nmbd/nmbd_become_dmb.c
r740 r988 25 25 #include "nmbd/nmbd.h" 26 26 27 extern uint16 samba_nb_type; /* Samba's NetBIOS type. */27 extern uint16_t samba_nb_type; /* Samba's NetBIOS type. */ 28 28 29 29 static void become_domain_master_browser_bcast(const char *); … … 52 52 work->dom_state = DOMAIN_NONE; 53 53 54 if((servrec = find_server_in_workgroup( work, global_myname())) == NULL) {54 if((servrec = find_server_in_workgroup( work, lp_netbios_name())) == NULL) { 55 55 DEBUG(0,("become_domain_master_fail: Error - cannot find server %s \ 56 56 in workgroup %s on subnet %s\n", 57 global_myname(), work->work_group, subrec->subnet_name));57 lp_netbios_name(), work->work_group, subrec->subnet_name)); 58 58 return; 59 59 } … … 77 77 struct userdata_struct *userdata, 78 78 struct nmb_name *registered_name, 79 uint16 nb_flags,79 uint16_t nb_flags, 80 80 int ttl, struct in_addr registered_ip) 81 81 { … … 93 93 } 94 94 95 if((servrec = find_server_in_workgroup( work, global_myname())) == NULL) {95 if((servrec = find_server_in_workgroup( work, lp_netbios_name())) == NULL) { 96 96 DEBUG(0,("become_domain_master_stage2: Error - cannot find server %s \ 97 97 in workgroup %s on subnet %s\n", 98 global_myname(), regname, subrec->subnet_name));98 lp_netbios_name(), regname, subrec->subnet_name)); 99 99 work->dom_state = DOMAIN_NONE; 100 100 return; … … 111 111 112 112 if( DEBUGLVL( 0 ) ) { 113 dbgtext( "*****\n\nSamba server %s ", global_myname() );113 dbgtext( "*****\n\nSamba server %s ", lp_netbios_name() ); 114 114 dbgtext( "is now a domain master browser for " ); 115 115 dbgtext( "workgroup %s ", work->work_group ); … … 127 127 a local master browser. */ 128 128 129 make_nmb_name(&nmbname, global_myname(), 0x20);129 make_nmb_name(&nmbname, lp_netbios_name(), 0x20); 130 130 131 131 work->dmb_name = nmbname; … … 376 376 377 377 /* Do the "internet group" - <1c> names. */ 378 if ( lp_domain_logons())378 if (IS_DC) 379 379 add_logon_names(); 380 380 -
vendor/current/source3/nmbd/nmbd_become_lmb.c
r740 r988 25 25 #include "../librpc/gen_ndr/svcctl.h" 26 26 27 extern uint16 samba_nb_type; /* Samba's NetBIOS name type. */27 extern uint16_t samba_nb_type; /* Samba's NetBIOS name type. */ 28 28 29 29 /******************************************************************* … … 33 33 34 34 void insert_permanent_name_into_unicast( struct subnet_record *subrec, 35 struct nmb_name *nmbname, uint16 nb_type )35 struct nmb_name *nmbname, uint16_t nb_type ) 36 36 { 37 37 unstring name; … … 86 86 } 87 87 88 if((servrec = find_server_in_workgroup( work, global_myname())) == NULL) {88 if((servrec = find_server_in_workgroup( work, lp_netbios_name())) == NULL) { 89 89 DEBUG(0,("reset_workgroup_state: Error - cannot find server %s \ 90 90 in workgroup %s on subnet %s\n", 91 global_myname(), work->work_group, subrec->subnet_name));91 lp_netbios_name(), work->work_group, subrec->subnet_name)); 92 92 work->mst_state = lp_local_master() ? MST_POTENTIAL : MST_NONE; 93 93 return; … … 150 150 if( DEBUGLVL( 0 ) ) { 151 151 dbgtext( "*****\n\n" ); 152 dbgtext( "Samba name server %s ", global_myname() );152 dbgtext( "Samba name server %s ", lp_netbios_name() ); 153 153 dbgtext( "has stopped being a local master browser " ); 154 154 dbgtext( "for workgroup %s ", relname ); … … 186 186 if( DEBUGLVL( 0 ) ) { 187 187 dbgtext( "*****\n\n" ); 188 dbgtext( "Samba name server %s ", global_myname() );188 dbgtext( "Samba name server %s ", lp_netbios_name() ); 189 189 dbgtext( "has stopped being a local master browser " ); 190 190 dbgtext( "for workgroup %s ", failname ); … … 281 281 on subnet %s\n",work->work_group, subrec->subnet_name)); 282 282 283 if(find_server_in_workgroup( work, global_myname()) == NULL) {283 if(find_server_in_workgroup( work, lp_netbios_name()) == NULL) { 284 284 DEBUG(0,("unbecome_local_master_browser: Error - cannot find server %s \ 285 285 in workgroup %s on subnet %s\n", 286 global_myname(), work->work_group, subrec->subnet_name));286 lp_netbios_name(), work->work_group, subrec->subnet_name)); 287 287 work->mst_state = lp_local_master() ? MST_POTENTIAL : MST_NONE; 288 288 return; … … 325 325 struct userdata_struct *userdata, 326 326 struct nmb_name *registered_name, 327 uint16 nb_flags,327 uint16_t nb_flags, 328 328 int ttl, struct in_addr registered_ip) 329 329 { … … 343 343 } 344 344 345 if((servrec = find_server_in_workgroup( work, global_myname())) == NULL) {345 if((servrec = find_server_in_workgroup( work, lp_netbios_name())) == NULL) { 346 346 DEBUG(0,("become_local_master_stage2: Error - cannot find server %s \ 347 347 in workgroup %s on subnet %s\n", 348 global_myname(), regname, subrec->subnet_name));348 lp_netbios_name(), regname, subrec->subnet_name)); 349 349 work->mst_state = lp_local_master() ? MST_POTENTIAL : MST_NONE; 350 350 return; … … 364 364 365 365 /* Add this name to the workgroup as local master browser. */ 366 set_workgroup_local_master_browser_name( work, global_myname());366 set_workgroup_local_master_browser_name( work, lp_netbios_name()); 367 367 368 368 /* Count the number of servers we have on our list. If it's … … 397 397 if( DEBUGLVL( 0 ) ) { 398 398 dbgtext( "*****\n\n" ); 399 dbgtext( "Samba name server %s ", global_myname() );399 dbgtext( "Samba name server %s ", lp_netbios_name() ); 400 400 dbgtext( "is now a local master browser " ); 401 401 dbgtext( "for workgroup %s ", work->work_group ); … … 438 438 struct userdata_struct *userdata, 439 439 struct nmb_name *registered_name, 440 uint16 nb_flags,440 uint16_t nb_flags, 441 441 int ttl, struct in_addr registered_ip) 442 442 { … … 488 488 } 489 489 490 if(find_server_in_workgroup(work, global_myname()) == NULL) {490 if(find_server_in_workgroup(work, lp_netbios_name()) == NULL) { 491 491 DEBUG(0,("become_local_master_fail1: Error - cannot find server %s \ 492 492 in workgroup %s on subnet %s\n", 493 global_myname(), work->work_group, subrec->subnet_name));493 lp_netbios_name(), work->work_group, subrec->subnet_name)); 494 494 return; 495 495 } … … 528 528 } 529 529 530 if(find_server_in_workgroup( work, global_myname()) == NULL) {530 if(find_server_in_workgroup( work, lp_netbios_name()) == NULL) { 531 531 DEBUG(0,("become_local_master_browser: Error - cannot find server %s \ 532 532 in workgroup %s on subnet %s\n", 533 global_myname(), work->work_group, subrec->subnet_name));533 lp_netbios_name(), work->work_group, subrec->subnet_name)); 534 534 return; 535 535 } … … 555 555 userdata->free_fn = NULL; 556 556 userdata->userdata_len = strlen(work->work_group)+1; 557 overmalloc_safe_strcpy(userdata->data, work->work_group, size - sizeof(*userdata) - 1);557 strlcpy(userdata->data, work->work_group, size - sizeof(*userdata)); 558 558 559 559 /* Register the special browser group name. */ -
vendor/current/source3/nmbd/nmbd_browserdb.c
r740 r988 110 110 unstrcpy( browc->lmb_name, browser_name); 111 111 unstrcpy( browc->work_group, work_name); 112 strupper_m( browc->lmb_name ); 113 strupper_m( browc->work_group ); 112 if (!strupper_m( browc->lmb_name )) { 113 SAFE_FREE(browc); 114 return NULL; 115 } 116 if (!strupper_m( browc->work_group )) { 117 SAFE_FREE(browc); 118 return NULL; 119 } 114 120 115 121 browc->ip = ip; 116 122 117 DLIST_ADD_END(lmb_browserlist, browc , struct browse_cache_record *);123 DLIST_ADD_END(lmb_browserlist, browc); 118 124 119 if( DEBUGLVL( 3 ) ) { 120 Debug1( "nmbd_browserdb:create_browser_in_lmb_cache()\n" ); 121 Debug1( " Added lmb cache entry for workgroup %s ", browc->work_group ); 122 Debug1( "name %s IP %s ", browc->lmb_name, inet_ntoa(ip) ); 123 Debug1( "ttl %d\n", (int)browc->death_time ); 124 } 125 DEBUG(3, ("nmbd_browserdb:create_browser_in_lmb_cache()\n")); 126 DEBUGADD(3, (" Added lmb cache entry for workgroup %s name %s IP %s " 127 "ttl %d\n", browc->work_group, browc->lmb_name, 128 inet_ntoa(ip), (int)browc->death_time)); 125 129 126 130 return( browc ); … … 167 171 168 172 if( browc->death_time < t ) { 169 if( DEBUGLVL( 3 ) ) { 170 Debug1( "nmbd_browserdb:expire_lmb_browsers()\n" ); 171 Debug1( " Removing timed out lmb entry %s\n", browc->lmb_name ); 172 } 173 DEBUG(3, ("nmbd_browserdb:expire_lmb_browsers()\n")); 174 DEBUGADD(3, (" Removing timed out lmb entry %s\n", 175 browc->lmb_name)); 173 176 remove_lmb_browser_entry( browc ); 174 177 } -
vendor/current/source3/nmbd/nmbd_browsesync.c
r740 r988 120 120 p++; 121 121 122 unstrcpy(myname, global_myname()); 123 strupper_m(myname); 122 unstrcpy(myname, lp_netbios_name()); 123 if (!strupper_m(myname)) { 124 DEBUG(2,("strupper_m %s failed\n", myname)); 125 return; 126 } 124 127 myname[15]='\0'; 125 128 /* The call below does CH_UNIX -> CH_DOS conversion. JRA */ … … 138 141 pull_ascii_nstring(dmb_name, sizeof(dmb_name), work->dmb_name.name); 139 142 send_mailslot(True, BROWSE_MAILSLOT, outbuf,PTR_DIFF(p,outbuf), 140 global_myname(), 0x0, dmb_name, 0x0,143 lp_netbios_name(), 0x0, dmb_name, 0x0, 141 144 work->dmb_addr, FIRST_SUBNET->myip, DGRAM_PORT); 142 145 } … … 192 195 the first SERVER<0x20> name. */ 193 196 194 if (answers->rdata != NULL) {197 if (answers->rdlength > 0) { 195 198 char *p = answers->rdata; 196 199 int numnames = CVAL(p, 0); … … 200 203 while (numnames--) { 201 204 unstring qname; 202 uint16 nb_flags;205 uint16_t nb_flags; 203 206 int name_type; 204 207 … … 331 334 userdata->free_fn = NULL; 332 335 userdata->userdata_len = strlen(work->work_group)+1; 333 overmalloc_safe_strcpy(userdata->data, work->work_group, size - sizeof(*userdata) - 1);336 strlcpy(userdata->data, work->work_group, size - sizeof(*userdata)); 334 337 335 338 node_status( subrec, &nmbname, answer_ip, … … 400 403 struct in_addr from_ip) 401 404 { 402 struct work_record *work;403 405 unstring server_name; 404 406 … … 415 417 */ 416 418 417 if (answers->rdata != NULL) {419 if (answers->rdlength > 0) { 418 420 char *p = answers->rdata; 419 421 int numnames = CVAL(p, 0); … … 423 425 while (numnames--) { 424 426 unstring qname; 425 uint16 nb_flags;427 uint16_t nb_flags; 426 428 int name_type; 427 429 … … 436 438 server_name[0] == 0) { 437 439 /* this is almost certainly the server netbios name */ 438 unstrcpy(server_name, qname);440 strlcpy(server_name, qname, sizeof(server_name)); 439 441 continue; 440 442 } 441 443 442 444 if(!(nb_flags & NB_GROUP) && (name_type == 0x1b)) { 445 struct work_record *work; 446 443 447 if( DEBUGLVL( 5 ) ) { 444 448 dbgtext( "get_domain_master_name_node_status_success:\n" ); … … 453 457 */ 454 458 455 if((work = find_workgroup_on_subnet( subrec, qname)) == NULL) { 459 work = find_workgroup_on_subnet( subrec, qname); 460 if (work == NULL) { 456 461 struct nmb_name nmbname; 457 462 /* 458 463 * Add it - with an hour in the cache. 459 464 */ 460 if(!(work= create_workgroup_on_subnet(subrec, qname, 60*60))) 465 work = create_workgroup_on_subnet(subrec, qname, 60*60); 466 if (work == NULL) { 461 467 return; 468 } 462 469 463 470 /* remember who the master is */ 464 unstrcpy(work->local_master_browser_name, server_name); 471 strlcpy(work->local_master_browser_name, 472 server_name, 473 sizeof(work->local_master_browser_name)); 465 474 make_nmb_name(&nmbname, server_name, 0x20); 466 475 work->dmb_name = nmbname; … … 470 479 } 471 480 } 472 } else if( DEBUGLVL( 0) ) {481 } else if( DEBUGLVL( 1 ) ) { 473 482 dbgtext( "get_domain_master_name_node_status_success:\n" ); 474 483 dbgtext( "Failed to find a WORKGROUP<0x1b> name in reply from IP " ); … … 484 493 struct response_record *rrec) 485 494 { 486 if( DEBUGLVL( 0) ) {495 if( DEBUGLVL( 2 ) ) { 487 496 dbgtext( "get_domain_master_name_node_status_fail:\n" ); 488 497 dbgtext( "Doing a node status request to the domain master browser " ); -
vendor/current/source3/nmbd/nmbd_elections.c
r740 r988 23 23 #include "includes.h" 24 24 #include "nmbd/nmbd.h" 25 #include "smbprofile.h"26 25 27 26 /* Election parameters. */ … … 33 32 34 33 static void send_election_dgram(struct subnet_record *subrec, const char *workgroup_name, 35 uint32 criterion, int timeup,const char *server_name)34 uint32_t criterion, int timeup,const char *server_name) 36 35 { 37 36 char outbuf[1024]; … … 52 51 p += 13; 53 52 unstrcpy(srv_name, server_name); 54 strupper_m(srv_name); 53 if (!strupper_m(srv_name)) { 54 DEBUG(2,("strupper_m failed for %s\n", srv_name)); 55 return; 56 } 55 57 /* The following call does UNIX -> DOS charset conversion. */ 56 58 push_ascii(p, srv_name, sizeof(outbuf)-PTR_DIFF(p,outbuf)-1, STR_TERMINATE); … … 58 60 59 61 send_mailslot(False, BROWSE_MAILSLOT, outbuf, PTR_DIFF(p,outbuf), 60 global_myname(), 0,62 lp_netbios_name(), 0, 61 63 workgroup_name, 0x1e, 62 64 subrec->bcast_ip, subrec->myip, DGRAM_PORT); … … 165 167 struct subnet_record *subrec; 166 168 167 START_PROFILE(run_elections);168 169 169 /* Send election packets once every 2 seconds - note */ 170 170 if (lastime && (t - lastime < 2)) { 171 END_PROFILE(run_elections);172 171 return; 173 172 } … … 195 194 196 195 send_election_dgram(subrec, work->work_group, work->ElectionCriterion, 197 t - StartupTime, global_myname());196 t - StartupTime, lp_netbios_name()); 198 197 199 198 if (work->ElectionCount++ >= 4) { … … 209 208 } 210 209 } 211 END_PROFILE(run_elections);212 210 } 213 211 … … 217 215 218 216 static bool win_election(struct work_record *work, int version, 219 uint32 criterion, int timeup, const char *server_name)217 uint32_t criterion, int timeup, const char *server_name) 220 218 { 221 219 int mytimeup = time(NULL) - StartupTime; 222 uint32 mycriterion = work->ElectionCriterion;220 uint32_t mycriterion = work->ElectionCriterion; 223 221 224 222 /* If local master is false then never win in election broadcasts. */ … … 232 230 criterion, mycriterion, 233 231 timeup, mytimeup, 234 server_name, global_myname()));232 server_name, lp_netbios_name())); 235 233 236 234 if (version > ELECTION_VERSION) … … 249 247 return(True); 250 248 251 if ( StrCaseCmp(global_myname(), server_name) > 0)249 if (strcasecmp_m(lp_netbios_name(), server_name) > 0) 252 250 return(False); 253 251 … … 263 261 struct dgram_packet *dgram = &p->packet.dgram; 264 262 int version = CVAL(buf,0); 265 uint32 criterion = IVAL(buf,1);263 uint32_t criterion = IVAL(buf,1); 266 264 int timeup = IVAL(buf,5)/1000; 267 265 unstring server_name; 268 266 struct work_record *work; 269 267 unstring workgroup_name; 270 271 START_PROFILE(election);272 268 273 269 pull_ascii_nstring(server_name, sizeof(server_name), buf+13); … … 317 313 } 318 314 done: 319 320 END_PROFILE(election); 315 return; 321 316 } 322 317 -
vendor/current/source3/nmbd/nmbd_incomingdgrams.c
r740 r988 24 24 #include "../librpc/gen_ndr/svcctl.h" 25 25 #include "nmbd/nmbd.h" 26 #include "smbprofile.h"27 26 28 27 extern bool found_lm_clients; … … 101 100 int ttl = IVAL(buf,1)/1000; 102 101 unstring announce_name; 103 uint32 servertype = IVAL(buf,23);102 uint32_t servertype = IVAL(buf,23); 104 103 fstring comment; 105 104 struct work_record *work; … … 107 106 unstring work_name; 108 107 unstring source_name; 109 110 START_PROFILE(host_announce);108 ZERO_STRUCT(source_name); 109 ZERO_STRUCT(announce_name); 111 110 112 111 pull_ascii_fstring(comment, buf+31); … … 145 144 */ 146 145 147 if(strequal(work_name, global_myname()))146 if(strequal(work_name, lp_netbios_name())) 148 147 unstrcpy(work_name,lp_workgroup()); 149 148 … … 173 172 servrec->serv.type = servertype|SV_TYPE_LOCAL_LIST_ONLY; 174 173 update_server_ttl( servrec, ttl); 175 fstrcpy(servrec->serv.comment,comment);174 strlcpy(servrec->serv.comment,comment,sizeof(servrec->serv.comment)); 176 175 } 177 176 } else { … … 188 187 subrec->work_changed = True; 189 188 done: 190 191 END_PROFILE(host_announce); 189 return; 192 190 } 193 191 … … 202 200 unstring workgroup_announce_name; 203 201 unstring master_name; 204 uint32 servertype = IVAL(buf,23);202 uint32_t servertype = IVAL(buf,23); 205 203 struct work_record *work; 206 204 unstring source_name; 207 205 unstring dest_name; 208 209 START_PROFILE(workgroup_announce);210 206 211 207 pull_ascii_nstring(workgroup_announce_name,sizeof(workgroup_announce_name),buf+5); … … 245 241 246 242 done: 247 248 END_PROFILE(workgroup_announce); 243 return; 249 244 } 250 245 … … 258 253 int ttl = IVAL(buf,1)/1000; 259 254 unstring server_name; 260 uint32 servertype = IVAL(buf,23);255 uint32_t servertype = IVAL(buf,23); 261 256 fstring comment; 262 257 unstring work_name; … … 264 259 struct server_record *servrec; 265 260 unstring source_name; 266 267 START_PROFILE(local_master_announce);268 261 269 262 pull_ascii_nstring(server_name,sizeof(server_name),buf+5); … … 337 330 } else { 338 331 /* Update the record. */ 339 servrec->serv.type = servertype|SV_TYPE_LOCAL_LIST_ONLY; 332 if (servrec->serv.type != 333 (servertype|SV_TYPE_LOCAL_LIST_ONLY)) { 334 servrec->serv.type = 335 servertype|SV_TYPE_LOCAL_LIST_ONLY; 336 subrec->work_changed = true; 337 } 338 if (!strequal(servrec->serv.comment,comment)) { 339 strlcpy(servrec->serv.comment, 340 comment, 341 sizeof(servrec->serv.comment)); 342 subrec->work_changed = true; 343 } 340 344 update_server_ttl(servrec, ttl); 341 fstrcpy(servrec->serv.comment,comment); 342 } 343 344 set_workgroup_local_master_browser_name( work, server_name ); 345 } 346 347 if (!strequal(work->local_master_browser_name, server_name)) { 348 set_workgroup_local_master_browser_name( work, server_name ); 349 subrec->work_changed = true; 350 } 345 351 } else { 346 352 /* … … 354 360 } 355 361 356 subrec->work_changed = True;357 362 done: 358 359 END_PROFILE(local_master_announce); 363 return; 360 364 } 361 365 … … 373 377 struct work_record *work; 374 378 struct browse_cache_record *browrec; 375 376 START_PROFILE(master_browser_announce);377 379 378 380 pull_ascii_nstring(local_master_name,sizeof(local_master_name),buf); … … 411 413 412 414 done: 413 414 END_PROFILE(master_browser_announce); 415 return; 415 416 } 416 417 … … 422 423 { 423 424 struct dgram_packet *dgram = &p->packet.dgram; 424 uint32 servertype = IVAL(buf,1);425 uint32_t servertype = IVAL(buf,1); 425 426 int osmajor=CVAL(buf,5); /* major version of node software */ 426 427 int osminor=CVAL(buf,6); /* minor version of node software */ … … 434 435 char *s = get_safe_str_ptr(buf,len,discard_const_p(char, buf),9); 435 436 436 START_PROFILE(lm_host_announce);437 437 if (!s) { 438 438 goto done; … … 485 485 */ 486 486 487 if(strequal(work_name, global_myname()))487 if(strequal(work_name, lp_netbios_name())) 488 488 unstrcpy(work_name,lp_workgroup()); 489 489 … … 513 513 servrec->serv.type = servertype|SV_TYPE_LOCAL_LIST_ONLY; 514 514 update_server_ttl( servrec, ttl); 515 fstrcpy(servrec->serv.comment,comment);515 strlcpy(servrec->serv.comment,comment,sizeof(servrec->serv.comment)); 516 516 } 517 517 } else { … … 530 530 531 531 done: 532 533 END_PROFILE(lm_host_announce); 532 return; 534 533 } 535 534 … … 542 541 struct nmb_name *send_to_name, 543 542 unsigned char max_number_requested, 544 uint32 token, struct in_addr sendto_ip,543 uint32_t token, struct in_addr sendto_ip, 545 544 int port) 546 545 { … … 572 571 /* We always return at least one name - our own. */ 573 572 count = 1; 574 unstrcpy(myname, global_myname()); 575 strupper_m(myname); 573 unstrcpy(myname, lp_netbios_name()); 574 if (!strupper_m(myname)) { 575 DEBUG(4,("strupper_m %s failed\n", myname)); 576 return; 577 } 576 578 myname[15]='\0'; 577 579 push_ascii(p, myname, sizeof(outbuf)-PTR_DIFF(p,outbuf)-1, STR_TERMINATE); … … 600 602 break; 601 603 602 if(strnequal(servrec->serv.name, global_myname(),15))604 if(strnequal(servrec->serv.name, lp_netbios_name(),15)) 603 605 continue; 604 606 … … 626 628 send_mailslot(True, BROWSE_MAILSLOT, 627 629 outbuf,PTR_DIFF(p,outbuf), 628 global_myname(), 0,630 lp_netbios_name(), 0, 629 631 send_to_namestr,0, 630 632 sendto_ip, subrec->myip, port); … … 647 649 struct work_record *work; 648 650 unsigned char max_number_requested = CVAL(buf,0); 649 uint32 token = IVAL(buf,1); /* Sender's key index for the workgroup. */651 uint32_t token = IVAL(buf,1); /* Sender's key index for the workgroup. */ 650 652 int name_type = dgram->dest_name.name_type; 651 653 unstring workgroup_name; 652 654 struct subnet_record *search_subrec = subrec; 653 655 654 START_PROFILE(get_backup_list);655 656 pull_ascii_nstring(workgroup_name, sizeof(workgroup_name), dgram->dest_name.name); 656 657 … … 710 711 711 712 done: 712 713 END_PROFILE(get_backup_list); 713 return; 714 714 } 715 715 … … 730 730 int state = CVAL(buf,0); 731 731 struct subnet_record *sr; 732 733 START_PROFILE(reset_browser);734 732 735 733 DEBUG(1,("process_reset_browser: received diagnostic browser reset \ … … 765 763 if (state & 0x4) 766 764 DEBUG(1,("process_reset_browser: ignoring request to stop being a browser.\n")); 767 768 END_PROFILE(reset_browser);769 765 } 770 766 … … 783 779 unstring workgroup_name; 784 780 785 START_PROFILE(announce_request);786 787 781 pull_ascii_nstring(workgroup_name, sizeof(workgroup_name), dgram->dest_name.name); 788 782 DEBUG(3,("process_announce_request: Announce request from %s IP %s to %s.\n", … … 805 799 work->needannounce = True; 806 800 done: 807 808 END_PROFILE(announce_request); 801 return; 809 802 } 810 803 … … 823 816 unstring workgroup_name; 824 817 825 START_PROFILE(lm_announce_request);826 827 818 pull_ascii_nstring(workgroup_name, sizeof(workgroup_name), dgram->dest_name.name); 828 819 DEBUG(3,("process_lm_announce_request: Announce request from %s IP %s to %s.\n", … … 846 837 847 838 done: 848 849 END_PROFILE(lm_announce_request); 850 } 839 return; 840 } -
vendor/current/source3/nmbd/nmbd_incomingrequests.c
r740 r988 61 61 unstring qname; 62 62 bool bcast = nmb->header.nm_flags.bcast; 63 uint16 nb_flags = get_nb_flags(nmb->additional->rdata);63 uint16_t nb_flags = get_nb_flags(nmb->additional->rdata); 64 64 bool group = (nb_flags & NB_GROUP) ? True : False; 65 65 struct name_record *namerec; … … 193 193 struct nmb_name *question = &nmb->question.question_name; 194 194 bool bcast = nmb->header.nm_flags.bcast; 195 uint16 nb_flags = get_nb_flags(nmb->additional->rdata);195 uint16_t nb_flags = get_nb_flags(nmb->additional->rdata); 196 196 bool group = (nb_flags & NB_GROUP) ? True : False; 197 197 struct name_record *namerec = NULL; … … 291 291 for (l2=0;l2<15 && n2[l2] && n2[l2] != ' ';l2++) 292 292 ; 293 l3 = strlen( global_myname());294 295 if ((l1==l3) && strncmp(n1, global_myname(),l3) == 0 &&296 (l2!=l3 || strncmp(n2, global_myname(),l3) != 0))293 l3 = strlen(lp_netbios_name()); 294 295 if ((l1==l3) && strncmp(n1,lp_netbios_name(),l3) == 0 && 296 (l2!=l3 || strncmp(n2,lp_netbios_name(),l3) != 0)) 297 297 return -1; 298 298 299 if ((l2==l3) && strncmp(n2, global_myname(),l3) == 0 &&300 (l1!=l3 || strncmp(n1, global_myname(),l3) != 0))299 if ((l2==l3) && strncmp(n2,lp_netbios_name(),l3) == 0 && 300 (l1!=l3 || strncmp(n1,lp_netbios_name(),l3) != 0)) 301 301 return 1; 302 302 … … 348 348 349 349 pull_ascii_nstring(name, sizeof(name), namerec->name.name); 350 strupper_m(name); 350 if (!strupper_m(name)) { 351 DEBUG(2,("strupper_m %s failed\n", name)); 352 return; 353 } 351 354 if (!strequal(name,"*") && 352 355 !strequal(name,"__SAMBA__") && -
vendor/current/source3/nmbd/nmbd_lmhosts.c
r740 r988 71 71 if(name_type == -1) { 72 72 /* Add the (0) and (0x20) names directly into the namelist for this subnet. */ 73 (void)add_name_to_subnet(subrec,name,0x00,(uint16 )NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr);74 (void)add_name_to_subnet(subrec,name,0x20,(uint16 )NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr);73 (void)add_name_to_subnet(subrec,name,0x00,(uint16_t)NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr); 74 (void)add_name_to_subnet(subrec,name,0x20,(uint16_t)NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr); 75 75 } else { 76 76 /* Add the given name type to the subnet namelist. */ 77 (void)add_name_to_subnet(subrec,name,name_type,(uint16 )NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr);77 (void)add_name_to_subnet(subrec,name,name_type,(uint16_t)NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr); 78 78 } 79 79 } -
vendor/current/source3/nmbd/nmbd_logonnames.c
r740 r988 25 25 #include "nmbd/nmbd.h" 26 26 27 extern uint16 samba_nb_type; /* Samba's NetBIOS type. */27 extern uint16_t samba_nb_type; /* Samba's NetBIOS type. */ 28 28 29 29 /**************************************************************************** … … 47 47 } 48 48 49 if((servrec = find_server_in_workgroup( work, global_myname())) == NULL) {49 if((servrec = find_server_in_workgroup( work, lp_netbios_name())) == NULL) { 50 50 DEBUG(0,("become_logon_server_fail: Error - cannot find server %s \ 51 51 in workgroup %s on subnet %s\n", 52 global_myname(), failname, subrec->subnet_name));52 lp_netbios_name(), failname, subrec->subnet_name)); 53 53 work->log_state = LOGON_NONE; 54 54 return; … … 73 73 struct userdata_struct *userdata, 74 74 struct nmb_name *registered_name, 75 uint16 nb_flags,75 uint16_t nb_flags, 76 76 int ttl, struct in_addr registered_ip) 77 77 { … … 88 88 } 89 89 90 if((servrec = find_server_in_workgroup( work, global_myname())) == NULL) {90 if((servrec = find_server_in_workgroup( work, lp_netbios_name())) == NULL) { 91 91 DEBUG(0,("become_logon_server_success: Error - cannot find server %s \ 92 92 in workgroup %s on subnet %s\n", 93 global_myname(), reg_name, subrec->subnet_name));93 lp_netbios_name(), reg_name, subrec->subnet_name)); 94 94 work->log_state = LOGON_NONE; 95 95 return; -
vendor/current/source3/nmbd/nmbd_mynames.c
r740 r988 24 24 #include "nmbd/nmbd.h" 25 25 26 extern uint16 samba_nb_type; /* Samba's NetBIOS type. */26 extern uint16_t samba_nb_type; /* Samba's NetBIOS type. */ 27 27 28 28 /**************************************************************************** … … 84 84 85 85 static void insert_refresh_name_into_unicast( struct subnet_record *subrec, 86 struct nmb_name *nmbname, uint16 nb_type )86 struct nmb_name *nmbname, uint16_t nb_type ) 87 87 { 88 88 struct name_record *namerec; -
vendor/current/source3/nmbd/nmbd_namelistdb.c
r740 r988 25 25 #include "nmbd/nmbd.h" 26 26 27 uint16 samba_nb_type = 0; /* samba's NetBIOS name type */27 uint16_t samba_nb_type = 0; /* samba's NetBIOS name type */ 28 28 29 29 … … 34 34 void set_samba_nb_type(void) 35 35 { 36 if( lp_w ins_support() || wins_srv_count() ) {36 if( lp_we_are_a_wins_server() || wins_srv_count() ) { 37 37 samba_nb_type = NB_HFLAG; /* samba is a 'hybrid' node type. */ 38 38 } else { … … 45 45 ***************************************************************************/ 46 46 47 static voidupcase_name( struct nmb_name *target, const struct nmb_name *source )47 static bool upcase_name( struct nmb_name *target, const struct nmb_name *source ) 48 48 { 49 49 int i; … … 56 56 57 57 pull_ascii_nstring(targ, sizeof(targ), target->name); 58 strupper_m( targ ); 58 if (!strupper_m( targ )) { 59 return false; 60 } 59 61 push_ascii_nstring( target->name, targ); 60 62 61 63 pull_ascii(scope, target->scope, 64, -1, STR_TERMINATE); 62 strupper_m( scope ); 64 if (!strupper_m( scope )) { 65 return false; 66 } 63 67 push_ascii(target->scope, scope, 64, STR_TERMINATE); 64 68 … … 73 77 target->scope[i] = '\0'; 74 78 } 79 return true; 75 80 } 76 81 … … 105 110 struct name_record *name_ret; 106 111 107 upcase_name( &uc_name, nmbname ); 112 if (!upcase_name( &uc_name, nmbname )) { 113 return NULL; 114 } 108 115 109 116 if (subrec == wins_server_subnet) { … … 185 192 const char *name, 186 193 int type, 187 uint16 nb_flags,194 uint16_t nb_flags, 188 195 int ttl, 189 196 enum name_source source, … … 217 224 218 225 make_nmb_name(&namerec->name, name, type); 219 upcase_name(&namerec->name, NULL ); 226 if (!upcase_name(&namerec->name, NULL )) { 227 SAFE_FREE(namerec->data.ip); 228 SAFE_FREE(namerec); 229 return False; 230 } 220 231 221 232 /* Enter the name as active. */ … … 276 287 void standard_success_register(struct subnet_record *subrec, 277 288 struct userdata_struct *userdata, 278 struct nmb_name *nmbname, uint16 nb_flags, int ttl,289 struct nmb_name *nmbname, uint16_t nb_flags, int ttl, 279 290 struct in_addr registered_ip) 280 291 { … … 632 643 void dump_all_namelists(void) 633 644 { 634 XFILE *fp; 645 XFILE *fp; 635 646 struct subnet_record *subrec; 636 637 fp = x_fopen(lock_path("namelist.debug"),O_WRONLY|O_CREAT|O_TRUNC, 0644); 638 639 if (!fp) { 647 char *dump_path; 648 649 dump_path = lock_path("namelist.debug"); 650 if (dump_path == NULL) { 651 DEBUG(0, ("out of memory!\n")); 652 return; 653 } 654 655 fp = x_fopen(dump_path, (O_WRONLY | O_CREAT | O_TRUNC), 0644); 656 TALLOC_FREE(dump_path); 657 if (!fp) { 640 658 DEBUG(0,("dump_all_namelists: Can't open file %s. Error was %s\n", 641 659 "namelist.debug",strerror(errno))); 642 660 return; 643 661 } 644 662 645 663 for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) { 646 664 dump_subnet_namelist( subrec, fp ); -
vendor/current/source3/nmbd/nmbd_nameregister.c
r740 r988 48 48 struct nmb_packet *sent_nmb = &rrec->packet->packet.nmb; 49 49 int ttl = 0; 50 uint16 nb_flags = 0;50 uint16_t nb_flags = 0; 51 51 struct in_addr register_ip; 52 52 fstring reg_name; … … 211 211 copes with all the wins servers being down */ 212 212 if (wins_srv_is_dead(rrec->packet->ip, register_ip)) { 213 uint16 nb_flags = get_nb_flags(sent_nmb->additional->rdata);213 uint16_t nb_flags = get_nb_flags(sent_nmb->additional->rdata); 214 214 int ttl = sent_nmb->additional->ttl; 215 215 … … 262 262 bool success = False; 263 263 struct nmb_name *question_name = &sent_nmb->question.question_name; 264 uint16 nb_flags = 0;264 uint16_t nb_flags = 0; 265 265 int ttl = 0; 266 266 struct in_addr registered_ip; … … 307 307 308 308 static void multihomed_register_one(struct nmb_name *nmbname, 309 uint16 nb_flags,309 uint16_t nb_flags, 310 310 register_name_success_function success_fn, 311 311 register_name_fail_function fail_fn, … … 357 357 struct nmb_packet *sent_nmb = &rrec->packet->packet.nmb; 358 358 struct nmb_name *nmbname = &sent_nmb->question.question_name; 359 uint16 nb_flags = get_nb_flags(sent_nmb->additional->rdata);359 uint16_t nb_flags = get_nb_flags(sent_nmb->additional->rdata); 360 360 struct userdata_struct *userdata = rrec->userdata; 361 361 const char *tag; … … 401 401 ****************************************************************************/ 402 402 403 static void multihomed_register_name(struct nmb_name *nmbname, uint16 nb_flags,403 static void multihomed_register_name(struct nmb_name *nmbname, uint16_t nb_flags, 404 404 register_name_success_function success_fn, 405 405 register_name_fail_function fail_fn) … … 476 476 477 477 void register_name(struct subnet_record *subrec, 478 const char *name, int type, uint16 nb_flags,478 const char *name, int type, uint16_t nb_flags, 479 479 register_name_success_function success_fn, 480 480 register_name_fail_function fail_fn, … … 483 483 struct nmb_name nmbname; 484 484 nstring nname; 485 size_t converted_size; 485 486 486 487 errno = 0; 487 push_ascii_nstring(nname, name); 488 if (errno == E2BIG) { 489 unstring tname; 490 pull_ascii_nstring(tname, sizeof(tname), nname); 491 DEBUG(0,("register_name: NetBIOS name %s is too long. Truncating to %s\n", 492 name, tname)); 493 make_nmb_name(&nmbname, tname, type); 488 converted_size = push_ascii_nstring(nname, name); 489 if (converted_size != (size_t)-1) { 490 /* Success. */ 491 make_nmb_name(&nmbname, name, type); 492 } else if (errno == E2BIG) { 493 /* 494 * Name converted to CH_DOS is too large. 495 * try to truncate. 496 */ 497 char *converted_str_dos = NULL; 498 char *converted_str_unix = NULL; 499 bool ok; 500 501 converted_size = 0; 502 503 ok = convert_string_talloc(talloc_tos(), 504 CH_UNIX, 505 CH_DOS, 506 name, 507 strlen(name)+1, 508 &converted_str_dos, 509 &converted_size); 510 if (!ok) { 511 DEBUG(0,("register_name: NetBIOS name %s cannot be " 512 "converted. Failing to register name.\n", 513 name)); 514 return; 515 } 516 517 /* 518 * As it's now CH_DOS codepage 519 * we truncate by writing '\0' at 520 * MAX_NETBIOSNAME_LEN-1 and then 521 * convert back to CH_UNIX which we 522 * need for the make_nmb_name() call. 523 */ 524 if (converted_size >= MAX_NETBIOSNAME_LEN) { 525 converted_str_dos[MAX_NETBIOSNAME_LEN-1] = '\0'; 526 } 527 528 ok = convert_string_talloc(talloc_tos(), 529 CH_DOS, 530 CH_UNIX, 531 converted_str_dos, 532 strlen(converted_str_dos)+1, 533 &converted_str_unix, 534 &converted_size); 535 if (!ok) { 536 DEBUG(0,("register_name: NetBIOS name %s cannot be " 537 "converted back to CH_UNIX. " 538 "Failing to register name.\n", 539 converted_str_dos)); 540 TALLOC_FREE(converted_str_dos); 541 return; 542 } 543 544 make_nmb_name(&nmbname, converted_str_unix, type); 545 546 TALLOC_FREE(converted_str_dos); 547 TALLOC_FREE(converted_str_unix); 494 548 } else { 495 make_nmb_name(&nmbname, name, type); 549 /* 550 * Generic conversion error. Fail to register. 551 */ 552 DEBUG(0,("register_name: NetBIOS name %s cannot be " 553 "converted (%s). Failing to register name.\n", 554 name, strerror(errno))); 555 return; 496 556 } 497 557 -
vendor/current/source3/nmbd/nmbd_packets.c
r740 r988 95 95 **************************************************************************/ 96 96 97 uint16 get_nb_flags(char *buf)98 { 99 return ((((uint16 )*buf)&0xFFFF) & NB_FLGMSK);100 } 101 102 void set_nb_flags(char *buf, uint16 nb_flags)97 uint16_t get_nb_flags(char *buf) 98 { 99 return ((((uint16_t)*buf)&0xFFFF) & NB_FLGMSK); 100 } 101 102 void set_nb_flags(char *buf, uint16_t nb_flags) 103 103 { 104 104 *buf++ = ((nb_flags & NB_FLGMSK) & 0xFF); … … 146 146 **************************************************************************/ 147 147 148 static uint16 name_trn_id=0;149 150 static uint16 generate_name_trn_id(void)148 static uint16_t name_trn_id=0; 149 150 static uint16_t generate_name_trn_id(void) 151 151 { 152 152 if (!name_trn_id) { 153 name_trn_id = ((unsigned)time(NULL)%(unsigned)0x7FFF) + ((unsigned) sys_getpid()%(unsigned)100);153 name_trn_id = ((unsigned)time(NULL)%(unsigned)0x7FFF) + ((unsigned)getpid()%(unsigned)100); 154 154 } 155 155 name_trn_id = (name_trn_id+1) % (unsigned)0x7FFF; … … 243 243 244 244 static bool create_and_init_additional_record(struct packet_struct *packet, 245 uint16 nb_flags,245 uint16_t nb_flags, 246 246 const struct in_addr *register_ip) 247 247 { … … 336 336 337 337 static bool initiate_name_register_packet( struct packet_struct *packet, 338 uint16 nb_flags, const struct in_addr *register_ip)338 uint16_t nb_flags, const struct in_addr *register_ip) 339 339 { 340 340 struct nmb_packet *nmb = &packet->packet.nmb; … … 360 360 361 361 static bool initiate_multihomed_name_register_packet(struct packet_struct *packet, 362 uint16 nb_flags, struct in_addr *register_ip)362 uint16_t nb_flags, struct in_addr *register_ip) 363 363 { 364 364 struct nmb_packet *nmb = &packet->packet.nmb; … … 388 388 389 389 static bool initiate_name_refresh_packet( struct packet_struct *packet, 390 uint16 nb_flags, struct in_addr *refresh_ip)390 uint16_t nb_flags, struct in_addr *refresh_ip) 391 391 { 392 392 struct nmb_packet *nmb = &packet->packet.nmb; … … 412 412 413 413 static bool initiate_name_release_packet( struct packet_struct *packet, 414 uint16 nb_flags, struct in_addr *release_ip)414 uint16_t nb_flags, struct in_addr *release_ip) 415 415 { 416 416 struct nmb_packet *nmb = &packet->packet.nmb; … … 485 485 struct userdata_struct *userdata, 486 486 struct nmb_name *nmbname, 487 uint16 nb_flags)487 uint16_t nb_flags) 488 488 { 489 489 struct packet_struct *p; … … 536 536 response_function resp_fn, 537 537 timeout_response_function timeout_fn, 538 uint16 nb_flags,538 uint16_t nb_flags, 539 539 struct in_addr refresh_ip, 540 540 const char *tag) … … 603 603 struct userdata_struct *userdata, 604 604 struct nmb_name *nmbname, 605 uint16 nb_flags,605 uint16_t nb_flags, 606 606 struct in_addr register_ip, 607 607 struct in_addr wins_ip) … … 661 661 struct userdata_struct *userdata, 662 662 struct nmb_name *nmbname, 663 uint16 nb_flags,663 uint16_t nb_flags, 664 664 struct in_addr release_ip, 665 665 struct in_addr dest_ip) … … 964 964 } 965 965 966 DEBUG(4,("reply_netbios_packet: sending a reply of packet type: %s %s to ip %s \ 967 for id %hu\n", packet_type, nmb_namestr(&orig_nmb->question.question_name), 968 inet_ntoa(packet.ip), orig_nmb->header.name_trn_id)); 966 DEBUG(4, ("reply_netbios_packet: sending a reply of packet type: %s " 967 "%s to ip %s for id %d\n", packet_type, 968 nmb_namestr(&orig_nmb->question.question_name), 969 inet_ntoa(packet.ip), orig_nmb->header.name_trn_id)); 969 970 970 971 nmb->header.name_trn_id = orig_nmb->header.name_trn_id; … … 1033 1034 void queue_packet(struct packet_struct *packet) 1034 1035 { 1035 DLIST_ADD_END(packet_queue, packet , struct packet_struct *);1036 DLIST_ADD_END(packet_queue, packet); 1036 1037 } 1037 1038 … … 1074 1075 /* Drop the packet if it's a different NetBIOS scope, or the source is from one of our names. */ 1075 1076 pull_ascii(scope, dgram->dest_name.scope, 64, 64, STR_TERMINATE); 1076 if (!strequal(scope, global_scope())) {1077 if (!strequal(scope, lp_netbios_scope())) { 1077 1078 DEBUG(7,("process_browse_packet: Discarding datagram from IP %s. Scope (%s) \ 1078 mismatch with our scope (%s).\n", inet_ntoa(p->ip), scope, global_scope()));1079 mismatch with our scope (%s).\n", inet_ntoa(p->ip), scope, lp_netbios_scope())); 1079 1080 return; 1080 1081 } … … 1162 1163 1163 1164 pull_ascii(scope, dgram->dest_name.scope, 64, 64, STR_TERMINATE); 1164 if (!strequal(scope, global_scope())) {1165 if (!strequal(scope, lp_netbios_scope())) { 1165 1166 DEBUG(7,("process_lanman_packet: Discarding datagram from IP %s. Scope (%s) \ 1166 mismatch with our scope (%s).\n", inet_ntoa(p->ip), scope, global_scope()));1167 mismatch with our scope (%s).\n", inet_ntoa(p->ip), scope, lp_netbios_scope())); 1167 1168 return; 1168 1169 } … … 1292 1293 DEBUG(4,("process_dgram: datagram from %s to %s IP %s for %s of type %d len=%d\n", 1293 1294 nmb_namestr(&dgram->source_name),nmb_namestr(&dgram->dest_name), 1294 inet_ntoa(p->ip), smb_buf (buf),CVAL(buf2,0),len));1295 inet_ntoa(p->ip), smb_buf_const(buf),CVAL(buf2,0),len)); 1295 1296 1296 1297 /* Datagram packet received for the browser mailslot */ 1297 if (strequal(smb_buf (buf),BROWSE_MAILSLOT)) {1298 if (strequal(smb_buf_const(buf),BROWSE_MAILSLOT)) { 1298 1299 process_browse_packet(p,buf2,len); 1299 1300 return; … … 1301 1302 1302 1303 /* Datagram packet received for the LAN Manager mailslot */ 1303 if (strequal(smb_buf (buf),LANMAN_MAILSLOT)) {1304 if (strequal(smb_buf_const(buf),LANMAN_MAILSLOT)) { 1304 1305 process_lanman_packet(p,buf2,len); 1305 1306 return; … … 1307 1308 1308 1309 /* Datagram packet received for the domain logon mailslot */ 1309 if (strequal(smb_buf (buf),NET_LOGON_MAILSLOT)) {1310 if (strequal(smb_buf_const(buf),NET_LOGON_MAILSLOT)) { 1310 1311 process_logon_packet(p,buf2,len,NET_LOGON_MAILSLOT); 1311 1312 return; … … 1313 1314 1314 1315 /* Datagram packet received for the NT domain logon mailslot */ 1315 if (strequal(smb_buf (buf),NT_LOGON_MAILSLOT)) {1316 if (strequal(smb_buf_const(buf),NT_LOGON_MAILSLOT)) { 1316 1317 process_logon_packet(p,buf2,len,NT_LOGON_MAILSLOT); 1317 1318 return; … … 1436 1437 rrec = find_response_record( &subrec, nmb->header.name_trn_id); 1437 1438 if(rrec == NULL) { 1438 DEBUG(3,("find_subnet_for_nmb_packet: response record not found for response id %hu\n", 1439 nmb->header.name_trn_id)); 1439 DEBUG(3, ("find_subnet_for_nmb_packet: response " 1440 "record not found for response id %d\n", 1441 nmb->header.name_trn_id)); 1440 1442 nb_packet_dispatch(packet_server, p); 1441 1443 return NULL; … … 1443 1445 1444 1446 if(subrec == NULL) { 1445 DEBUG(0,("find_subnet_for_nmb_packet: subnet record not found for response id %hu\n", 1446 nmb->header.name_trn_id)); 1447 DEBUG(0, ("find_subnet_for_nmb_packet: subnet record " 1448 "not found for response id %d\n", 1449 nmb->header.name_trn_id)); 1447 1450 return NULL; 1448 1451 } … … 1566 1569 1567 1570 if(rrec == NULL) { 1568 DEBUG(0,("process_nmb_response: response packet received but no response record \ 1569 found for id = %hu. Ignoring packet.\n", nmb->header.name_trn_id)); 1571 DEBUG(0, ("process_nmb_response: response packet received but " 1572 "no response record found for id = %d. Ignoring " 1573 "packet.\n", nmb->header.name_trn_id)); 1570 1574 return; 1571 1575 } … … 1699 1703 subrec != NULL; 1700 1704 subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) { 1701 count += 2; /* nmb_sock and dgram_sock */ 1705 if (subrec->nmb_sock != -1) { 1706 count += 1; 1707 } 1708 if (subrec->dgram_sock != -1) { 1709 count += 1; 1710 } 1702 1711 if (subrec->nmb_bcast != -1) { 1703 1712 count += 1; … … 1708 1717 } 1709 1718 1710 fds = TALLOC_ZERO_ARRAY(NULL, struct pollfd, count);1719 fds = talloc_zero_array(NULL, struct pollfd, count); 1711 1720 if (fds == NULL) { 1712 1721 DEBUG(1, ("create_listen_pollfds: malloc fail for fds. " … … 1715 1724 } 1716 1725 1717 attrs = TALLOC_ARRAY(NULL, struct socket_attributes, count);1726 attrs = talloc_array(NULL, struct socket_attributes, count); 1718 1727 if (fds == NULL) { 1719 1728 DEBUG(1, ("create_listen_pollfds: malloc fail for attrs. " 1720 1729 "size %d\n", count)); 1721 SAFE_FREE(fds);1730 TALLOC_FREE(fds); 1722 1731 return true; 1723 1732 } … … 1737 1746 for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) { 1738 1747 1739 fds[num].fd = subrec->nmb_sock; 1740 attrs[num].type = NMB_PACKET; 1741 attrs[num].broadcast = false; 1742 num += 1; 1748 if (subrec->nmb_sock != -1) { 1749 fds[num].fd = subrec->nmb_sock; 1750 attrs[num].type = NMB_PACKET; 1751 attrs[num].broadcast = false; 1752 num += 1; 1753 } 1743 1754 1744 1755 if (subrec->nmb_bcast != -1) { … … 1749 1760 } 1750 1761 1751 fds[num].fd = subrec->dgram_sock; 1752 attrs[num].type = DGRAM_PACKET; 1753 attrs[num].broadcast = false; 1754 num += 1; 1762 if (subrec->dgram_sock != -1) { 1763 fds[num].fd = subrec->dgram_sock; 1764 attrs[num].type = DGRAM_PACKET; 1765 attrs[num].broadcast = false; 1766 num += 1; 1767 } 1755 1768 1756 1769 if (subrec->dgram_bcast != -1) { … … 1856 1869 ***************************************************************************/ 1857 1870 1858 bool listen_for_packets( bool run_election)1871 bool listen_for_packets(struct messaging_context *msg, bool run_election) 1859 1872 { 1860 1873 static struct pollfd *fds = NULL; … … 1886 1899 */ 1887 1900 1888 fds = TALLOC_REALLOC_ARRAY(NULL, fds, struct pollfd, listen_number);1901 fds = talloc_realloc(NULL, fds, struct pollfd, listen_number); 1889 1902 if (fds == NULL) { 1890 1903 return true; … … 1895 1908 dns_fd = asyncdns_fd(); 1896 1909 if (dns_fd != -1) { 1897 fds = TALLOC_REALLOC_ARRAY(NULL, fds, struct pollfd, num_sockets+1);1910 fds = talloc_realloc(NULL, fds, struct pollfd, num_sockets+1); 1898 1911 if (fds == NULL) { 1899 1912 return true; … … 1927 1940 &fds, &num_sockets, &timeout); 1928 1941 1929 pollrtn = sys_poll(fds, num_sockets, timeout);1942 pollrtn = poll(fds, num_sockets, timeout); 1930 1943 1931 1944 if (run_events_poll(nmbd_event_context(), pollrtn, fds, num_sockets)) { … … 1940 1953 if ((dns_fd != -1) && (dns_pollidx != -1) && 1941 1954 (fds[dns_pollidx].revents & (POLLIN|POLLHUP|POLLERR))) { 1942 run_dns_queue( );1955 run_dns_queue(msg); 1943 1956 } 1944 1957 #endif … … 1987 2000 } 1988 2001 1989 if ((is_loopback_ip_v4(packet->ip) || ismyip_v4(packet->ip)) && 1990 packet->port == client_port) 1991 { 1992 if (client_port == DGRAM_PORT) { 1993 DEBUG(7,("discarding own dgram packet from %s:%d\n", 1994 inet_ntoa(packet->ip),packet->port)); 1995 free_packet(packet); 1996 continue; 1997 } 1998 1999 if (packet->packet.nmb.header.nm_flags.bcast) { 2000 DEBUG(7,("discarding own nmb bcast packet from %s:%d\n", 2001 inet_ntoa(packet->ip),packet->port)); 2002 free_packet(packet); 2003 continue; 2002 if (!IS_DC) { 2003 if ((is_loopback_ip_v4(packet->ip) || ismyip_v4(packet->ip)) && 2004 packet->port == client_port) 2005 { 2006 if (client_port == DGRAM_PORT) { 2007 DEBUG(7,("discarding own dgram packet from %s:%d\n", 2008 inet_ntoa(packet->ip),packet->port)); 2009 free_packet(packet); 2010 continue; 2011 } 2012 2013 if (packet->packet.nmb.header.nm_flags.bcast) { 2014 DEBUG(7,("discarding own nmb bcast packet from %s:%d\n", 2015 inet_ntoa(packet->ip),packet->port)); 2016 free_packet(packet); 2017 continue; 2018 } 2004 2019 } 2005 2020 } … … 2089 2104 SSVAL(ptr,smb_vwv16,2); 2090 2105 p2 = smb_buf(ptr); 2091 s afe_strcpy_base(p2, mailslot, dgram->data, sizeof(dgram->data));2106 strlcpy_base(p2, mailslot, dgram->data, sizeof(dgram->data)); 2092 2107 p2 = skip_string(ptr,MAX_DGRAM_SIZE,p2); 2093 2108 -
vendor/current/source3/nmbd/nmbd_processlogon.c
r740 r988 33 33 34 34 struct sam_database_info { 35 uint32 index;36 uint32 serial_lo, serial_hi;37 uint32 date_lo, date_hi;35 uint32_t index; 36 uint32_t serial_lo, serial_hi; 37 uint32_t date_lo, date_hi; 38 38 }; 39 39 … … 57 57 } 58 58 59 static void delayed_init_logon_handler(struct event_context *event_ctx,60 struct t imed_event*te,59 static void delayed_init_logon_handler(struct tevent_context *event_ctx, 60 struct tevent_timer *te, 61 61 struct timeval now, 62 62 void *private_data) … … 121 121 122 122 /* we create a connected udp socket */ 123 status = cldap_socket_init(ctx, nmbd_event_context(), NULL, 124 server_addr, &ctx->cldap_sock); 123 status = cldap_socket_init(ctx, NULL, server_addr, &ctx->cldap_sock); 125 124 TALLOC_FREE(server_addr); 126 125 if (!NT_STATUS_IS_OK(status)) { … … 158 157 struct in_addr local_ip, 159 158 struct packet_struct *p, 160 uint8_t *buf,159 const uint8_t *buf, 161 160 uint32_t len) 162 161 { … … 174 173 struct dgram_packet *dgram = &p->packet.dgram; 175 174 176 state = TALLOC_ZERO_P(ctx, struct nmbd_proxy_logon_state);175 state = talloc_zero(ctx, struct nmbd_proxy_logon_state); 177 176 if (!state) { 178 177 DEBUG(0,("failed to allocate nmbd_proxy_logon_state\n")); … … 250 249 state->io.in.map_response = false; 251 250 252 subreq = cldap_netlogon_send(state, 251 subreq = cldap_netlogon_send(state, nmbd_event_context(), 253 252 ctx->cldap_sock, 254 253 &state->io); … … 292 291 send_mailslot(true, state->remote_mailslot, 293 292 (char *)response.data, response.length, 294 global_myname(), 0x0,293 lp_netbios_name(), 0x0, 295 294 state->remote_name, 296 295 state->remote_name_type, … … 329 328 return; 330 329 } 331 ip = (( struct sockaddr_in *)pss)->sin_addr;332 333 if (! lp_domain_logons()) {330 ip = ((const struct sockaddr_in *)pss)->sin_addr; 331 332 if (!IS_DC) { 334 333 DEBUG(5,("process_logon_packet: Logon packet received from IP %s and domain \ 335 334 logons are not enabled.\n", inet_ntoa(p->ip) )); … … 339 338 pull_ascii_nstring(source_name, sizeof(source_name), dgram->source_name.name); 340 339 341 pdc_name = talloc_asprintf(talloc_tos(), "\\\\%s", global_myname());340 pdc_name = talloc_asprintf(talloc_tos(), "\\\\%s", lp_netbios_name()); 342 341 if (!pdc_name) { 343 342 return; … … 392 391 (char *)blob_out.data, 393 392 blob_out.length, 394 global_myname(), 0x0,393 lp_netbios_name(), 0x0, 395 394 source_name, 396 395 dgram->source_name.name_type, … … 412 411 request.req.pdc.computer_name, 413 412 inet_ntoa(p->ip), 414 global_myname(),413 lp_netbios_name(), 415 414 lp_workgroup(), 416 415 NETLOGON_RESPONSE_FROM_PDC, … … 420 419 421 420 get_pdc.command = NETLOGON_RESPONSE_FROM_PDC; 422 get_pdc.pdc_name = global_myname();421 get_pdc.pdc_name = lp_netbios_name(); 423 422 get_pdc._pad = data_blob_null; 424 get_pdc.unicode_pdc_name = global_myname();423 get_pdc.unicode_pdc_name = lp_netbios_name(); 425 424 get_pdc.domain_name = lp_workgroup(); 426 425 get_pdc.nt_version = NETLOGON_NT_VERSION_1; … … 444 443 (char *)blob_out.data, 445 444 blob_out.length, 446 global_myname(), 0x0,445 lp_netbios_name(), 0x0, 447 446 source_name, 448 447 dgram->source_name.name_type, … … 457 456 458 457 struct netlogon_samlogon_response samlogon; 458 struct NETLOGON_SAM_LOGON_RESPONSE_NT40 nt4; 459 459 460 460 if (global_nmbd_proxy_logon) { 461 461 nmbd_proxy_logon(global_nmbd_proxy_logon, 462 ip, p, ( uint8_t *)buf, len);462 ip, p, (const uint8_t *)buf, len); 463 463 return; 464 464 } … … 484 484 } 485 485 486 /* we want the simple version unless we are an ADS PDC..which means */ 487 /* never, at least for now */ 488 489 if ((request.req.logon.nt_version < (NETLOGON_NT_VERSION_1 | NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX_WITH_IP)) || 490 (SEC_ADS != lp_security()) || (ROLE_DOMAIN_PDC != lp_server_role())) { 491 492 struct NETLOGON_SAM_LOGON_RESPONSE_NT40 nt4; 493 494 nt4.command = user_unknown ? LOGON_SAM_LOGON_USER_UNKNOWN : 495 LOGON_SAM_LOGON_RESPONSE; 496 nt4.pdc_name = pdc_name; 497 nt4.user_name = request.req.logon.user_name; 498 nt4.domain_name = lp_workgroup(); 499 nt4.nt_version = NETLOGON_NT_VERSION_1; 500 nt4.lmnt_token = 0xffff; 501 nt4.lm20_token = 0xffff; 502 503 samlogon.ntver = NETLOGON_NT_VERSION_1; 504 samlogon.data.nt4 = nt4; 505 506 if (DEBUGLEVEL >= 10) { 507 NDR_PRINT_DEBUG(NETLOGON_SAM_LOGON_RESPONSE_NT40, &nt4); 508 } 509 } 510 #ifdef HAVE_ADS 511 else { 512 513 struct NETLOGON_SAM_LOGON_RESPONSE_EX nt5_ex; 514 struct GUID domain_guid; 515 struct nbt_sockaddr saddr; 516 char *domain; 517 const char *hostname; 518 519 saddr.sockaddr_family = 2; /* AF_INET */ 520 saddr.pdc_ip = inet_ntoa(ip); 521 saddr.remaining = data_blob_talloc_zero(talloc_tos(), 8); /* ??? */ 522 523 domain = get_mydnsdomname(talloc_tos()); 524 if (!domain) { 525 DEBUG(2,("get_mydnsdomname failed.\n")); 526 return; 527 } 528 529 hostname = get_mydnsfullname(); 530 if (!hostname) { 531 DEBUG(2,("get_mydnsfullname failed.\n")); 532 return; 533 } 534 535 if (!secrets_fetch_domain_guid(domain, &domain_guid)) { 536 DEBUG(2,("Could not fetch DomainGUID for %s\n", domain)); 537 return; 538 } 539 540 nt5_ex.command = user_unknown ? LOGON_SAM_LOGON_USER_UNKNOWN_EX : 541 LOGON_SAM_LOGON_RESPONSE_EX; 542 nt5_ex.sbz = 0; 543 nt5_ex.server_type = NBT_SERVER_PDC | 544 NBT_SERVER_GC | 545 NBT_SERVER_LDAP | 546 NBT_SERVER_DS | 547 NBT_SERVER_KDC | 548 NBT_SERVER_TIMESERV | 549 NBT_SERVER_CLOSEST | 550 NBT_SERVER_WRITABLE; 551 nt5_ex.domain_uuid = domain_guid; 552 nt5_ex.forest = domain; 553 nt5_ex.dns_domain = domain; 554 nt5_ex.pdc_dns_name = hostname; 555 nt5_ex.domain_name = lp_workgroup(); 556 nt5_ex.pdc_name = global_myname(); 557 nt5_ex.user_name = request.req.logon.user_name; 558 nt5_ex.server_site = "Default-First-Site-Name"; 559 nt5_ex.client_site = "Default-First-Site-Name"; 560 nt5_ex.sockaddr_size = 0x10; /* the w32 winsock addr size */ 561 nt5_ex.sockaddr = saddr; 562 nt5_ex.next_closest_site= NULL; 563 nt5_ex.nt_version = NETLOGON_NT_VERSION_1 | 564 NETLOGON_NT_VERSION_5EX | 565 NETLOGON_NT_VERSION_5EX_WITH_IP; 566 nt5_ex.lmnt_token = 0xffff; 567 nt5_ex.lm20_token = 0xffff; 568 569 samlogon.ntver = NETLOGON_NT_VERSION_1 | 570 NETLOGON_NT_VERSION_5EX | 571 NETLOGON_NT_VERSION_5EX_WITH_IP; 572 samlogon.data.nt5_ex = nt5_ex; 573 574 if (DEBUGLEVEL >= 10) { 575 NDR_PRINT_DEBUG(NETLOGON_SAM_LOGON_RESPONSE_EX, &nt5_ex); 576 } 577 } 578 #endif /* HAVE_ADS */ 486 nt4.command = user_unknown ? LOGON_SAM_LOGON_USER_UNKNOWN : 487 LOGON_SAM_LOGON_RESPONSE; 488 nt4.pdc_name = pdc_name; 489 nt4.user_name = request.req.logon.user_name; 490 nt4.domain_name = lp_workgroup(); 491 nt4.nt_version = NETLOGON_NT_VERSION_1; 492 nt4.lmnt_token = 0xffff; 493 nt4.lm20_token = 0xffff; 494 495 samlogon.ntver = NETLOGON_NT_VERSION_1; 496 samlogon.data.nt4 = nt4; 497 498 if (DEBUGLEVEL >= 10) { 499 NDR_PRINT_DEBUG(NETLOGON_SAM_LOGON_RESPONSE_NT40, &nt4); 500 } 579 501 580 502 response.response_type = NETLOGON_SAMLOGON; … … 584 506 if (!NT_STATUS_IS_OK(status)) { 585 507 DEBUG(0,("process_logon_packet: failed to push packet\n")); 508 SAFE_FREE(source_addr); 586 509 return; 587 510 } … … 605 528 lp_init_logon_delay())); 606 529 607 when = timeval_current_ofs(0, 608 lp_init_logon_delay() * 1000); 530 when = timeval_current_ofs_msec(lp_init_logon_delay()); 609 531 p->locked = true; 610 event_add_timed(nmbd_event_context(),532 tevent_add_timer(nmbd_event_context(), 611 533 NULL, 612 534 when, … … 623 545 (char *)blob_out.data, 624 546 blob_out.length, 625 global_myname(), 0x0,547 lp_netbios_name(), 0x0, 626 548 source_name, 627 549 dgram->source_name.name_type, -
vendor/current/source3/nmbd/nmbd_proto.h
r740 r988 29 29 int asyncdns_fd(void); 30 30 void kill_async_dns_child(void); 31 void start_async_dns( void);32 void run_dns_queue( void);31 void start_async_dns(struct messaging_context *msg); 32 void run_dns_queue(struct messaging_context *msg); 33 33 bool queue_dns_query(struct packet_struct *p,struct nmb_name *question); 34 34 bool queue_dns_query(struct packet_struct *p,struct nmb_name *question); … … 37 37 /* The following definitions come from nmbd/nmbd.c */ 38 38 39 struct event_context *nmbd_event_context(void); 40 struct messaging_context *nmbd_messaging_context(void); 39 struct tevent_context *nmbd_event_context(void); 41 40 42 41 /* The following definitions come from nmbd/nmbd_become_dmb.c */ … … 47 46 48 47 void insert_permanent_name_into_unicast( struct subnet_record *subrec, 49 struct nmb_name *nmbname, uint16 nb_type );48 struct nmb_name *nmbname, uint16_t nb_type ); 50 49 void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work, 51 50 bool force_new_election); … … 139 138 const char *name, 140 139 int type, 141 uint16 nb_flags,140 uint16_t nb_flags, 142 141 int ttl, 143 142 enum name_source source, … … 146 145 void standard_success_register(struct subnet_record *subrec, 147 146 struct userdata_struct *userdata, 148 struct nmb_name *nmbname, uint16 nb_flags, int ttl,147 struct nmb_name *nmbname, uint16_t nb_flags, int ttl, 149 148 struct in_addr registered_ip); 150 149 void standard_fail_register( struct subnet_record *subrec, … … 178 177 179 178 void register_name(struct subnet_record *subrec, 180 const char *name, int type, uint16 nb_flags,179 const char *name, int type, uint16_t nb_flags, 181 180 register_name_success_function success_fn, 182 181 register_name_fail_function fail_fn, … … 201 200 bool nmbd_init_packet_server(void); 202 201 203 uint16 get_nb_flags(char *buf);204 void set_nb_flags(char *buf, uint16 nb_flags);202 uint16_t get_nb_flags(char *buf); 203 void set_nb_flags(char *buf, uint16_t nb_flags); 205 204 struct response_record *queue_register_name( struct subnet_record *subrec, 206 205 response_function resp_fn, … … 210 209 struct userdata_struct *userdata, 211 210 struct nmb_name *nmbname, 212 uint16 nb_flags);211 uint16_t nb_flags); 213 212 void queue_wins_refresh(struct nmb_name *nmbname, 214 213 response_function resp_fn, 215 214 timeout_response_function timeout_fn, 216 uint16 nb_flags,215 uint16_t nb_flags, 217 216 struct in_addr refresh_ip, 218 217 const char *tag); … … 224 223 struct userdata_struct *userdata, 225 224 struct nmb_name *nmbname, 226 uint16 nb_flags,225 uint16_t nb_flags, 227 226 struct in_addr register_ip, 228 227 struct in_addr wins_ip); … … 234 233 struct userdata_struct *userdata, 235 234 struct nmb_name *nmbname, 236 uint16 nb_flags,235 uint16_t nb_flags, 237 236 struct in_addr release_ip, 238 237 struct in_addr dest_ip); … … 265 264 void run_packet_queue(void); 266 265 void retransmit_or_expire_response_records(time_t t); 267 bool listen_for_packets( bool run_election);266 bool listen_for_packets(struct messaging_context *msg, bool run_election); 268 267 bool send_mailslot(bool unique, const char *mailslot,char *buf, size_t len, 269 268 const char *srcname, int src_type, … … 291 290 struct userdata_struct *userdata); 292 291 struct response_record *find_response_record(struct subnet_record **ppsubrec, 293 uint16 id);292 uint16_t id); 294 293 bool is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec); 295 294 … … 316 315 void update_server_ttl(struct server_record *servrec, int ttl); 317 316 void expire_servers(struct work_record *work, time_t t); 318 void write_browse_list_entry(XFILE *fp, const char *name, uint32 rec_type,317 void write_browse_list_entry(XFILE *fp, const char *name, uint32_t rec_type, 319 318 const char *local_master_browser_name, const char *description); 320 319 void write_browse_list(time_t t, bool force_write); -
vendor/current/source3/nmbd/nmbd_responserecordsdb.c
r740 r988 38 38 rrec->response_id, subrec->subnet_name, num_response_packets)); 39 39 40 DLIST_ADD_END(subrec->responselist, rrec , struct response_record *);40 DLIST_ADD_END(subrec->responselist, rrec); 41 41 } 42 42 … … 170 170 171 171 static struct response_record *find_response_record_on_subnet( 172 struct subnet_record *subrec, uint16 id)172 struct subnet_record *subrec, uint16_t id) 173 173 { 174 174 struct response_record *rrec = NULL; … … 189 189 190 190 struct response_record *find_response_record(struct subnet_record **ppsubrec, 191 uint16 id)191 uint16_t id) 192 192 { 193 193 struct response_record *rrec = NULL; -
vendor/current/source3/nmbd/nmbd_sendannounce.c
r740 r988 51 51 52 52 send_mailslot(True, BROWSE_MAILSLOT, outbuf,PTR_DIFF(p,outbuf), 53 global_myname(), 0x0, to_name, to_type, to_ip,53 lp_netbios_name(), 0x0, to_name, to_type, to_ip, 54 54 FIRST_SUBNET->myip, DGRAM_PORT); 55 55 } … … 77 77 SCVAL(p,0,work->token); /* (local) Unique workgroup token id. */ 78 78 p++; 79 p += push_string_check(p+1, global_myname(), 15, STR_ASCII|STR_UPPER|STR_TERMINATE);79 p += push_string_check(p+1, lp_netbios_name(), 15, STR_ASCII|STR_UPPER|STR_TERMINATE); 80 80 81 81 send_mailslot(False, BROWSE_MAILSLOT, outbuf,PTR_DIFF(p,outbuf), 82 global_myname(), 0x0, work->work_group,0x1e, subrec->bcast_ip,82 lp_netbios_name(), 0x0, work->work_group,0x1e, subrec->bcast_ip, 83 83 subrec->myip, DGRAM_PORT); 84 84 } … … 106 106 SIVAL(p,1,announce_interval*1000); /* Milliseconds - despite the spec. */ 107 107 108 safe_strcpy(upper_server_name, server_name, sizeof(upper_server_name)-1); 109 strupper_m(upper_server_name); 108 strlcpy(upper_server_name, server_name ? server_name : "", sizeof(upper_server_name)); 109 if (!strupper_m(upper_server_name)) { 110 DEBUG(2,("strupper_m %s failed\n", upper_server_name)); 111 return; 112 } 110 113 push_string_check(p+5, upper_server_name, 16, STR_ASCII|STR_TERMINATE); 111 114 112 SCVAL(p,21, lp_major_announce_version()); /* Major version. */113 SCVAL(p,22, lp_minor_announce_version()); /* Minor version. */115 SCVAL(p,21,SAMBA_MAJOR_NBT_ANNOUNCE_VERSION); /* Major version. */ 116 SCVAL(p,22,SAMBA_MINOR_NBT_ANNOUNCE_VERSION); /* Minor version. */ 114 117 115 118 SIVAL(p,23,server_type & ~SV_TYPE_LOCAL_LIST_ONLY); … … 141 144 SSVAL(p,0,announce_type); 142 145 SIVAL(p,2,server_type & ~SV_TYPE_LOCAL_LIST_ONLY); 143 SCVAL(p,6, lp_major_announce_version()); /* Major version. */144 SCVAL(p,7, lp_minor_announce_version()); /* Minor version. */146 SCVAL(p,6,SAMBA_MAJOR_NBT_ANNOUNCE_VERSION); /* Major version. */ 147 SCVAL(p,7,SAMBA_MINOR_NBT_ANNOUNCE_VERSION); /* Minor version. */ 145 148 SSVAL(p,8,announce_interval); /* In seconds - according to spec. */ 146 149 … … 162 165 { 163 166 /* Ensure we don't have the prohibited bit set. */ 164 uint32 type = servrec->serv.type & ~SV_TYPE_LOCAL_LIST_ONLY;167 uint32_t type = servrec->serv.type & ~SV_TYPE_LOCAL_LIST_ONLY; 165 168 166 169 DEBUG(3,("send_local_master_announcement: type %x for name %s on subnet %s for workgroup %s\n", 167 type, global_myname(), subrec->subnet_name, work->work_group));170 type, lp_netbios_name(), subrec->subnet_name, work->work_group)); 168 171 169 172 send_announcement(subrec, ANN_LocalMasterAnnouncement, 170 global_myname(), /* From nbt name. */173 lp_netbios_name(), /* From nbt name. */ 171 174 work->work_group, 0x1e, /* To nbt name. */ 172 175 subrec->bcast_ip, /* To ip. */ 173 176 work->announce_interval, /* Time until next announce. */ 174 global_myname(), /* Name to announce. */177 lp_netbios_name(), /* Name to announce. */ 175 178 type, /* Type field. */ 176 179 servrec->serv.comment); … … 187 190 188 191 send_announcement(subrec, ANN_DomainAnnouncement, 189 global_myname(), /* From nbt name. */192 lp_netbios_name(), /* From nbt name. */ 190 193 MSBROWSE, 0x1, /* To nbt name. */ 191 194 subrec->bcast_ip, /* To ip. */ … … 193 196 work->work_group, /* Name to announce. */ 194 197 SV_TYPE_DOMAIN_ENUM|SV_TYPE_NT, /* workgroup announce flags. */ 195 global_myname()); /* From name as comment. */198 lp_netbios_name()); /* From name as comment. */ 196 199 } 197 200 … … 204 207 { 205 208 /* Ensure we don't have the prohibited bits set. */ 206 uint32 type = servrec->serv.type & ~SV_TYPE_LOCAL_LIST_ONLY;209 uint32_t type = servrec->serv.type & ~SV_TYPE_LOCAL_LIST_ONLY; 207 210 208 211 DEBUG(3,("send_host_announcement: type %x for host %s on subnet %s for workgroup %s\n", … … 227 230 { 228 231 /* Ensure we don't have the prohibited bits set. */ 229 uint32 type = servrec->serv.type & ~SV_TYPE_LOCAL_LIST_ONLY;232 uint32_t type = servrec->serv.type & ~SV_TYPE_LOCAL_LIST_ONLY; 230 233 231 234 DEBUG(3,("send_lm_host_announcement: type %x for host %s on subnet %s for workgroup %s, ttl: %d\n", … … 252 255 our primary name we're being asked to announce. */ 253 256 254 if (AM_LOCAL_MASTER_BROWSER(work) && strequal( global_myname(),servrec->serv.name)) {257 if (AM_LOCAL_MASTER_BROWSER(work) && strequal(lp_netbios_name(),servrec->serv.name)) { 255 258 send_local_master_announcement(subrec, work, servrec); 256 259 send_workgroup_announcement(subrec, work); … … 471 474 last_time = t; 472 475 473 s = lp_remote_announce( );476 s = lp_remote_announce(talloc_tos()); 474 477 if (!*s) 475 478 return; 476 479 477 comment = string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH); 480 comment = string_truncate(lp_server_string(talloc_tos()), 481 MAX_SERVER_STRING_LENGTH); 478 482 479 483 frame = talloc_stackframe(); … … 541 545 last_time = t; 542 546 543 s = lp_remote_browse_sync( );547 s = lp_remote_browse_sync(talloc_tos()); 544 548 if (!*s) 545 549 return; … … 567 571 p++; 568 572 569 unstrcpy(myname, global_myname()); 570 strupper_m(myname); 573 unstrcpy(myname, lp_netbios_name()); 574 if (!strupper_m(myname)) { 575 DEBUG(2,("strupper_m %s failed\n", myname)); 576 return; 577 } 571 578 myname[15]='\0'; 572 579 push_ascii(p, myname, sizeof(outbuf)-PTR_DIFF(p,outbuf)-1, STR_TERMINATE); … … 580 587 581 588 DEBUG(5,("announce_remote: Doing remote browse sync announce for server %s to IP %s.\n", 582 global_myname(), inet_ntoa(addr) ));589 lp_netbios_name(), inet_ntoa(addr) )); 583 590 584 591 send_mailslot(True, BROWSE_MAILSLOT, outbuf,PTR_DIFF(p,outbuf), 585 global_myname(), 0x0, "*", 0x0, addr, FIRST_SUBNET->myip, DGRAM_PORT);592 lp_netbios_name(), 0x0, "*", 0x0, addr, FIRST_SUBNET->myip, DGRAM_PORT); 586 593 } 587 594 TALLOC_FREE(frame); -
vendor/current/source3/nmbd/nmbd_serverlistdb.c
r740 r988 55 55 struct server_record *servrec) 56 56 { 57 DLIST_ADD_END(work->serverlist, servrec , struct server_record *);57 DLIST_ADD_END(work->serverlist, servrec); 58 58 work->subnet->work_changed = True; 59 59 } … … 120 120 fstrcpy(servrec->serv.name,name); 121 121 fstrcpy(servrec->serv.comment,comment); 122 strupper_m(servrec->serv.name); 122 if (!strupper_m(servrec->serv.name)) { 123 DEBUG(2,("strupper_m %s failed\n", servrec->serv.name)); 124 SAFE_FREE(servrec); 125 return NULL; 126 } 123 127 servrec->serv.type = servertype; 124 128 … … 130 134 workgroup %s.\n", name,servertype,comment, work->work_group)); 131 135 132 work->subnet->work_changed = True;133 134 136 return(servrec); 135 137 } … … 148 150 else 149 151 servrec->death_time = (ttl != PERMANENT_TTL) ? time(NULL)+(ttl*3) : PERMANENT_TTL; 150 151 servrec->subnet->work_changed = True;152 152 } 153 153 … … 169 169 DEBUG(3,("expire_old_servers: Removing timed out server %s\n",servrec->serv.name)); 170 170 remove_server_from_workgroup(work, servrec); 171 work->subnet->work_changed = True;172 171 } 173 172 } … … 180 179 ******************************************************************/ 181 180 182 static uint32 write_this_server_name( struct subnet_record *subrec,181 static uint32_t write_this_server_name( struct subnet_record *subrec, 183 182 struct work_record *work, 184 183 struct server_record *servrec) … … 218 217 ******************************************************************/ 219 218 220 static uint32 write_this_workgroup_name( struct subnet_record *subrec,219 static uint32_t write_this_workgroup_name( struct subnet_record *subrec, 221 220 struct work_record *work) 222 221 { … … 250 249 ******************************************************************/ 251 250 252 void write_browse_list_entry(XFILE *fp, const char *name, uint32 rec_type,251 void write_browse_list_entry(XFILE *fp, const char *name, uint32_t rec_type, 253 252 const char *local_master_browser_name, const char *description) 254 253 { … … 270 269 char *fname; 271 270 char *fnamenew; 272 uint32 stype;271 uint32_t stype; 273 272 int i; 274 273 XFILE *fp; … … 308 307 fname); 309 308 if (!fnamenew) { 309 talloc_free(fname); 310 310 return; 311 311 } … … 316 316 DEBUG(0,("write_browse_list: Can't open file %s. Error was %s\n", 317 317 fnamenew,strerror(errno))); 318 talloc_free(fnamenew); 319 talloc_free(fname); 318 320 return; 319 321 } … … 328 330 lp_workgroup())); 329 331 x_fclose(fp); 332 talloc_free(fnamenew); 333 talloc_free(fname); 330 334 return; 331 335 } … … 356 360 /* Output server details, plus what workgroup they're in. */ 357 361 write_browse_list_entry(fp, my_netbios_names(i), stype, 358 string_truncate(lp_server string(), MAX_SERVER_STRING_LENGTH), lp_workgroup());362 string_truncate(lp_server_string(talloc_tos()), MAX_SERVER_STRING_LENGTH), lp_workgroup()); 359 363 } 360 364 … … 364 368 for (work = subrec->workgrouplist; work ; work = work->next) { 365 369 /* Write out a workgroup record for a workgroup. */ 366 uint32 wg_type = write_this_workgroup_name( subrec, work);370 uint32_t wg_type = write_this_workgroup_name( subrec, work); 367 371 368 372 if(wg_type) { … … 375 379 376 380 for (servrec = work->serverlist; servrec ; servrec = servrec->next) { 377 uint32 serv_type;381 uint32_t serv_type; 378 382 379 383 /* We have already written our names here. */ … … 396 400 rename(fnamenew,fname); 397 401 DEBUG(3,("write_browse_list: Wrote browse list into file %s\n",fname)); 398 } 402 talloc_free(fnamenew); 403 talloc_free(fname); 404 } -
vendor/current/source3/nmbd/nmbd_subnetdb.c
r740 r988 38 38 struct subnet_record *wins_server_subnet = NULL; 39 39 40 extern uint16 samba_nb_type; /* Samba's NetBIOS name type. */40 extern uint16_t samba_nb_type; /* Samba's NetBIOS name type. */ 41 41 42 42 /**************************************************************************** … … 248 248 /* Only count IPv4, non-loopback interfaces. */ 249 249 if (iface_count_v4_nl() == 0) { 250 DEBUG(0,("create_subnets: No local IPv4 non-loopback interfaces !\n")); 251 DEBUG(0,("create_subnets: Waiting for an interface to appear ...\n")); 250 daemon_status("nmbd", 251 "No local IPv4 non-loopback interfaces " 252 "available, waiting for interface ..."); 253 DEBUG(0,("NOTE: NetBIOS name resolution is not supported for " 254 "Internet Protocol Version 6 (IPv6).\n")); 252 255 } 253 256 … … 305 308 */ 306 309 307 if (is_loopback_addr(( struct sockaddr *)&iface->ip)) {310 if (is_loopback_addr((const struct sockaddr *)&iface->ip)) { 308 311 DEBUG(2,("create_subnets: Ignoring loopback interface.\n" )); 309 312 continue; -
vendor/current/source3/nmbd/nmbd_synclists.c
r740 r988 5 5 Copyright (C) Luke Kenneth Casson Leighton 1994-1998 6 6 Copyright (C) Jeremy Allison 1994-1998 7 7 8 8 This program is free software; you can redistribute it and/or modify 9 9 it under the terms of the GNU General Public License as published by 10 10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 13 13 This program is distributed in the hope that it will be useful, 14 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 16 GNU General Public License for more details. 17 17 18 18 You should have received a copy of the GNU General Public License 19 19 along with this program. If not, see <http://www.gnu.org/licenses/>. 20 21 20 */ 22 21 … … 33 32 #include "libsmb/libsmb.h" 34 33 #include "libsmb/clirap.h" 35 #include " smbprofile.h"34 #include "../libcli/smb/smbXcli_base.h" 36 35 37 36 struct sync_record { … … 54 53 ******************************************************************/ 55 54 56 static void callback(const char *sname, uint32 stype,55 static void callback(const char *sname, uint32_t stype, 57 56 const char *comment, void *state) 58 57 { … … 73 72 fstring unix_workgroup; 74 73 struct cli_state *cli; 75 uint32 local_type = local ? SV_TYPE_LOCAL_LIST_ONLY : 0; 76 struct nmb_name called, calling; 74 uint32_t local_type = local ? SV_TYPE_LOCAL_LIST_ONLY : 0; 77 75 struct sockaddr_storage ss; 78 76 NTSTATUS status; … … 82 80 */ 83 81 84 cli = cli_initialise();85 if (!cli) {86 return;87 }88 89 cli_set_port(cli, 139);90 91 82 in_addr_to_sockaddr_storage(&ss, ip); 92 status = cli_connect(cli, name, &ss); 83 84 status = cli_connect_nb(name, &ss, NBT_SMB_PORT, nm_type, 85 get_local_machine_name(), SMB_SIGNING_DEFAULT, 86 0, &cli); 93 87 if (!NT_STATUS_IS_OK(status)) { 94 cli_shutdown(cli); 95 return; 96 } 97 98 make_nmb_name(&calling, get_local_machine_name(), 0x0); 99 make_nmb_name(&called , name, nm_type); 100 101 if (!cli_session_request(cli, &calling, &called)) { 102 cli_shutdown(cli); 103 return; 104 } 105 106 status = cli_negprot(cli); 88 return; 89 } 90 91 status = smbXcli_negprot(cli->conn, cli->timeout, PROTOCOL_CORE, 92 PROTOCOL_NT1); 107 93 if (!NT_STATUS_IS_OK(status)) { 108 94 cli_shutdown(cli); … … 116 102 } 117 103 118 if (!NT_STATUS_IS_OK(cli_t con_andx(cli, "IPC$", "IPC", "", 1))) {104 if (!NT_STATUS_IS_OK(cli_tree_connect(cli, "IPC$", "IPC", "", 1))) { 119 105 cli_shutdown(cli); 120 106 return; … … 128 114 local_type|SV_TYPE_DOMAIN_ENUM, 129 115 callback, NULL); 130 116 131 117 /* Now fetch a server list. */ 132 118 if (servers) { … … 136 122 callback, NULL); 137 123 } 138 124 139 125 cli_shutdown(cli); 140 126 } … … 153 139 static int counter; 154 140 155 START_PROFILE(sync_browse_lists);156 141 /* Check we're not trying to sync with ourselves. This can 157 142 happen if we are a domain *and* a local master browser. */ 158 143 if (ismyip_v4(ip)) { 159 144 done: 160 END_PROFILE(sync_browse_lists);161 145 return; 162 146 } … … 171 155 s->ip = ip; 172 156 173 if (asprintf(&s->fname, "%s/sync.%d", lp_lock dir(), counter++) < 0) {157 if (asprintf(&s->fname, "%s/sync.%d", lp_lock_directory(), counter++) < 0) { 174 158 SAFE_FREE(s); 175 159 goto done; … … 181 165 182 166 /* the parent forks and returns, leaving the child to do the 183 actual sync and call END_PROFILE*/167 actual sync */ 184 168 CatchChild(); 185 if ((s->pid = sys_fork())) return;169 if ((s->pid = fork())) return; 186 170 187 171 BlockSignals( False, SIGTERM ); … … 192 176 fp = x_fopen(s->fname,O_WRONLY|O_CREAT|O_TRUNC, 0644); 193 177 if (!fp) { 194 END_PROFILE(sync_browse_lists);195 178 _exit(1); 196 179 } … … 200 183 201 184 x_fclose(fp); 202 END_PROFILE(sync_browse_lists);203 185 _exit(0); 204 186 } … … 209 191 210 192 static void complete_one(struct sync_record *s, 211 char *sname, uint32 stype, char *comment)193 char *sname, uint32_t stype, char *comment) 212 194 { 213 195 struct work_record *work; -
vendor/current/source3/nmbd/nmbd_winsproxy.c
r740 r988 35 35 struct subnet_record *orig_broadcast_subnet; 36 36 struct name_record *namerec = NULL; 37 uint16 nb_flags;37 uint16_t nb_flags; 38 38 int num_ips; 39 39 int i; -
vendor/current/source3/nmbd/nmbd_winsserver.c
r746 r988 9 9 the Free Software Foundation; either version 3 of the License, or 10 10 (at your option) any later version. 11 11 12 12 This program is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 15 GNU General Public License for more details. 16 16 17 17 You should have received a copy of the GNU General Public License 18 18 along with this program. If not, see <http://www.gnu.org/licenses/>. 19 19 20 20 Converted to store WINS data in a tdb. Dec 2005. JRA. 21 21 */ … … 76 76 77 77 /**************************************************************************** 78 Convert a wins.tdb record to a struct name_record. Add in our global_scope().78 Convert a wins.tdb record to a struct name_record. Add in our lp_netbios_scope(). 79 79 *****************************************************************************/ 80 80 … … 82 82 { 83 83 struct name_record *namerec = NULL; 84 uint16 nb_flags;84 uint16_t nb_flags; 85 85 unsigned char nr_src; 86 uint32 death_time, refresh_time;87 uint32 id_low, id_high;88 uint32 saddr;89 uint32 wins_flags;90 uint32 num_ips;86 uint32_t death_time, refresh_time; 87 uint32_t id_low, id_high; 88 uint32_t saddr; 89 uint32_t wins_flags; 90 uint32_t num_ips; 91 91 size_t len; 92 92 int i; … … 129 129 namerec->name.name_type = key.dptr[sizeof(unstring)]; 130 130 /* Add the scope. */ 131 push_ascii(namerec->name.scope, global_scope(), 64, STR_TERMINATE);131 push_ascii(namerec->name.scope, lp_netbios_scope(), 64, STR_TERMINATE); 132 132 133 133 /* We're using a byte-by-byte compare, so we must be sure that 134 134 * unused space doesn't have garbage in it. 135 135 */ 136 136 137 137 for( i = strlen( namerec->name.name ); i < sizeof( namerec->name.name ); i++ ) { 138 138 namerec->name.name[i] = '\0'; … … 147 147 namerec->data.refresh_time = (time_t)refresh_time; 148 148 namerec->data.id = id_low; 149 #if defined(HAVE_LONGLONG)150 149 namerec->data.id |= ((uint64_t)id_high << 32); 151 #endif152 150 namerec->data.wins_ip.s_addr = saddr; 153 151 namerec->data.wins_flags = wins_flags, … … 170 168 size_t len = 0; 171 169 int i; 172 uint32 id_low = (namerec->data.id & 0xFFFFFFFF); 173 #if defined(HAVE_LONGLONG) 174 uint32 id_high = (namerec->data.id >> 32) & 0xFFFFFFFF; 175 #else 176 uint32 id_high = 0; 177 #endif 170 uint32_t id_low = (namerec->data.id & 0xFFFFFFFF); 171 uint32_t id_high = (namerec->data.id >> 32) & 0xFFFFFFFF; 178 172 179 173 ZERO_STRUCT(data); … … 182 176 len += (namerec->data.num_ips * 4); 183 177 184 data.dptr = (uint8 *)SMB_MALLOC(len);178 data.dptr = (uint8_t *)SMB_MALLOC(len); 185 179 if (!data.dptr) { 186 180 return data; … … 191 185 namerec->data.nb_flags, 192 186 (unsigned char)namerec->data.source, 193 (uint32 )namerec->data.death_time,194 (uint32 )namerec->data.refresh_time,187 (uint32_t)namerec->data.death_time, 188 (uint32_t)namerec->data.refresh_time, 195 189 id_low, 196 190 id_high, 197 (uint32 )namerec->data.wins_ip.s_addr,198 (uint32 )namerec->data.wins_flags,199 (uint32 )namerec->data.num_ips );191 (uint32_t)namerec->data.wins_ip.s_addr, 192 (uint32_t)namerec->data.wins_flags, 193 (uint32_t)namerec->data.num_ips ); 200 194 201 195 for (i = 0; i < namerec->data.num_ips; i++) { … … 218 212 219 213 pull_ascii_nstring(keydata, sizeof(unstring), nmbname->name); 220 strupper_m(keydata);214 (void)strupper_m(keydata); 221 215 keydata[sizeof(unstring)] = nmbname->name_type; 222 key.dptr = (uint8 *)keydata;216 key.dptr = (uint8_t *)keydata; 223 217 key.dsize = sizeof(keydata); 224 218 … … 277 271 } 278 272 } 279 273 280 274 DLIST_ADD(wins_server_subnet->namelist, namerec); 281 275 return namerec; … … 446 440 447 441 DEBUG(5,("get_global_id_and_update: updating version ID: %d\n", (int)general_id)); 448 442 449 443 *current_id = general_id; 450 444 451 445 if (update) { 452 446 general_id++; … … 462 456 { 463 457 char *command = NULL; 464 char *cmd = lp_wins_hook( );458 char *cmd = lp_wins_hook(talloc_tos()); 465 459 char *p, *namestr; 466 460 int i; … … 479 473 } 480 474 } 481 475 482 476 /* Use the name without the nametype (and scope) appended */ 483 477 … … 601 595 XFILE *fp; 602 596 char line[1024]; 597 char *db_path; 598 char *list_path; 603 599 604 600 if(!lp_we_are_a_wins_server()) { … … 606 602 } 607 603 604 db_path = state_path("wins.tdb"); 605 if (db_path == NULL) { 606 return false; 607 } 608 608 609 /* Open the wins.tdb. */ 609 wins_tdb = tdb_open_log( state_path("wins.tdb"), 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,610 wins_tdb = tdb_open_log(db_path, 0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, 610 611 O_CREAT|O_RDWR, 0600); 612 TALLOC_FREE(db_path); 611 613 if (!wins_tdb) { 612 614 DEBUG(0,("initialise_wins: failed to open wins.tdb. Error was %s\n", … … 619 621 add_samba_names_to_subnet(wins_server_subnet); 620 622 621 if((fp = x_fopen(state_path(WINS_LIST),O_RDONLY,0)) == NULL) { 623 list_path = state_path(WINS_LIST); 624 if (list_path == NULL) { 625 tdb_close(wins_tdb); 626 return false; 627 } 628 629 fp = x_fopen(list_path, O_RDONLY, 0); 630 TALLOC_FREE(list_path); 631 if (fp == NULL) { 622 632 DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n", 623 633 WINS_LIST, strerror(errno) )); … … 853 863 struct nmb_name *question = &nmb->question.question_name; 854 864 bool bcast = nmb->header.nm_flags.bcast; 855 uint16 nb_flags = get_nb_flags(nmb->additional->rdata);865 uint16_t nb_flags = get_nb_flags(nmb->additional->rdata); 856 866 bool group = (nb_flags & NB_GROUP) ? True : False; 857 867 struct name_record *namerec = NULL; … … 1160 1170 struct nmb_name *question = &nmb->question.question_name; 1161 1171 bool bcast = nmb->header.nm_flags.bcast; 1162 uint16 nb_flags = get_nb_flags(nmb->additional->rdata);1172 uint16_t nb_flags = get_nb_flags(nmb->additional->rdata); 1163 1173 int ttl = get_ttl_from_packet(nmb); 1164 1174 struct name_record *namerec = NULL; … … 1610 1620 struct nmb_name *question = &nmb->question.question_name; 1611 1621 bool bcast = nmb->header.nm_flags.bcast; 1612 uint16 nb_flags = get_nb_flags(nmb->additional->rdata);1622 uint16_t nb_flags = get_nb_flags(nmb->additional->rdata); 1613 1623 int ttl = get_ttl_from_packet(nmb); 1614 1624 struct name_record *namerec = NULL; … … 1675 1685 namerec = NULL; 1676 1686 } 1677 1687 1678 1688 /* 1679 1689 * Deal with the case where the name found was a dns entry. … … 1768 1778 update_wins_flag(namerec, WINS_ACTIVE); 1769 1779 } 1770 1780 1771 1781 wins_hook("refresh", namerec, ttl); 1772 1782 send_wins_name_registration_response(0, ttl, p); … … 1878 1888 Deal with the special name query for *<1b>. 1879 1889 ***********************************************************************/ 1880 1881 static void process_wins_dmb_query_request(struct subnet_record *subrec, 1890 1891 static void process_wins_dmb_query_request(struct subnet_record *subrec, 1882 1892 struct packet_struct *p) 1883 { 1893 { 1884 1894 struct name_record *namerec = NULL; 1885 1895 char *prdata; … … 2093 2103 */ 2094 2104 2095 if(lp_ dns_proxy() && ((question->name_type == 0x20) || question->name_type == 0)) {2105 if(lp_wins_dns_proxy() && ((question->name_type == 0x20) || question->name_type == 0)) { 2096 2106 DEBUG(3,("wins_process_name_query: name query for name %s not found - doing dns lookup.\n", 2097 2107 nmb_namestr(question) )); … … 2138 2148 struct nmb_name *question = &nmb->question.question_name; 2139 2149 bool bcast = nmb->header.nm_flags.bcast; 2140 uint16 nb_flags = get_nb_flags(nmb->additional->rdata);2150 uint16_t nb_flags = get_nb_flags(nmb->additional->rdata); 2141 2151 struct name_record *namerec = NULL; 2142 2152 struct in_addr from_ip; … … 2157 2167 return; 2158 2168 } 2159 2169 2160 2170 DEBUG(3,("wins_process_name_release_request: %s name release for name %s \ 2161 2171 IP %s\n", releasing_group_name ? "Group" : "Unique", nmb_namestr(question), inet_ntoa(from_ip) )); 2162 2172 2163 2173 /* 2164 2174 * Deal with policy regarding 0x1d names. … … 2175 2185 * See if the name already exists. 2176 2186 */ 2177 2187 2178 2188 namerec = find_name_on_subnet(subrec, question, FIND_ANY_NAME); 2179 2189 … … 2471 2481 if (background) { 2472 2482 CatchChild(); 2473 if ( sys_fork()) {2483 if (fork()) { 2474 2484 return; 2475 2485 } … … 2488 2498 all_string_sub(fname,"//", "/", 0); 2489 2499 2490 if (asprintf(&fnamenew, "%s.%u", fname, (unsigned int) sys_getpid()) < 0) {2500 if (asprintf(&fnamenew, "%s.%u", fname, (unsigned int)getpid()) < 0) { 2491 2501 goto err_exit; 2492 2502 } … … 2542 2552 return; 2543 2553 } 2544 2554 2545 2555 /* Record should use UNIX codepage. Ensure this is so in the wrepld code. JRA. */ 2546 2556 record=(WINS_RECORD *)buf; 2547 2557 2548 2558 make_nmb_name(&question, record->name, record->type); 2549 2559 … … 2593 2603 else 2594 2604 overwrite=True; 2595 2605 2596 2606 } else { 2597 2607 /* the 2 records have different IP address */ … … 2608 2618 } 2609 2619 } 2610 2620 2611 2621 /* the replica is a standard group */ 2612 2622 if (record->wins_flags&WINS_NGROUP || record->wins_flags&WINS_SGROUP) { … … 2616 2626 ; 2617 2627 overwrite=True; 2618 2619 } 2620 2628 2629 } 2630 2621 2631 /* the replica is a special group */ 2622 2632 if (record->wins_flags&WINS_SGROUP && namerec->data.wins_flags&WINS_SGROUP) { … … 2629 2639 } 2630 2640 } 2631 2641 2632 2642 /* the replica is a multihomed host */ 2633 2643 2634 2644 /* I'm giving up on multi homed. Too much complex to understand */ 2635 2645 2636 2646 if (record->wins_flags&WINS_MHOMED) { 2637 2647 if (! (namerec->data.wins_flags&WINS_ACTIVE)) { … … 2642 2652 if (ip_equal_v4(record->wins_ip, namerec->data.wins_ip)) 2643 2653 overwrite=True; 2644 2654 2645 2655 if (ip_equal_v4(namerec->data.wins_ip, our_fake_ip)) 2646 2656 if (namerec->data.wins_flags&WINS_UNIQUE) 2647 2657 get_global_id_and_update(&namerec->data.id, True); 2648 2658 2649 2659 } 2650 2660 2651 2661 if (record->wins_flags&WINS_ACTIVE && namerec->data.wins_flags&WINS_ACTIVE) 2652 2662 if (namerec->data.wins_flags&WINS_UNIQUE || … … 2654 2664 if (ip_equal_v4(record->wins_ip, namerec->data.wins_ip)) 2655 2665 overwrite=True; 2656 2666 2657 2667 } 2658 2668 -
vendor/current/source3/nmbd/nmbd_workgroupdb.c
r740 r988 25 25 #include "nmbd/nmbd.h" 26 26 27 extern uint16 samba_nb_type;27 extern uint16_t samba_nb_type; 28 28 29 29 int workgroup_count = 0; /* unique index key: one for each workgroup */ … … 53 53 unstring tname; 54 54 pull_ascii_nstring(tname, sizeof(tname), nname); 55 unstrcpy(unname, tname);55 strlcpy(unname, tname, sizeof(nname)); 56 56 DEBUG(0,("name_to_nstring: workgroup name %s is too long. Truncating to %s\n", 57 57 name, tname)); … … 251 251 int stype = lp_default_server_announce() | (lp_local_master() ? SV_TYPE_POTENTIAL_BROWSER : 0 ); 252 252 253 if(!strequal( global_myname(), name))253 if(!strequal(lp_netbios_name(), name)) 254 254 stype &= ~(SV_TYPE_MASTER_BROWSER|SV_TYPE_POTENTIAL_BROWSER|SV_TYPE_DOMAIN_MASTER|SV_TYPE_DOMAIN_MEMBER); 255 255 256 256 create_server_on_workgroup(work,name,stype|SV_TYPE_LOCAL_LIST_ONLY, PERMANENT_TTL, 257 string_truncate(lp_server string(), MAX_SERVER_STRING_LENGTH));257 string_truncate(lp_server_string(talloc_tos()), MAX_SERVER_STRING_LENGTH)); 258 258 DEBUG(3,("initiate_myworkgroup_startup: Added server name entry %s \ 259 259 on subnet %s\n", name, subrec->subnet_name));
Note:
See TracChangeset
for help on using the changeset viewer.