[PATCH] smb_register_auth()

2002-12-16 Thread Stefan (metze) Metzmacher
Hi Jelmer,

(attached the patch now...,sorry:-)

I have changed the auth subsystem to use our new module stuff...

I also add 'samstrict_dc' witch is checks the domain str for all our 
netbios aliases and our own domain id we're a logon server...

I let abartlet change the default auth methods order based on 
lp_sercurity...later.

and a view small fixes

we should return NT_STATUS_LOGON_FAILURE when we can't get a pass for a 
trusted domain in 'auth_trustdomain'!
in this case we didn't trust this domain.


This patch depends on the patch for the module system and smb_register_vfs()


metze
-
Stefan metze Metzmacher [EMAIL PROTECTED]diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=.#* 
HEAD/source/auth/auth.c HEAD-modules/source/auth/auth.c
--- HEAD/source/auth/auth.c Thu Dec 12 20:24:26 2002
+++ HEAD-modules/source/auth/auth.c Mon Dec 16 09:40:23 2002
@@ -1,7 +1,8 @@
 /* 
Unix SMB/CIFS implementation.
Password and authentication handling
-   Copyright (C) Andrew Bartlett 2001-2002
+   Copyright (C) Andrew Bartlett   2001-2002
+   Copyright (C) Stefan (metze) Metzmacher 2002

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,25 +26,85 @@
 
 /** List of various built-in authentication modules */
 
-const struct auth_init_function_entry builtin_auth_init_functions[] = {
-   { guest, auth_init_guest },
-   { rhosts, auth_init_rhosts },
-   { hostsequiv, auth_init_hostsequiv },
-   { sam, auth_init_sam },   
-   { samstrict, auth_init_samstrict },
-   { unix, auth_init_unix },
-   { smbserver, auth_init_smbserver },
-   { ntdomain, auth_init_ntdomain },
-   { trustdomain, auth_init_trustdomain },
-   { winbind, auth_init_winbind },
+const struct {
+   char *name;
+   struct auth_method_ops *(*register_fn)(void);
+} builtin_auth_methods[] = {
+   { guest, auth_guest_register},
+   { rhosts, auth_rhosts_register },
+   { hostsequiv, auth_hostsequiv_register },
+   { sam, auth_sam_register },   
+   { samstrict, auth_samstrict_register },
+   { samstrict_dc, auth_samstrict_dc_register },
+   { unix, auth_unix_register },
+   { smbserver, auth_smbserver_register },
+   { ntdomain, auth_ntdomain_register },
+   { trustdomain, auth_trustdomain_register },
+   { winbind, auth_winbind_register },
 #ifdef DEVELOPER
-   { name_to_ntstatus, auth_init_name_to_ntstatus },
-   { fixed_challenge, auth_init_fixed_challenge },
+   { name_to_ntstatus, auth_name_to_ntstatus_register },
+   { fixed_challenge, auth_fixed_challenge_register },
 #endif
-   { plugin, auth_init_plugin },
{ NULL, NULL}
 };
 
+static struct auth_method_function_entry *global_auth_methods = NULL;
+
+static NTSTATUS smb_register_auth_method(const char *name, struct auth_method_ops 
+*auth_ops) 
+{
+   struct auth_method_function_entry *entry = global_auth_methods;
+
+   DEBUG(8,(Attempting to register auth method '%s'\n, name));
+
+   /* Check for duplicates */
+   while(entry) { 
+   if(strcasecmp(name, entry-name) == 0) { 
+   DEBUG(1,(smb_register_auth: There already is a auth method 
+registered with the name %s!\n, name));
+   return NT_STATUS_OBJECT_NAME_COLLISION;
+   }
+   entry = entry-next;
+   }
+
+   if ((entry = smb_xmalloc(sizeof(struct auth_method_function_entry)))==NULL) {
+   DEBUG(0,(smb_register_auth_method; smb_xmalloc() failed\n));
+   return NT_STATUS_NO_MEMORY;
+   }
+
+   entry-name = strdup(name);
+   entry-ops = auth_ops;
+
+   DLIST_ADD(global_auth_methods, entry);
+   DEBUG(10,(Successfully added auth_method '%s'\n, name));
+   return NT_STATUS_OK;
+}
+
+static void lazy_initialize_auth(void)
+{
+   int i;
+   static BOOL initialised = False;
+   
+   if(!initialised) {
+   initialised = True;
+
+   for(i = 0; builtin_auth_methods[i].name; i++) {
+   
+smb_register_auth_method(builtin_auth_methods[i].name,builtin_auth_methods[i].register_fn());
+   }
+   }
+}
+
+NTSTATUS smb_register_auth(const char *name, struct auth_method_ops *auth_ops, int 
+version)
+{
+   /* make sure the builtin methods are loaded before any module */
+   lazy_initialize_auth();
+
+   if(version != AUTH_INTERFACE_VERSION){
+   DEBUG(0,(smb_register_auth: module '%s' has wrong the 
+AUTH_INTERFACE_VERSION\n,name));
+   return NT_STATUS_INVALID_PARAMETER;
+   }
+
+   return smb_register_auth_method(name,auth_ops);
+}
+
 /
  Try to get a 

smbstatus -b in a 100% NT environment

2002-12-16 Thread Guillaume LACHENAL
Is there way to obtain the same result thant 'smbstatus -b'
(ie knowing who is logged in which computer) when the PDC
is a not a Samba one ?

Is there a way to request this type of query on a NT PDC ?
(third party {linux|win32} tools / urls welcomed)

Or is there another way to do it via network sniffing ?

thanks a lot !

regards,

Guillaume



Re: Memory leak in smbd

2002-12-16 Thread Gerald (Jerry) Carter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sat, 14 Dec 2002, Ken Cross wrote:

 Guys:
 
 While running NetBench against SAMBA_3_0, there appears to be a memory
 leak.  The smbd process just keeps growing and I eventually see things
 like this in the log:

We're trying to track down somethign similar isthe APPLIANCE_HEAD
branch.  Probably the same bug.  Hope to finish it off this week.

Can you send me some more details like the VSZ of the smbd process
in question, smb.conf, action being performed by the connected 
client, etc...




cheers, jerry
 --
 Hewlett-Packard- http://www.hp.com
 SAMBA Team -- http://www.samba.org
 GnuPG Key   http://www.plainjoe.org/gpg_public.asc
 ISBN 0-672-32269-2 SAMS Teach Yourself Samba in 24 Hours 2ed
 You can never go home again, Oatman, but I guess you can shop there.  
--John Cusack - Grosse Point Blank (1997)

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.0 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQE9/d7vIR7qMdg1EfYRAkX1AKDHd2gSL5SWophbpHWYqDBoRNyQpgCgoRPd
Ey2YeexuCFDFF/XbNN/GFAs=
=aYUm
-END PGP SIGNATURE-




Re: samba 3.0 pre21:joining domain with windows 2000

2002-12-16 Thread Lars O. Grobe
Hi,

I just changed in smb.conf the use spnego setting from no to yes, and now it 
works fine.

It's funny, I don't understand it, but in fact, our windows-admin-team can 
live a lot better with this ;-)

CU, Lars.



Re: Patch for solaris 2.x to provide nsswitch wins resolution

2002-12-16 Thread David Collier-Brown -- Customer Engineering
Steven Tamm wrote:
 
 Sorry if this is not the right forum, but the documents on the website kind
 of implied I should send this to the list.
 
 I needed to get wins resolution added on Solaris to nsswitch specifically
 for gethostbyname.  The problem was that libnss_wins.so didn't include the
 solaris wrapper and that libnss_winbind.so didn't include gethostbyname.
 Here is a patch off of 2.2.7a that solves both issues (I'm not sure about
 the #if SUN).

  The predefined macros fron a Sun SC-series compilers are
   __sun
   __unix
   __SUNPRO_C=0x500
   __sparc (SPARC)
   __sparcv9 (SPARC with -xarch=v9|v9a)
   __i386 (x86)
   __SVR4
Not that those are double leading underscores.  From memory
and a quick check on linux, GCC defines a partially overlapping 
set including __linux and __sun.






--dave
-- 
David Collier-Brown,   | Always do right. This will gratify 
Sun Microsystems DCMO  | some people and astonish the rest.
Toronto, Ontario   |
(905) 415-2849 or x52849   | [EMAIL PROTECTED]



RE: ntfs issue

2002-12-16 Thread Esh, Andrew
Title: RE: ntfs issue





Note that he didn't say he was mounting the NTFS disk remotely. He could be dual booting this host, and he may need to use the disk in both environments.

-Original Message-
From: Steve Williams [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 15, 2002 9:54 PM
To: AndyChu
Cc: [EMAIL PROTECTED]
Subject: Re: ntfs issue



Why in the hell are you doing that???


Why aren't you accessing the 80 G of mpeg files directly from the W2K
system instead of going through your Linux system?


What are you trying to accomplish? Doesn't make sense to me why you are
doing it that way!


Cheers,
Steve


AndyChu wrote:


Thx for reply. May be I have to tell the story in detail. I have about 80G's MPEG file in the hard disk with format of NTFS without any security setting.


Yesterday, I tried to mount the hard disk in redhat 8.0 (kernel Version 2.4.18-14) with download  install the suitable ntfs service pack(from linux-ntfs.sourceforge.net). I mount it on the /tmp/win directory. It success. I can see it at linux side. And then I launch the samba server and make the /tmp directoy be shared with name tmp. I checked by using smbclient utility indise the linux platform to connect the samba server. The MPEG files can be seen inside tmp/win without problem. After that, I use a win2000 workstation to connect that shared 'tmp' on samba server. Those file inside the tmp directory can be seen(that is the linux file) but the MPEG files inside directoy tmp/win cannot be shown. That's what I would like to say.


Thanks 
 - Original Message - 
 From: Esh, Andrew 
 To: 'Steve Langasek' ; AndyChu 
 Cc: [EMAIL PROTECTED] 
 Sent: Friday, December 13, 2002 3:41 AM
 Subject: RE: ntfs issue


 (I assume you're asking about serving an NTFS partition via Samba, which is being hosted on a non-Windows OS which is capable of mounting NTFS partitions.)


 You'd have to depend on the quality of the NTFS support on the OS of the host which is running Samba. It may not support features like Extended Attributes, which would prevent ACL storage and the NT Security System from working. There may also be some filename length and case mangling rules that aren't the same. Depends on the OS, depends on the NTFS mount support.


 Other than that, simple unsecured file service should work. 

 -Original Message- 
 From: Steve Langasek [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, December 12, 2002 9:46 AM 
 To: AndyChu 
 Cc: [EMAIL PROTECTED] 
 Subject: Re: ntfs issue 



 On Thu, Dec 12, 2002 at 04:06:55PM +0800, AndyChu wrote: 
  Does samba support share those files in a ntfs partition ? 

 This is meaningless. Samba does not support NTFS partitions, because 
 Samba does not interface with partitions. If you are asking whether 
 Samba can *serve* shares from NTFS partitions, that's a question of 
 whether the host OS supports the filesystem. If you are asking whether 
 Samba (smbclient) can *access* shares on NTFS partitions, then yes -- 
 though NTFS has little to do with it. 

 -- 
 Steve Langasek 
 postmodern programmer 


 






RE: Memory leak in smbd

2002-12-16 Thread Ken Cross
Hmm ... I updated SAMBA_3_0 from cvs last night, re-built and it fixed
it.  It's certainly not obvious what code changes from late last week
affected it, though.  Go figure.

Thanks,
Ken


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Gerald
(Jerry) Carter
Sent: Monday, December 16, 2002 9:11 AM
To: Ken Cross
Cc: [EMAIL PROTECTED]
Subject: Re: Memory leak in smbd


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sat, 14 Dec 2002, Ken Cross wrote:

 Guys:
 
 While running NetBench against SAMBA_3_0, there appears to be a memory

 leak.  The smbd process just keeps growing and I eventually see things

 like this in the log:

We're trying to track down somethign similar isthe APPLIANCE_HEAD
branch.  Probably the same bug.  Hope to finish it off this week.

Can you send me some more details like the VSZ of the smbd process in
question, smb.conf, action being performed by the connected 
client, etc...




cheers, jerry
 --
 Hewlett-Packard- http://www.hp.com
 SAMBA Team -- http://www.samba.org
 GnuPG Key   http://www.plainjoe.org/gpg_public.asc
 ISBN 0-672-32269-2 SAMS Teach Yourself Samba in 24 Hours 2ed
 You can never go home again, Oatman, but I guess you can shop there.

--John Cusack - Grosse Point Blank (1997)

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.0 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQE9/d7vIR7qMdg1EfYRAkX1AKDHd2gSL5SWophbpHWYqDBoRNyQpgCgoRPd
Ey2YeexuCFDFF/XbNN/GFAs=
=aYUm
-END PGP SIGNATURE-




net rpc shutdown - how to poweroff

2002-12-16 Thread Willi Mann
Hi!

Is there any possibility to not only shut down but to power off a remote 
(w2k) machine with the net rpc shutdown command?
I'd really need it because some users tend to be too lazy to power off 
their machines.

Please help me.


Willi



RE: net rpc shutdown - how to poweroff

2002-12-16 Thread James Willard
Willi,

Most PCs that use ATX power supplies will turn themselves off after a
shutdown. If your PCs do, then using 'net rpc shutdown' should start the
shutdown process, which once completed, the PC (not samba) is
responsible for turning itself off. I have seen some ATX systems that
won't turn themselves off and instead they sit at the w2k Turn off
Computer screen. I haven't really messed with them enough to track down
why. My guess is the motherboard doesn't support the off command, or
the right w2k power management drivers weren't loaded.

James Willard
[EMAIL PROTECTED]


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Willi Mann
Sent: Monday, December 16, 2002 1:02 PM
To: samba-technical
Subject: net rpc shutdown - how to poweroff


Hi!

Is there any possibility to not only shut down but to power off a remote

(w2k) machine with the net rpc shutdown command?
I'd really need it because some users tend to be too lazy to power off 
their machines.

Please help me.


Willi




RE: Patch for solaris 2.x to provide nsswitch wins resolution

2002-12-16 Thread Steven Tamm
The configure.in script defines SUNOS5 if the host_os is solaris.  I wasn't
questioning whether or not the predefine was correct, I was questioning
whether it was appropriate, considering that in the configure.in
winbind_nss_solaris is included on HPUX.  So the wins.c solaris portion
probably also needs to include HPUX.

I don't know how the samba team is organized; but my assumption was that
whoever was dealing with winbind and nsswitch would know what to do with the
#ifdef, whether that would be place that code in a separate file called
wins_solaris.c or create another AC_DEFINE like NSSWITCH_CONSTR_STYLE or
something like that.

-Steven

 
   The predefined macros fron a Sun SC-series compilers are
__sun
__unix
__SUNPRO_C=0x500
__sparc (SPARC)
__sparcv9 (SPARC with -xarch=v9|v9a)
__i386 (x86)
__SVR4
 Not that those are double leading underscores.  From memory
 and a quick check on linux, GCC defines a partially overlapping 
 set including __linux and __sun.

To get a full list of possibly-predefined symbols on
a particular installation of gcc, you can do something
like
  tr ' ' '\012'  /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs | grep D
| sed 's/.*-D//' | sort -u

but it's better to do autoconf-style feature tests than
#if operatingsystem
style tests, isn't it?

- Dan



Re: SetPrinter call failed, APW, rpcclient setdriver fails, helpplease

2002-12-16 Thread Jason Jeremias
The change Arcady suggested did not solve the problem.  I have level 10 
logs of what's going on but I can't make heads or tails out of it.  I 
seem some errors about INSUFFICIENT_BUFFER, Returning NULL Devicemode!.  
I am going to post as small portion of the log, as it seems to be the 
problem.  I was running the command  setdriver A_MIS_4000 HP 
LaserJet 4000 Series PCL 6  in rpcclient as root

2002/12/16 11:06:56, 10] printing/nt_printing.c:get_a_printer(3306)
 get_a_printer: [A_MIS_4000] level 2 returning WERR_OK
 Converting info_2 struct
[2002/12/16 11:06:56, 7] 
rpc_parse/parse_spoolss.c:uni_2_asc_printer_info_2(5346)
 Converting from UNICODE to ASCII
 start converting
[2002/12/16 11:06:56, 5] rpc_server/srv_spoolss_nt.c:check_printer_ok(4869)
 check_printer_ok: servername=\\cartman 
printername=\\cartman\A_MIS_4000 sharename=A_MIS_4000 portname=Samba 
Printer Port drivername=HP LaserJet 4000 Series PCL 6 comment=Anchorage 
- MIS HP4000 Printer location=
[2002/12/16 11:06:56, 3] rpc_server/srv_spoolss_nt.c:update_printer(5291)
 update_printer: printer property change denied by handle
[2002/12/16 11:06:56, 5] rpc_parse/parse_prs.c:prs_debug(60)
 00 spoolss_io_r_setprinter
[2002/12/16 11:06:56, 5] rpc_parse/parse_prs.c:prs_werror(648)
  status: WERR_ACCESS_DENIED
[2002/12/16 11:06:56, 5] rpc_server/srv_pipe.c:api_rpcTNP(1218)
 api_rpcTNP: called api_spoolss_rpc successfully
[2002/12/16 11:06:56, 3] rpc_server/srv_pipe_hnd.c:free_pipe_context(444)
 free_pipe_context: destroying talloc pool of size 1402
[2002/12/16 11:06:56, 10] rpc_server/srv_pipe_hnd.c:write_to_pipe(766)
 write_to_pipe: data_used = 520
[2002/12/16 11:06:56, 6] rpc_server/srv_pipe_hnd.c:read_from_pipe(799)
 read_from_pipe: 70d4 name: spoolss len: 536

This ACCESS_DENIED in spoolss_io_r_setprinter seems to be the problem. 
Trouble is I don't know why I would get an Access denied? I'm not sure 
if I should post the whole logs to the list?  Could someone help?


Thanks you

Jason


Arcady Chernyak wrote:

Hi Jason.
May be I had the same problem and I solved it.
I migrate from Samba 2.2.2 to Samba 2.2.7
When I try to install drivers I got the same response.
(NT_STATUS_UNSUCCESSFUL).

After that I analyzed log files from SAMBA and detect that call fall
with debug message: _spoolss_addprinterex: Attempted to add a printer
named [%s] when one already existed! (File rpc_server/srv_spoolss_nt.c
line 6514).

This check is a new feature (who needs it) which affect to me.
I have simply commented it like:
   /* check to see if the printer already exists */
/*
   if ((snum = print_queue_snum(printer-info_2-sharename)) != -1) {
   DEBUG(5, (_spoolss_addprinterex: Attempted to add a printer
named [%s] when one already existed!\n, 
   printer-info_2-sharename));
   free_a_printer(printer, 2);
   return WERR_PRINTER_ALREADY_EXISTS;
   }*/

After this change all is working well.
Try it I hope it can help you.
If it does not help, take a SAMBA log file level  6 in installation
time and try to catch what is the reason of your fault.

If anybody knows how to solve it more intelligent, he is welcome.

Regards
	Arcady



-Original Message-
From: Jason Jeremias [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 13, 2002 4:09 PM
To: [EMAIL PROTECTED]
Subject: SetPrinter call failed, APW, rpcclient setdriver fails, help
please

I'm trying to add print drivers to printers on a Samba server using a 
NT4 workstation.  I'm currently running Samba 2.2.7a  CUPS 1.1.17, when
I attempt to add drivers to the new printer it crashes the NT4
workstation.  Prior to the workstation crashing however it does copy the
driver files to the server, it then pauses as if the workstation is
waiting for some information from the server.  In troubleshooting the
problem I've found this much out.

With the following settings in my smb.conf file:
printcap name = cups
load printers = yes
printing = cups

enumdrivers works as expected it even lists the driver I attempted to 
add from the NT4 workstations.

enumprinters works also I can see all the printers I'm supposed to.

setdriver however  fails as seen here:
rpcclient $ setdriver A_CC_HP4300 HP LaserJet 4300 PCL6
SetPrinter call failed!
result was NT_STATUS_UNSUCCESSFUL


I can provide any files/debug info try anything needed to help solve the
problem, any help is greatly appreciated.

Thanks!

-Jason





 








genparse stuff

2002-12-16 Thread Stefan (metze) Metzmacher
Hi Simo,

here's a possible fix...

there's a new problem now.

include/proto.h:354: warning: `struct parse_string' declared inside 
parameter list

did you forgot a genparse.h 


metze
-
Stefan metze Metzmacher [EMAIL PROTECTED]diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so 
--exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure 
--exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=config.* 
--exclude=bin --exclude=*.configure HEAD/source/include/genparser.h 
HEAD-modules/source/include/genparser.h
--- HEAD/source/include/genparser.h Thu Jan  1 01:00:00 1970
+++ HEAD-modules/source/include/genparser.h Mon Dec 16 19:35:12 2002
@@ -0,0 +1,80 @@
+/*
+   Copyright (C) Andrew Tridgell [EMAIL PROTECTED] 2002
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+
+#ifndef _GENSTRUCT_H
+#define _GENSTRUCT_H
+/* these macros are needed for genstruct auto-parsers */
+#define _LEN(x)
+#define _NULLTERM
+
+
+/*
+  automatic marshalling/unmarshalling system for C structures
+*/
+
+enum parse_type {T_INT, T_UNSIGNED, T_CHAR,
+T_FLOAT, T_DOUBLE, T_ENUM, T_STRUCT,
+T_TIME_T, T_LONG, T_ULONG};
+
+/* flag to mark a fixed size array as actually being null terminated */
+#define FLAG_NULLTERM 1
+#define FLAG_ALWAYS 2
+
+struct enum_struct {
+   const char *name;
+   unsigned value;
+};
+
+/* intermediate dumps are stored in one of these */
+struct parse_string {
+   unsigned allocated;
+   unsigned length;
+   char *s;
+};
+
+typedef int (*gen_dump_fn)(struct parse_string *, const char *ptr, unsigned indent);
+typedef int (*gen_parse_fn)(char *ptr, const char *str);
+
+/* genstruct.pl generates arrays of these */
+struct parse_struct {
+   const char *name;
+   unsigned ptr_count;
+   unsigned size;
+   unsigned offset;
+   unsigned array_len;
+   const char *dynamic_len;
+   unsigned flags;
+   gen_dump_fn dump_fn;
+   gen_parse_fn parse_fn;
+};
+
+#define DUMP_PARSE_DECL(type) \
+  int gen_dump_ ## type(struct parse_string *, const char *, unsigned); \
+  int gen_parse_ ## type(char *, const char *);
+
+DUMP_PARSE_DECL(char)
+DUMP_PARSE_DECL(int)
+DUMP_PARSE_DECL(unsigned)
+DUMP_PARSE_DECL(double)
+DUMP_PARSE_DECL(float)
+
+#define gen_dump_unsigned_char gen_dump_char
+#define gen_parse_unsigned_char gen_parse_char
+
+#endif /* _GENSTRUCT_H */
\ No newline at end of file
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so 
--exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure 
--exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=config.* 
--exclude=bin --exclude=*.configure HEAD/source/include/includes.h 
HEAD-modules/source/include/includes.h
--- HEAD/source/include/includes.h  Thu Dec 12 20:24:26 2002
+++ HEAD-modules/source/include/includes.h  Mon Dec 16 19:34:18 2002
@@ -713,6 +713,7 @@ extern int errno;
 #include ../tdb/tdbutil.h
 #include talloc.h
 #include nt_status.h
+#include genparser.h
 #include ads.h
 #include interfaces.h
 #include hash.h



Re: smbclient tar large files broken on 2.2.7a

2002-12-16 Thread Herb Lewis
Thanks for the great debugging. Try the following patch and see if
it corrects all your issues.
-- 
==
Herb Lewis   Silicon Graphics 
Networking Engineer  1600 Amphitheatre Pkwy MS-510
Strategic Software Organization  Mountain View, CA  94043-1351
[EMAIL PROTECTED] Tel: 650-933-2177
http://www.sgi.com   Fax: 650-932-2177  
PGP Key: 0x8408D65D
==
Index: clitar.c
===
RCS file: /data/cvs/samba/source/client/clitar.c,v
retrieving revision 1.74.4.7
diff -u -r1.74.4.7 clitar.c
--- clitar.c18 Mar 2002 22:08:01 -  1.74.4.7
+++ clitar.c16 Dec 2002 21:15:08 -
@@ -45,10 +45,10 @@
 
 struct file_info_struct
 {
-  size_t size;
+  SMB_BIG_UINT size;
   uint16 mode;
-  int uid;
-  int gid;
+  uid_t uid;
+  gid_t gid;
   /* These times are normally kept in GMT */
   time_t mtime;
   time_t atime;
@@ -643,6 +643,7 @@
 finfo.mtime = finfo1 - mtime;
 finfo.atime = finfo1 - atime;
 finfo.ctime = finfo1 - ctime;
+finfo.name  = finfo1 - name;
   }
   else {
 finfo.size  = def_finfo.size;
@@ -652,13 +653,14 @@
 finfo.mtime = def_finfo.mtime;
 finfo.atime = def_finfo.atime;
 finfo.ctime = def_finfo.ctime;
+finfo.name  = def_finfo.name;
   }
 
   if (dry_run)
 {
-  DEBUG(3,(skipping file %s of size %d bytes\n,
+  DEBUG(3,(skipping file %s of size %12.0f bytes\n,
   finfo.name,
-  (int)finfo.size));
+  (double)finfo.size));
   shallitime=0;
   ttarf+=finfo.size + TBLOCK - (finfo.size % TBLOCK);
   ntarf++;
@@ -1868,7 +1870,7 @@
 if (tar_type=='c'  (dry_run || strcmp(argv[Optind], /dev/null)==0))
   {
if (!dry_run) {
- DEBUG(0,(Output is /dev/null, assuming dry_run));
+ DEBUG(0,(Output is /dev/null, assuming dry_run\n));
  dry_run = True;
}
tarhandle=-1;



Re: smbclient tar large files broken on 2.2.7a

2002-12-16 Thread Brian Poole
Quoting Herb Lewis ([EMAIL PROTECTED]) from 16 December 2002:
 Thanks for the great debugging. Try the following patch and see if
 it corrects all your issues.

Yes, this looks good from a quick test. We shall see if it passes 
the amanda test for backing up the data this evening. I'll report 
back if there are any more problems with it.

Thanks for the quick fix.. I had done something similar but would
rather trust someone more familiar with the code.

 +  DEBUG(3,(skipping file %s of size %12.0f bytes\n,

Might be worth changing this to %.0f just to match the style in 
the other parts of the code. Just a nitpick.

Have a good day,


-b



Samba CPU Usage with large directories ...

2002-12-16 Thread Scott Taylor
Hi.

We have a samba server running version 2.2.5 on kernel 2.4.18 with the SGI XFS patch. The shared 
volume consists of an XFS partition on a 3-ware raid5 controller. The network connection is via a 4 
port bonded pipe to the switch.

We notice that the samba CPU usage during write operations increases dramatically once a directory 
contains more than a certian number of files - thought to be somewhere around the 1500 to 2000 mark.

We have tried allowing samba more memory, which did not seem to help - and have had little or no 
success finding any information on the web, hence this post.

Thanks for your attention and help,

Scott



Creating sparse files over SMB

2002-12-16 Thread Conrad Minshall
Has anyone tried NT_TRANSACT_IOCTL for sparse files over SMB?  Natively in
Windows sparseness never seems to be an implied aspect of a write beyond
EOF but it could be a nice performance win to do so. Both client and server
side are interesting.

See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/spa
rse_files.asp for some native documentation.


--
Conrad Minshall ... [EMAIL PROTECTED] ... 408 974-2749
Alternative email addresses: [EMAIL PROTECTED] and [EMAIL PROTECTED]





pdbedit segfaults in SAMBA_3_0

2002-12-16 Thread Bradley W. Langhorst
it has not changed from alpha21 
(which also segfaulted)
a20 did not segfault

i'm compiling with --with-ldapsam and --with-tdbsam
tried both with and without steve's latest debian patches.


as noted in the last check in (a month ago)

Removed global_myworkgroup, global_myname, global_myscope. Added
liberal dashes of const. This is a rather large check-in, some
things may break. It does compile though :-).
Jeremy.

pdbedit -h shows help normally
pdbedit -l segfaults
pdbedit -b (tried all combinations of ldap ldapsam unix unixsam tdb tdbsam all 
segfault)

here's my entire ./configure line
in case you're interested
--with-fhs \
--prefix=/usr \
--sysconfdir=/etc \
--libdir=/etc/samba \
--with-privatedir=/etc/samba \
--localstatedir=/var \
--with-netatalk \
--with-smbmount \
--with-pam \
--with-syslog \
--with-sambabook \
--with-utmp \
--with-readline \
--with-pam_smbpass \
--with-libsmbclient \
--with-winbind \
--with-msdfs \
--with-automount \
--with-acl-support \
--with-tdbsam \
--with-ldapsam

I can compile a20 with a similar ./configure and don't see the pdbedit segfault

brad


-- 
Bradley W. Langhorst [EMAIL PROTECTED]




strange location for printing/*.tdb in latest

2002-12-16 Thread Bradley W. Langhorst
the printing tdbs are ending up in 
/var/run/samba/printing

seems like those should be in cache...

its not a problem with the rules file

LOCKDIR is getting set to /var/cache/samba
PIDDIR is /var/run/samba

i don't understand what is happening with tdb files in printing.c
so I don't now how to track this down further...

brad

-- 
Bradley W. Langhorst [EMAIL PROTECTED]




Re: strange location for printing/*.tdb in latest

2002-12-16 Thread Steve Langasek
On Mon, Dec 16, 2002 at 10:49:02PM -0500, Bradley W. Langhorst wrote:
 the printing tdbs are ending up in 
 /var/run/samba/printing

 seems like those should be in cache...

 its not a problem with the rules file

 LOCKDIR is getting set to /var/cache/samba
 PIDDIR is /var/run/samba

 i don't understand what is happening with tdb files in printing.c
 so I don't now how to track this down further...

Hmm, sounds like this is a Debian-specific problem.  I'll hunt this down
and let you know.

-- 
Steve Langasek
postmodern programmer



msg05000/pgp0.pgp
Description: PGP signature


Kerberized SMB client? User level SMB client?

2002-12-16 Thread Naomaru Itoi
Title: Kerberized SMB client?  User level SMB client?





Hi, 


I am trying to do PKINT from SMB/CIFS client on several UNIX platforms. 


1. Is there an open-sourced, Kerberized SMB/CIFS client on UNIX?
2. If not ... I guess I have to Kerberize an SMB/CIFS client. In that case, I would like to avoid doing GSS-API and Kerberos in kernel. Is there an open-sourced, user-level SMB/CIFS client? 

Thank you. 





Re: Kerberized SMB client? User level SMB client?

2002-12-16 Thread Steve Langasek
On Mon, Dec 16, 2002 at 08:05:36PM -0800, Naomaru Itoi wrote:

 I am trying to do PKINT from SMB/CIFS client on several UNIX platforms. 

 1. Is there an open-sourced, Kerberized SMB/CIFS client on UNIX?
 2. If not ... I guess I have to Kerberize an SMB/CIFS client.  In that case,
 I would like to avoid doing GSS-API and Kerberos in kernel.  Is there an
 open-sourced, user-level SMB/CIFS client? 

The smbclient program from Samba 3.0 does have early support for
Kerberos.  I'm not sure if that code path gets tested regularly, but
it's there at lesat.

-- 
Steve Langasek
postmodern programmer



msg05002/pgp0.pgp
Description: PGP signature


RE: Kerberized SMB client? User level SMB client?

2002-12-16 Thread Naomaru Itoi
Title: RE: Kerberized SMB client?  User level SMB client?





Thanks, Steve, 


I was actually asking about SMB/CIFS client *filesystem*. Excuse me for being unclear ... 


 -Original Message-
 From: Steve Langasek [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 16, 2002 8:22 PM
 To: Naomaru Itoi
 Cc: [EMAIL PROTECTED]
 Subject: Re: Kerberized SMB client? User level SMB client?
 
 
 On Mon, Dec 16, 2002 at 08:05:36PM -0800, Naomaru Itoi wrote:
 
  I am trying to do PKINT from SMB/CIFS client on several 
 UNIX platforms. 
 
  1. Is there an open-sourced, Kerberized SMB/CIFS client on UNIX?
  2. If not ... I guess I have to Kerberize an SMB/CIFS 
 client. In that case,
  I would like to avoid doing GSS-API and Kerberos in kernel. 
 Is there an
  open-sourced, user-level SMB/CIFS client? 
 
 The smbclient program from Samba 3.0 does have early support for
 Kerberos. I'm not sure if that code path gets tested regularly, but
 it's there at lesat.
 
 -- 
 Steve Langasek
 postmodern programmer