diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/include/smb.h | 4 | ||||
-rw-r--r-- | source3/lib/netapi/serverinfo.c | 4 | ||||
-rw-r--r-- | source3/nmbd/nmbd_sendannounce.c | 8 | ||||
-rw-r--r-- | source3/param/loadparm.c | 65 | ||||
-rw-r--r-- | source3/registry/reg_backend_current_version.c | 4 | ||||
-rw-r--r-- | source3/rpc_server/srvsvc/srv_srvsvc_nt.c | 8 | ||||
-rw-r--r-- | source3/rpc_server/wkssvc/srv_wkssvc_nt.c | 12 | ||||
-rw-r--r-- | source3/smbd/lanman.c | 4 |
9 files changed, 22 insertions, 89 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 31c75189fc..90dbafc96c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1636,8 +1636,6 @@ bool lp_preferred_master(void); void lp_remove_service(int snum); void lp_copy_service(int snum, const char *new_name); int lp_default_server_announce(void); -int lp_major_announce_version(void); -int lp_minor_announce_version(void); void lp_set_name_resolve_order(const char *new_order); const char *lp_printername(int snum); void lp_set_logfile(const char *name); diff --git a/source3/include/smb.h b/source3/include/smb.h index ec78317b9b..589dfd78c3 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1236,8 +1236,8 @@ char *strdup(char *s); * This may change again in Samba-3.0 after further testing. JHT */ -#define DEFAULT_MAJOR_VERSION 0x04 -#define DEFAULT_MINOR_VERSION 0x09 +#define SAMBA_MAJOR_NBT_ANNOUNCE_VERSION 0x04 +#define SAMBA_MINOR_NBT_ANNOUNCE_VERSION 0x09 /* Browser Election Values */ #define BROWSER_ELECTION_VERSION 0x010f diff --git a/source3/lib/netapi/serverinfo.c b/source3/lib/netapi/serverinfo.c index 34db569cd7..4b11339f94 100644 --- a/source3/lib/netapi/serverinfo.c +++ b/source3/lib/netapi/serverinfo.c @@ -37,8 +37,8 @@ static WERROR NetServerGetInfo_l_101(struct libnetapi_ctx *ctx, i.sv101_platform_id = PLATFORM_ID_NT; i.sv101_name = lp_netbios_name(); - i.sv101_version_major = lp_major_announce_version(); - i.sv101_version_minor = lp_minor_announce_version(); + i.sv101_version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION; + i.sv101_version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION; i.sv101_type = lp_default_server_announce(); i.sv101_comment = lp_serverstring(); diff --git a/source3/nmbd/nmbd_sendannounce.c b/source3/nmbd/nmbd_sendannounce.c index 847390b615..39e63d29ab 100644 --- a/source3/nmbd/nmbd_sendannounce.c +++ b/source3/nmbd/nmbd_sendannounce.c @@ -109,8 +109,8 @@ static void send_announcement(struct subnet_record *subrec, int announce_type, strupper_m(upper_server_name); push_string_check(p+5, upper_server_name, 16, STR_ASCII|STR_TERMINATE); - SCVAL(p,21,lp_major_announce_version()); /* Major version. */ - SCVAL(p,22,lp_minor_announce_version()); /* Minor version. */ + SCVAL(p,21,SAMBA_MAJOR_NBT_ANNOUNCE_VERSION); /* Major version. */ + SCVAL(p,22,SAMBA_MINOR_NBT_ANNOUNCE_VERSION); /* Minor version. */ SIVAL(p,23,server_type & ~SV_TYPE_LOCAL_LIST_ONLY); /* Browse version: got from NT/AS 4.00 - Value defined in smb.h (JHT). */ @@ -140,8 +140,8 @@ static void send_lm_announcement(struct subnet_record *subrec, int announce_type SSVAL(p,0,announce_type); SIVAL(p,2,server_type & ~SV_TYPE_LOCAL_LIST_ONLY); - SCVAL(p,6,lp_major_announce_version()); /* Major version. */ - SCVAL(p,7,lp_minor_announce_version()); /* Minor version. */ + SCVAL(p,6,SAMBA_MAJOR_NBT_ANNOUNCE_VERSION); /* Major version. */ + SCVAL(p,7,SAMBA_MINOR_NBT_ANNOUNCE_VERSION); /* Minor version. */ SSVAL(p,8,announce_interval); /* In seconds - according to spec. */ p += 10; diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index e03a614f50..3f622ac197 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -175,7 +175,6 @@ struct global { char *szSocketAddress; bool bNmbdBindExplicitBroadcast; char *szNISHomeMapName; - char *szAnnounceVersion; /* This is initialised in init_globals */ char *szWorkgroup; char *szNetbiosName; char **szNetbiosAliases; @@ -2153,15 +2152,6 @@ static struct parm_struct parm_table[] = { .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE, }, { - .label = "announce version", - .type = P_STRING, - .p_class = P_GLOBAL, - .ptr = &Globals.szAnnounceVersion, - .special = NULL, - .enum_list = NULL, - .flags = FLAG_ADVANCED, - }, - { .label = "map acl inherit", .type = P_BOOL, .p_class = P_LOCAL, @@ -5178,12 +5168,6 @@ static void init_globals(bool reinit_globals) } string_set(&Globals.szServerString, s); SAFE_FREE(s); - if (asprintf(&s, "%d.%d", DEFAULT_MAJOR_VERSION, - DEFAULT_MINOR_VERSION) < 0) { - smb_panic("init_globals: ENOMEM"); - } - string_set(&Globals.szAnnounceVersion, s); - SAFE_FREE(s); #ifdef DEVELOPER string_set(&Globals.szPanicAction, "/bin/sleep 999999999"); #endif @@ -5581,7 +5565,6 @@ FN_GLOBAL_BOOL(lp_nmbd_bind_explicit_broadcast, bNmbdBindExplicitBroadcast) FN_GLOBAL_LIST(lp_wins_server_list, szWINSservers) FN_GLOBAL_LIST(lp_interfaces, szInterfaces) FN_GLOBAL_STRING(lp_nis_home_map_name, szNISHomeMapName) -static FN_GLOBAL_STRING(lp_announce_version, szAnnounceVersion) FN_GLOBAL_LIST(lp_netbios_aliases, szNetbiosAliases) /* FN_GLOBAL_STRING(lp_passdb_backend, szPassdbBackend) * lp_passdb_backend() should be replace by the this macro again after @@ -9867,54 +9850,6 @@ int lp_default_server_announce(void) return default_server_announce; } -/******************************************************************* - Split the announce version into major and minor numbers. -********************************************************************/ - -int lp_major_announce_version(void) -{ - static bool got_major = False; - static int major_version = DEFAULT_MAJOR_VERSION; - char *vers; - char *p; - - if (got_major) - return major_version; - - got_major = True; - if ((vers = lp_announce_version()) == NULL) - return major_version; - - if ((p = strchr_m(vers, '.')) == 0) - return major_version; - - *p = '\0'; - major_version = atoi(vers); - return major_version; -} - -int lp_minor_announce_version(void) -{ - static bool got_minor = False; - static int minor_version = DEFAULT_MINOR_VERSION; - char *vers; - char *p; - - if (got_minor) - return minor_version; - - got_minor = True; - if ((vers = lp_announce_version()) == NULL) - return minor_version; - - if ((p = strchr_m(vers, '.')) == 0) - return minor_version; - - p++; - minor_version = atoi(p); - return minor_version; -} - /*********************************************************** Set the global name resolution order (used in smbclient). ************************************************************/ diff --git a/source3/registry/reg_backend_current_version.c b/source3/registry/reg_backend_current_version.c index ab7bd517b0..adf304e8c9 100644 --- a/source3/registry/reg_backend_current_version.c +++ b/source3/registry/reg_backend_current_version.c @@ -58,8 +58,8 @@ static int current_version_fetch_values(const char *key, struct regval_ctr *valu regval_ctr_addvalue_sz(values, "SystemRoot", sysroot_string); - fstr_sprintf(sysversion, "%d.%d", lp_major_announce_version(), - lp_minor_announce_version()); + fstr_sprintf(sysversion, "%d.%d", SAMBA_MAJOR_NBT_ANNOUNCE_VERSION, + SAMBA_MINOR_NBT_ANNOUNCE_VERSION); regval_ctr_addvalue_sz(values, "CurrentVersion", sysversion); diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c index 2aed300feb..752b857667 100644 --- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c +++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c @@ -1146,8 +1146,8 @@ WERROR _srvsvc_NetSrvGetInfo(struct pipes_struct *p, info102->platform_id = PLATFORM_ID_NT; info102->server_name = lp_netbios_name(); - info102->version_major = lp_major_announce_version(); - info102->version_minor = lp_minor_announce_version(); + info102->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION; + info102->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION; info102->server_type = lp_default_server_announce(); info102->comment = string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH); @@ -1172,8 +1172,8 @@ WERROR _srvsvc_NetSrvGetInfo(struct pipes_struct *p, info101->platform_id = PLATFORM_ID_NT; info101->server_name = lp_netbios_name(); - info101->version_major = lp_major_announce_version(); - info101->version_minor = lp_minor_announce_version(); + info101->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION; + info101->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION; info101->server_type = lp_default_server_announce(); info101->comment = string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH); diff --git a/source3/rpc_server/wkssvc/srv_wkssvc_nt.c b/source3/rpc_server/wkssvc/srv_wkssvc_nt.c index 633aa13360..49c71b8d6e 100644 --- a/source3/rpc_server/wkssvc/srv_wkssvc_nt.c +++ b/source3/rpc_server/wkssvc/srv_wkssvc_nt.c @@ -260,8 +260,8 @@ static struct wkssvc_NetWkstaInfo100 *create_wks_info_100(TALLOC_CTX *mem_ctx) } info100->platform_id = PLATFORM_ID_NT; /* unknown */ - info100->version_major = lp_major_announce_version(); - info100->version_minor = lp_minor_announce_version(); + info100->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION; + info100->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION; info100->server_name = talloc_asprintf_strupper_m( info100, "%s", lp_netbios_name()); @@ -289,8 +289,8 @@ static struct wkssvc_NetWkstaInfo101 *create_wks_info_101(TALLOC_CTX *mem_ctx) } info101->platform_id = PLATFORM_ID_NT; /* unknown */ - info101->version_major = lp_major_announce_version(); - info101->version_minor = lp_minor_announce_version(); + info101->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION; + info101->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION; info101->server_name = talloc_asprintf_strupper_m( info101, "%s", lp_netbios_name()); @@ -320,8 +320,8 @@ static struct wkssvc_NetWkstaInfo102 *create_wks_info_102(TALLOC_CTX *mem_ctx) } info102->platform_id = PLATFORM_ID_NT; /* unknown */ - info102->version_major = lp_major_announce_version(); - info102->version_minor = lp_minor_announce_version(); + info102->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION; + info102->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION; info102->server_name = talloc_asprintf_strupper_m( info102, "%s", lp_netbios_name()); diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index f8101d9571..dac91b2a40 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -4027,8 +4027,8 @@ static bool api_NetWkstaGetInfo(struct smbd_server_connection *sconn, } p += 4; - SCVAL(p,0,lp_major_announce_version()); /* system version - e.g 4 in 4.1 */ - SCVAL(p,1,lp_minor_announce_version()); /* system version - e.g .1 in 4.1 */ + SCVAL(p,0,SAMBA_MAJOR_NBT_ANNOUNCE_VERSION); /* system version - e.g 4 in 4.1 */ + SCVAL(p,1,SAMBA_MINOR_NBT_ANNOUNCE_VERSION); /* system version - e.g .1 in 4.1 */ p += 2; SIVAL(p,0,PTR_DIFF(p2,*rdata)); |