diff options
Diffstat (limited to 'source/nmbd/nmbd_namelistdb.c')
-rw-r--r-- | source/nmbd/nmbd_namelistdb.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/source/nmbd/nmbd_namelistdb.c b/source/nmbd/nmbd_namelistdb.c index bca79ef0c80..4e8c251b3ec 100644 --- a/source/nmbd/nmbd_namelistdb.c +++ b/source/nmbd/nmbd_namelistdb.c @@ -1,5 +1,6 @@ /* - Unix SMB/CIFS implementation. + Unix SMB/Netbios implementation. + Version 1.9. NBT netbios routines and daemon - version 2 Copyright (C) Andrew Tridgell 1994-1998 Copyright (C) Luke Kenneth Casson Leighton 1994-1998 @@ -34,8 +35,8 @@ uint16 samba_nb_type = 0; /* samba's NetBIOS name type */ */ void set_samba_nb_type(void) { - if( lp_wins_support() || wins_srv_count() ) - samba_nb_type = NB_HFLAG; /* samba is a 'hybrid' node type. */ + if( lp_wins_support() || (*lp_wins_server()) ) + samba_nb_type = NB_MFLAG; /* samba is a 'hybrid' node type. */ else samba_nb_type = NB_BFLAG; /* samba is broadcast-only node type. */ } /* set_samba_nb_type */ @@ -201,7 +202,7 @@ struct name_record *add_name_to_subnet( struct subnet_record *subrec, DEBUG( 0, ( "add_name_to_subnet: malloc fail when creating ip_flgs.\n" ) ); ZERO_STRUCTP(namerec); - SAFE_FREE(namerec); + SAFE_FREE( namerec ); return NULL; } @@ -212,7 +213,6 @@ struct name_record *add_name_to_subnet( struct subnet_record *subrec, /* Enter the name as active. */ namerec->data.nb_flags = nb_flags | NB_ACTIVE; - namerec->data.wins_flags = WINS_ACTIVE; /* If it's our primary name, flag it as so. */ if( strequal( my_netbios_names[0], name ) ) @@ -524,19 +524,19 @@ void add_samba_names_to_subnet( struct subnet_record *subrec ) into a file. Initiated by SIGHUP - used to debug the state of the namelists. **************************************************************************/ -static void dump_subnet_namelist( struct subnet_record *subrec, XFILE *fp) +static void dump_subnet_namelist( struct subnet_record *subrec, FILE *fp) { struct name_record *namerec; char *src_type; struct tm *tm; int i; - x_fprintf(fp, "Subnet %s\n----------------------\n", subrec->subnet_name); + fprintf(fp, "Subnet %s\n----------------------\n", subrec->subnet_name); for( namerec = (struct name_record *)ubi_trFirst( subrec->namelist ); namerec; namerec = (struct name_record *)ubi_trNext( namerec ) ) { - x_fprintf(fp,"\tName = %s\t", nmb_namestr(&namerec->name)); + fprintf(fp,"\tName = %s\t", nmb_namestr(&namerec->name)); switch(namerec->data.source) { case LMHOSTS_NAME: @@ -564,29 +564,29 @@ static void dump_subnet_namelist( struct subnet_record *subrec, XFILE *fp) src_type = "unknown!"; break; } - x_fprintf(fp,"Source = %s\nb_flags = %x\t", src_type, namerec->data.nb_flags); + fprintf(fp,"Source = %s\nb_flags = %x\t", src_type, namerec->data.nb_flags); if(namerec->data.death_time != PERMANENT_TTL) { tm = LocalTime(&namerec->data.death_time); - x_fprintf(fp, "death_time = %s\t", asctime(tm)); + fprintf(fp, "death_time = %s\t", asctime(tm)); } else - x_fprintf(fp, "death_time = PERMANENT\t"); + fprintf(fp, "death_time = PERMANENT\t"); if(namerec->data.refresh_time != PERMANENT_TTL) { tm = LocalTime(&namerec->data.refresh_time); - x_fprintf(fp, "refresh_time = %s\n", asctime(tm)); + fprintf(fp, "refresh_time = %s\n", asctime(tm)); } else - x_fprintf(fp, "refresh_time = PERMANENT\n"); + fprintf(fp, "refresh_time = PERMANENT\n"); - x_fprintf(fp, "\t\tnumber of IPS = %d", namerec->data.num_ips); + fprintf(fp, "\t\tnumber of IPS = %d", namerec->data.num_ips); for(i = 0; i < namerec->data.num_ips; i++) - x_fprintf(fp, "\t%s", inet_ntoa(namerec->data.ip[i])); + fprintf(fp, "\t%s", inet_ntoa(namerec->data.ip[i])); - x_fprintf(fp, "\n\n"); + fprintf(fp, "\n\n"); } } @@ -597,10 +597,10 @@ static void dump_subnet_namelist( struct subnet_record *subrec, XFILE *fp) void dump_all_namelists(void) { - XFILE *fp; + FILE *fp; struct subnet_record *subrec; - fp = x_fopen(lock_path("namelist.debug"),O_WRONLY|O_CREAT|O_TRUNC, 0644); + fp = sys_fopen(lock_path("namelist.debug"),"w"); if (!fp) { @@ -622,5 +622,5 @@ void dump_all_namelists(void) if( wins_server_subnet != NULL ) dump_subnet_namelist( wins_server_subnet, fp ); - x_fclose( fp ); + fclose( fp ); } |