Re: [patch] uppercase workgroup in browse request
Am Thursday 27 March 2003 18:04 schrieb Christopher R. Hertel: On Thu, Mar 27, 2003 at 05:43:55PM +0100, Stephan Kulow wrote: Am Thursday 27 March 2003 03:43 schrieb Christopher R. Hertel: Stephan Kulow wrote: Hi! I noticed a difference between testsmbc smb://MYGRP and testsmbc smb://mygrp (it doesn't make a difference for SAMBA servers, but it does for XP and for winME) So please apply the included patch. Hang on... Do I read this correctly? Are we forgetting to up-case the workgroup name? (...it always helps to provide a little clue along with the patch.) :) Samba decodes NetBIOS names and then performs a case-insensitive comparison on the original name. Windows (the versions I've tested) simply compares the wire-format strings. That's faster, but it's also case sensitive. I don't currently have any ME or XP systems to test. I don't understand. You seem to agree with the patch, still it's not applied. I don't understand. I asked for clarification. :) There's a question above. I asked Do I read this correctly?. You added a smiley behind it, so it appeared ironicly to me. So, what is your intention with this patch? What was the problem you were detecting? You never specified. Before I dig into the patch I want to know what you are trying to accomplish. Well, host names in URLs are usually case insensitive and with samba servers smb://mygrp gives indeed the same as smb://MYGRP. But not when the server is running winME, win98 or XP (that's the versions I tried). As KDE's URL handling lower cases the host part (and that's what MYGRP is), you'll notice. Meanwhile Andrew pointed out that my patch wasn't safe, so I changed it to use STR_UPPER. Greetings, Stephan -- Pace, Peace, Paix, Paz, Frieden, Pax, Pokój
charset confusion
Hi! I've done an experiment and configured my only windows system (german win98) in the LAN to be named häßlich and be in the workgroup möbel. Then tried testsmbc on smb://m%C3%B6bel/ (correctly UTF-8 escaped samba URL). That tried a broadcast for möbel1d, which I think it shouldn't. I'm not sure what exactly it's supposed to do, but surely not UTF-8. I then tried adding a pull_utf8 into the URL parsing of libsmbclient, but that didn't change anything as the default for unix charset is already UTF8 (and that's fine for me). So I'm really wondering what's supposed to happen. I then tried smbtree and that go results, but displayed them incorrectly (from the attached log it seems to me as it wouldn't convert the names it gets/sends at all). So I'm asking for feedback how to fix that. libsmbclient.c calls cli_NetServerEnum with the supposedly correct workgroup möbel (that's unix charset at least) and the call to push_ascii is there too - so why doesn't it work? Greetings, Stephan -- Pace, Peace, Paix, Paz, Frieden, Pax, Pokój log.gz Description: GNU Zip compressed data
Re: charset confusion
Am Sunday 30 March 2003 22:46 schrieb Stephan Kulow: Am Sunday 30 March 2003 20:37 schrieb Stephan Kulow: Hi! I've done an experiment and configured my only windows system (german win98) in the LAN to be named häßlich and be in the workgroup möbel. Then tried testsmbc on smb://m%C3%B6bel/ (correctly UTF-8 escaped samba URL). That tried a broadcast for möbel1d, which I think it shouldn't. I'm not sure what exactly it's supposed to do, but surely not UTF-8. Checking the wire, it seems the conversion from UTF-8 worked fine, just the strupper() call that's happening on the input doesn't work. At least the string on the wire is M94BEL (MöBEL) for libsmbclient and M99BEL (MÖBEL) for smbtree. I then tried to change the strupper in push_ascii to a call to unix_strupper, but that failed too for me - but I'm continuing there :) Good I looked, now I understand the code much better - and I haven't said anything. Even though I'd suggest the following patch to source/Makefile.in: - @$(SHEEL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSETLIBDIR) $(CHARSET_MODULES) - @$(SHEEL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(AUTHLIBDIR) $(AUTH_MODULES) + @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSETLIBDIR) $(CHARSET_MODULES) + @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(AUTHLIBDIR) $(AUTH_MODULES) Greetings, Stephan -- Pace, Peace, Paix, Paz, Frieden, Pax, Pokój
Re: [patch] uppercase workgroup in browse request
Am Thursday 27 March 2003 03:43 schrieb Christopher R. Hertel: Stephan Kulow wrote: Hi! I noticed a difference between testsmbc smb://MYGRP and testsmbc smb://mygrp (it doesn't make a difference for SAMBA servers, but it does for XP and for winME) So please apply the included patch. Hang on... Do I read this correctly? Are we forgetting to up-case the workgroup name? (...it always helps to provide a little clue along with the patch.) :) Samba decodes NetBIOS names and then performs a case-insensitive comparison on the original name. Windows (the versions I've tested) simply compares the wire-format strings. That's faster, but it's also case sensitive. I don't currently have any ME or XP systems to test. I don't understand. You seem to agree with the patch, still it's not applied. Greetings, Stephan
compiling with gcc 3.3
Hi! Compiling samba CVS with gcc 3.3 gives quite some annoying warnings in proto.h because exp and log are builtins. Attached is a patch that replaces exp with expr and log with clog (didn't know a better name for it) in the affected c files. Please apply. Greetings, Stephan Index: rpc_parse/parse_misc.c === RCS file: /cvsroot/samba/source/rpc_parse/parse_misc.c,v retrieving revision 1.111 diff -u -3 -p -u -r1.111 parse_misc.c --- rpc_parse/parse_misc.c 15 Mar 2003 07:45:51 - 1.111 +++ rpc_parse/parse_misc.c 25 Mar 2003 09:05:39 - @@ -1289,22 +1289,22 @@ void init_dom_rid4(DOM_RID4 *rid4, uint1 Inits a DOM_CLNT_SRV structure. / -static void init_clnt_srv(DOM_CLNT_SRV *log, const char *logon_srv, const char *comp_name) +static void init_clnt_srv(DOM_CLNT_SRV *clog, const char *logon_srv, const char *comp_name) { DEBUG(5,(init_clnt_srv: %d\n, __LINE__)); if (logon_srv != NULL) { - log-undoc_buffer = 1; - init_unistr2(log-uni_logon_srv, logon_srv, strlen(logon_srv)+1); + clog-undoc_buffer = 1; + init_unistr2(clog-uni_logon_srv, logon_srv, strlen(logon_srv)+1); } else { - log-undoc_buffer = 0; + clog-undoc_buffer = 0; } if (comp_name != NULL) { - log-undoc_buffer2 = 1; - init_unistr2(log-uni_comp_name, comp_name, strlen(comp_name)+1); + clog-undoc_buffer2 = 1; + init_unistr2(clog-uni_comp_name, comp_name, strlen(comp_name)+1); } else { - log-undoc_buffer2 = 0; + clog-undoc_buffer2 = 0; } } @@ -1312,9 +1312,9 @@ static void init_clnt_srv(DOM_CLNT_SRV * Inits or writes a DOM_CLNT_SRV structure. / -static BOOL smb_io_clnt_srv(const char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth) +static BOOL smb_io_clnt_srv(const char *desc, DOM_CLNT_SRV *clog, prs_struct *ps, int depth) { - if (log == NULL) + if (clog == NULL) return False; prs_debug(ps, depth, desc, smb_io_clnt_srv); @@ -1323,22 +1323,22 @@ static BOOL smb_io_clnt_srv(const char * if(!prs_align(ps)) return False; - if(!prs_uint32(undoc_buffer , ps, depth, log-undoc_buffer)) + if(!prs_uint32(undoc_buffer , ps, depth, clog-undoc_buffer)) return False; - if (log-undoc_buffer != 0) { - if(!smb_io_unistr2(unistr2, log-uni_logon_srv, log-undoc_buffer, ps, depth)) + if (clog-undoc_buffer != 0) { + if(!smb_io_unistr2(unistr2, clog-uni_logon_srv, clog-undoc_buffer, ps, depth)) return False; } if(!prs_align(ps)) return False; - if(!prs_uint32(undoc_buffer2, ps, depth, log-undoc_buffer2)) + if(!prs_uint32(undoc_buffer2, ps, depth, clog-undoc_buffer2)) return False; - if (log-undoc_buffer2 != 0) { - if(!smb_io_unistr2(unistr2, log-uni_comp_name, log-undoc_buffer2, ps, depth)) + if (clog-undoc_buffer2 != 0) { + if(!smb_io_unistr2(unistr2, clog-uni_comp_name, clog-undoc_buffer2, ps, depth)) return False; } @@ -1349,28 +1349,28 @@ static BOOL smb_io_clnt_srv(const char * Inits a DOM_LOG_INFO structure. / -void init_log_info(DOM_LOG_INFO *log, const char *logon_srv, const char *acct_name, +void init_log_info(DOM_LOG_INFO *clog, const char *logon_srv, const char *acct_name, uint16 sec_chan, const char *comp_name) { DEBUG(5,(make_log_info %d\n, __LINE__)); - log-undoc_buffer = 1; + clog-undoc_buffer = 1; - init_unistr2(log-uni_logon_srv, logon_srv, strlen(logon_srv)+1); - init_unistr2(log-uni_acct_name, acct_name, strlen(acct_name)+1); + init_unistr2(clog-uni_logon_srv, logon_srv, strlen(logon_srv)+1); + init_unistr2(clog-uni_acct_name, acct_name, strlen(acct_name)+1); - log-sec_chan = sec_chan; + clog-sec_chan = sec_chan; - init_unistr2(log-uni_comp_name, comp_name, strlen(comp_name)+1); + init_unistr2(clog-uni_comp_name, comp_name, strlen(comp_name)+1); } /*** Reads or writes a DOM_LOG_INFO structure. / -BOOL smb_io_log_info(const char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth) +BOOL smb_io_log_info(const char *desc, DOM_LOG_INFO *clog, prs_struct *ps, int depth) { - if (log == NULL) + if (clog == NULL) return False; prs_debug(ps, depth, desc, smb_io_log_info); @@ -1379,18 +1379,18 @@ BOOL smb_io_log_info(const char *desc, D if(!prs_align(ps)) return False; - if(!prs_uint32(undoc_buffer, ps, depth, log-undoc_buffer)) + if(!prs_uint32(undoc_buffer, ps, depth, clog-undoc_buffer)) return False; - if(!smb_io_unistr2(unistr2, log-uni_logon_srv, True, ps, depth)) + if(!smb_io_unistr2(unistr2, clog-uni_logon_srv, True, ps, depth)) return False; - if(!smb_io_unistr2(unistr2, log-uni_acct_name, True, ps, depth)) + if(!smb_io_unistr2(unistr2, clog-uni_acct_name, True, ps, depth)) return False; -
[patch] uppercase workgroup in browse request
Hi! I noticed a difference between testsmbc smb://MYGRP and testsmbc smb://mygrp (it doesn't make a difference for SAMBA servers, but it does for XP and for winME) So please apply the included patch. Greetings, Stephan Index: libsmb/clirap.c === RCS file: /cvsroot/samba/source/libsmb/clirap.c,v retrieving revision 1.30 diff -u -3 -p -u -r1.30 clirap.c --- libsmb/clirap.c 15 Mar 2003 06:45:19 - 1.30 +++ libsmb/clirap.c 25 Mar 2003 15:25:20 - @@ -233,8 +233,10 @@ BOOL cli_NetServerEnum(struct cli_state SIVAL(p,0,stype); p += 4; - p += push_pstring_base(p, workgroup, param); - + pstrcpy_base(p, workgroup, param); + strupper(p); + p += strlen(p); + if (cli_api(cli, param, PTR_DIFF(p,param), 8,/* params, length, max */ NULL, 0, CLI_BUFFER_SIZE, /* data, length, max */
SMB URL
Hi! I looked into the URL handling libsmbclient is doing and it's lacking quite some of the stuff that the DRAFT specifies (and some of the stuff that generally are required for URIs). Is someone working on that? I'm currently preparing some patches, but hate C programming enough to dump it for some other solution :) Greetings, Stephan
Re: A please report me error
Am Tuesday 25 March 2003 21:46 schrieb Dave Collier-Brown: In today's CVS, I caught this message zip by while configuring: ... checking net/if.h presence... yes configure: WARNING: net/if.h: present but cannot be compiled configure: WARNING: net/if.h: check for missing prerequisite headers? configure: WARNING: net/if.h: proceeding with the preprocessor's result configure: WARNING: ## ## configure: WARNING: ## Report this to [EMAIL PROTECTED] ## configure: WARNING: ## ## checking for net/if.h... yes Anyone want to pass it on the gnuvians, as asked? Better check your config.log and find out what header it requires. Greetings, Stephan