* samba/param/loadparm.c: Add global_scope variable.
(parm_table): Add netbios scope parameter. * samba/lib/util.c: Remove scope variable. Use global_scope instead. * samba/libsmb/nmblib.c (make_nmb_name): Remove scope parameter and use global_scope instead. * samba/libsmb/namequery.c: Adjust make_nmb_name() calls. * samba/include/proto.h: Adjust make_nmb_name() declaration. From samba 2.0.7 patchset. * samba/param/loadparm.c (lp_adduser_script): Commented out. (lp_deluser_script): Likewise. (lp_add_printer): Likewise. (lp_add_one_printer): Likewise. * samba/lib/util.c (reduce_name): Likewise. (transfer_file): Likewise. * smbfs.c (smbfs_do_connect): Adjust make_nmb_name() calls.
Этот коммит содержится в:
родитель
cd9cb5c78f
Коммит
019c16b047
@ -1,3 +1,24 @@
|
||||
2002-09-01 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* samba/param/loadparm.c: Add global_scope variable.
|
||||
(parm_table): Add netbios scope parameter.
|
||||
* samba/lib/util.c: Remove scope variable. Use global_scope instead.
|
||||
* samba/libsmb/nmblib.c (make_nmb_name): Remove scope parameter and
|
||||
use global_scope instead.
|
||||
* samba/libsmb/namequery.c: Adjust make_nmb_name() calls.
|
||||
* samba/include/proto.h: Adjust make_nmb_name() declaration.
|
||||
|
||||
From samba 2.0.7 patchset.
|
||||
|
||||
* samba/param/loadparm.c (lp_adduser_script): Commented out.
|
||||
(lp_deluser_script): Likewise.
|
||||
(lp_add_printer): Likewise.
|
||||
(lp_add_one_printer): Likewise.
|
||||
* samba/lib/util.c (reduce_name): Likewise.
|
||||
(transfer_file): Likewise.
|
||||
|
||||
* smbfs.c (smbfs_do_connect): Adjust make_nmb_name() calls.
|
||||
|
||||
2002-08-26 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* extfs/urar.in: Use rar if unrar is missing.
|
||||
|
@ -524,7 +524,7 @@ char *nmb_namestr(struct nmb_name *n);
|
||||
struct packet_struct *copy_packet(struct packet_struct *packet);
|
||||
void free_packet(struct packet_struct *packet);
|
||||
struct packet_struct *read_packet(int fd,enum packet_type packet_type);
|
||||
void make_nmb_name( struct nmb_name *n, const char *name, int type, const char *this_scope );
|
||||
void make_nmb_name( struct nmb_name *n, const char *name, int type);
|
||||
BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
|
||||
BOOL send_packet(struct packet_struct *p);
|
||||
struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
|
||||
|
@ -58,8 +58,6 @@ extern SSL *ssl;
|
||||
extern int sslFd;
|
||||
#endif /* WITH_SSL */
|
||||
|
||||
pstring scope = "";
|
||||
|
||||
extern int DEBUGLEVEL;
|
||||
|
||||
int Protocol = PROTOCOL_COREPLUS;
|
||||
@ -298,6 +296,7 @@ int name_mangle( char *In, char *Out, char name_type )
|
||||
int len;
|
||||
char buf[20];
|
||||
char *p = Out;
|
||||
extern pstring global_scope;
|
||||
|
||||
/* Safely copy the input string, In, into buf[]. */
|
||||
(void)memset( buf, 0, 20 );
|
||||
@ -321,9 +320,9 @@ int name_mangle( char *In, char *Out, char name_type )
|
||||
p[0] = '\0';
|
||||
|
||||
/* Add the scope string. */
|
||||
for( i = 0, len = 0; NULL != scope; i++, len++ )
|
||||
for( i = 0, len = 0; NULL != global_scope; i++, len++ )
|
||||
{
|
||||
switch( scope[i] )
|
||||
switch( global_scope[i] )
|
||||
{
|
||||
case '\0':
|
||||
p[0] = len;
|
||||
@ -336,7 +335,7 @@ int name_mangle( char *In, char *Out, char name_type )
|
||||
len = -1;
|
||||
break;
|
||||
default:
|
||||
p[len+1] = scope[i];
|
||||
p[len+1] = global_scope[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -642,7 +641,7 @@ on the system that has the referenced file system.
|
||||
|
||||
widelinks are allowed if widelinks is true
|
||||
********************************************************************/
|
||||
|
||||
#if 0
|
||||
BOOL reduce_name(char *s,char *dir,BOOL widelinks)
|
||||
{
|
||||
#ifndef REDUCE_PATHS
|
||||
@ -764,7 +763,7 @@ BOOL reduce_name(char *s,char *dir,BOOL widelinks)
|
||||
return(True);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* 0 */
|
||||
/****************************************************************************
|
||||
expand some *s
|
||||
****************************************************************************/
|
||||
@ -955,7 +954,7 @@ int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew)
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
/****************************************************************************
|
||||
transfer some data between two fd's
|
||||
****************************************************************************/
|
||||
@ -1031,7 +1030,7 @@ SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n,char *header,int headlen,
|
||||
}
|
||||
return(total);
|
||||
}
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -120,7 +120,7 @@ BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
|
||||
nmb->header.nscount = 0;
|
||||
nmb->header.arcount = 0;
|
||||
|
||||
make_nmb_name(&nmb->question.question_name,name,name_type,scope);
|
||||
make_nmb_name(&nmb->question.question_name,name,name_type);
|
||||
|
||||
nmb->question.question_type = 0x21;
|
||||
nmb->question.question_class = 0x1;
|
||||
@ -228,7 +228,7 @@ struct in_addr *name_query(int fd,const char *name,int name_type, BOOL bcast,BOO
|
||||
nmb->header.nscount = 0;
|
||||
nmb->header.arcount = 0;
|
||||
|
||||
make_nmb_name(&nmb->question.question_name,name,name_type,scope);
|
||||
make_nmb_name(&nmb->question.question_name,name,name_type);
|
||||
|
||||
nmb->question.question_type = 0x20;
|
||||
nmb->question.question_class = 0x1;
|
||||
|
@ -288,8 +288,8 @@ static int put_nmb_name(char *buf,int offset,struct nmb_name *name)
|
||||
|
||||
p = &buf[offset+1];
|
||||
while ((p = strchr(p,'.'))) {
|
||||
buf[offset] = PTR_DIFF(p,&buf[offset]);
|
||||
offset += buf[offset];
|
||||
buf[offset] = PTR_DIFF(p,&buf[offset+1]);
|
||||
offset += (buf[offset] + 1);
|
||||
p = &buf[offset+1];
|
||||
}
|
||||
buf[offset] = strlen(&buf[offset+1]);
|
||||
@ -774,13 +774,14 @@ static int build_dgram(char *buf,struct packet_struct *p)
|
||||
/*******************************************************************
|
||||
build a nmb name
|
||||
*******************************************************************/
|
||||
void make_nmb_name( struct nmb_name *n, const char *name, int type, const char *this_scope )
|
||||
void make_nmb_name( struct nmb_name *n, const char *name, int type )
|
||||
{
|
||||
extern pstring global_scope;
|
||||
memset( (char *)n, '\0', sizeof(struct nmb_name) );
|
||||
StrnCpy( n->name, name, 15 );
|
||||
strupper( n->name );
|
||||
n->name_type = (unsigned int)type & 0xFF;
|
||||
StrnCpy( n->scope, this_scope, 63 );
|
||||
StrnCpy( n->scope, global_scope, 63 );
|
||||
strupper( n->scope );
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,7 @@ BOOL bLoaded = False;
|
||||
extern int DEBUGLEVEL;
|
||||
extern pstring user_socket_options;
|
||||
extern pstring global_myname;
|
||||
pstring global_scope = "";
|
||||
|
||||
#ifndef GLOBAL_NAME
|
||||
#define GLOBAL_NAME "global"
|
||||
@ -521,8 +522,9 @@ static struct parm_struct parm_table[] =
|
||||
{"path", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT},
|
||||
{"directory", P_STRING, P_LOCAL, &sDefault.szPath, NULL, NULL, 0},
|
||||
{"workgroup", P_USTRING, P_GLOBAL, &Globals.szWorkGroup, NULL, NULL, FLAG_BASIC},
|
||||
{"netbios name", P_UGSTRING,P_GLOBAL, global_myname, NULL, NULL, FLAG_BASIC},
|
||||
{"netbios name", P_UGSTRING,P_GLOBAL, global_myname, NULL, NULL, FLAG_BASIC},
|
||||
{"netbios aliases", P_STRING, P_GLOBAL, &Globals.szNetbiosAliases, NULL, NULL, 0},
|
||||
{"netbios scope", P_UGSTRING,P_GLOBAL, global_scope, NULL, NULL, 0},
|
||||
{"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC},
|
||||
{"interfaces", P_STRING, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC},
|
||||
{"bind interfaces only", P_BOOL,P_GLOBAL, &Globals.bBindInterfacesOnly,NULL, NULL, 0},
|
||||
@ -1159,9 +1161,10 @@ static FN_GLOBAL_STRING(lp_announce_version,&Globals.szAnnounceVersion)
|
||||
FN_GLOBAL_STRING(lp_netbios_aliases,&Globals.szNetbiosAliases)
|
||||
FN_GLOBAL_STRING(lp_driverfile,&Globals.szDriverFile)
|
||||
FN_GLOBAL_STRING(lp_panic_action,&Globals.szPanicAction)
|
||||
#if 0
|
||||
FN_GLOBAL_STRING(lp_adduser_script,&Globals.szAddUserScript)
|
||||
FN_GLOBAL_STRING(lp_deluser_script,&Globals.szDelUserScript)
|
||||
|
||||
#endif
|
||||
FN_GLOBAL_STRING(lp_domain_groups,&Globals.szDomainGroups)
|
||||
FN_GLOBAL_STRING(lp_domain_admin_group,&Globals.szDomainAdminGroup)
|
||||
FN_GLOBAL_STRING(lp_domain_guest_group,&Globals.szDomainGuestGroup)
|
||||
@ -1518,7 +1521,7 @@ static BOOL lp_add_ipc(void)
|
||||
return(True);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/***************************************************************************
|
||||
add a new printer service, with defaults coming from service iFrom
|
||||
***************************************************************************/
|
||||
@ -1552,7 +1555,7 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService)
|
||||
|
||||
return(True);
|
||||
}
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
/***************************************************************************
|
||||
Do a case-insensitive, whitespace-ignoring string compare.
|
||||
@ -2430,7 +2433,7 @@ static void lp_add_auto_services(char *str)
|
||||
}
|
||||
free(s);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/***************************************************************************
|
||||
auto-load one printer
|
||||
***************************************************************************/
|
||||
@ -2445,7 +2448,7 @@ void lp_add_one_printer(char *name,char *comment)
|
||||
string_set(&iSERVICE(i).comment,comment);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* 0 */
|
||||
/***************************************************************************
|
||||
have we loaded a services file yet?
|
||||
***************************************************************************/
|
||||
|
@ -860,8 +860,8 @@ smbfs_do_connect (const char *server, char *share)
|
||||
share++;
|
||||
}
|
||||
|
||||
make_nmb_name(&calling, global_myname, 0x0, "");
|
||||
make_nmb_name(&called , server, current_bucket->name_type, "");
|
||||
make_nmb_name(&calling, global_myname, 0x0);
|
||||
make_nmb_name(&called , server, current_bucket->name_type);
|
||||
|
||||
for (;;) {
|
||||
|
||||
@ -887,7 +887,7 @@ smbfs_do_connect (const char *server, char *share)
|
||||
DEBUG(1, ("session request to %s failed\n", called.name));
|
||||
cli_shutdown(c);
|
||||
if (strcmp(called.name, "*SMBSERVER")) {
|
||||
make_nmb_name(&called , "*SMBSERVER", 0x20, "");
|
||||
make_nmb_name(&called , "*SMBSERVER", 0x20);
|
||||
continue;
|
||||
}
|
||||
return NULL;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user