patch to fix bug #176649

This commit is contained in:
ssorce 2007-03-26 21:29:00 +00:00
parent 9611d05bb2
commit 8626b9f878
2 changed files with 101 additions and 0 deletions

View File

@ -0,0 +1,99 @@
Index: source/client/client.c
===================================================================
--- source/client/client.c (revision 21918)
+++ source/client/client.c (working copy)
@@ -3847,6 +3847,7 @@
char *p;
int rc = 0;
fstring new_workgroup;
+ BOOL first_opt = True;
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -3900,6 +3901,44 @@
in_client = True; /* Make sure that we tell lp_load we are */
while ((opt = poptGetNextOpt(pc)) != -1) {
+
+ /* bad hack to cope with the breackage the -T option would cause
+ * by eating the wrong arguments. We need to eat arg 0,[1,2] before */
+ if (first_opt) {
+ int argind = 0;
+ while (poptPeekArg(pc)) {
+ switch(argind) {
+ case 0: /* progname */
+ poptGetArg(pc); /* skip */
+ break;
+
+ case 1: /* service name */
+ pstrcpy(service,poptGetArg(pc));
+ /* Convert any '/' characters in the service name to '\' characters */
+ string_replace(service, '/','\\');
+
+ if (count_chars(service,'\\') < 3) {
+ d_printf("\n%s: Not enough '\\' characters in service\n",service);
+ poptPrintUsage(pc, stderr, 0);
+ exit(1);
+ }
+ break;
+ case 2: /* command line provided password */
+ cmdline_auth_info.got_pass = True;
+ pstrcpy(cmdline_auth_info.password,poptGetArg(pc));
+ break;
+
+ default:
+ /* uh? garbage? */
+ d_printf("\nUnknown option: [%s]!\n", poptGetArg(pc));
+ poptPrintUsage(pc, stderr, 0);
+ exit(1);
+ }
+ argind++;
+ }
+ first_opt = False;
+ }
+
switch (opt) {
case 'M':
/* Messages are sent to NetBIOS name type 0x3
@@ -3959,7 +3998,7 @@
*/
optnum -= i;
for (i = 0; i < optnum; i++)
- poptGetOptArg(pc);
+ poptGetArg(pc);
}
break;
case 'D':
@@ -3971,8 +4010,6 @@
}
}
- poptGetArg(pc);
-
/* check for the -P option */
if ( port != 0 )
@@ -4011,23 +4048,6 @@
else
pstrcpy( calling_name, global_myname() );
- if(poptPeekArg(pc)) {
- pstrcpy(service,poptGetArg(pc));
- /* Convert any '/' characters in the service name to '\' characters */
- string_replace(service, '/','\\');
-
- if (count_chars(service,'\\') < 3) {
- d_printf("\n%s: Not enough '\\' characters in service\n",service);
- poptPrintUsage(pc, stderr, 0);
- exit(1);
- }
- }
-
- if (poptPeekArg(pc) && !cmdline_auth_info.got_pass) {
- cmdline_auth_info.got_pass = True;
- pstrcpy(cmdline_auth_info.password,poptGetArg(pc));
- }
-
init_names();
if(new_name_resolve_order)

View File

@ -50,6 +50,7 @@ Patch114: samba-3.0.24-msdfs-root-no.patch
Patch115: samba-3.0.24-vista-patchset.patch
Patch116: samba-3.0.24-arch_macro.patch
Patch117: samba-3.0.24-pam_winbind-fixes.patch
Patch118: samba-3.0.24-tar_options.patch
Requires(pre): samba-common = %{epoch}:%{version}-%{release}
Requires: pam >= 0:0.64 %{auth}
@ -175,6 +176,7 @@ cp %{SOURCE10} packaging/Fedora/
%patch115 -p1 -b .vista
%patch116 -p0 -b .arch_macro
%patch117 -p0 -b .pam_winbind
%patch118 -p0 -b .tar_option
# crap
rm -f examples/VFS/.cvsignore