Is SAMBA samfs aware of?

2002-04-19 Thread Tian-xiong Lu



Hi there,

we are running SAMBA 2.0.7 (bit older) on a Solaris 
2.7 box on which
there are standard UFS filesystem and SAMFS 
filesystem as well.

The SAMFS is a filesystem used in HSMwhere 
files can be automatically
archived to removable devices such as tapes and 
then files can be released
from disks and become offline. The Windows 2000 
"remote storage" is
something similar to this. 

Our SAMBA server serves both UFS and samfs to 
windows workstations.
I notice that when a user trys to open a samfs file 
that is offline, the user
gets an error message. MS claims that windows 2000 
can recognise offline
files when its "remote storage" being used. It will 
show an icon indicating
offlined files. When a user trys to open an offline 
file it will let the user wait until
the file online. I just wonder if SAMBA can make 
windows 2000 be aware of
offline files on the SAMBA server?

regards,

Tian




[PATCH] fix bug in lpq parsing

2002-04-19 Thread Martin Pool

This patch merges some missing code from 1.2.4.4 on APPLIANCE_HEAD
into head, fixing a bug in the parser for lpq output.  

Basically we're trying to concatenate several fields into a single
string, but the calculation of the amount of space remaining is wrong.
This causes a crash when there are a lot of fields in the output,
because a negative value can be passed as the length parameter to
safe_strcat.

This was originally HP Nautilus CR #430.

Please let me know if it's OK.


Index: lpq_parse.c
===
RCS file: /data/cvs/samba/source/printing/lpq_parse.c,v
retrieving revision 1.11
diff -u -u -r1.11 lpq_parse.c
--- lpq_parse.c 2002/03/15 08:14:06 1.11
+++ lpq_parse.c 2002/04/19 07:28:02
 -149,21 +149,17 
   StrnCpy(buf-fs_file,tok[FILETOK],sizeof(buf-fs_file)-1);
 
   if ((FILETOK + 1) != TOTALTOK) {
-int bufsize;
 int i;
 
-bufsize = sizeof(buf-fs_file) - strlen(buf-fs_file) - 1;
-
 for (i = (FILETOK + 1); i  TOTALTOK; i++) {
-  safe_strcat(buf-fs_file, ,bufsize);
-  safe_strcat(buf-fs_file,tok[i],bufsize - 1);
-  bufsize = sizeof(buf-fs_file) - strlen(buf-fs_file) - 1;
-  if (bufsize = 0) {
-break;
-  }
+  /* FIXME: Using fstrcat rather than other means is a bit
+   * inefficient; this might be a problem for enormous queues with
+   * many fields. */
+  fstrcat(buf-fs_file,  );
+  fstrcat(buf-fs_file, tok[i]);
 }
 /* Ensure null termination. */
-buf-fs_file[sizeof(buf-fs_file)-1] = '\0';
+fstrterminate(buf-fs_file);
   }
 
 #ifdef PRIOTOK
 -282,21 +278,17 
   StrnCpy(buf-fs_file,tokarr[LPRNG_FILETOK],sizeof(buf-fs_file)-1);
 
   if ((LPRNG_FILETOK + 1) != LPRNG_TOTALTOK) {
-int bufsize;
 int i;
 
-bufsize = sizeof(buf-fs_file) - strlen(buf-fs_file) - 1;
-
 for (i = (LPRNG_FILETOK + 1); i  LPRNG_TOTALTOK; i++) {
-  safe_strcat(buf-fs_file, ,bufsize);
-  safe_strcat(buf-fs_file,tokarr[i],bufsize - 1);
-  bufsize = sizeof(buf-fs_file) - strlen(buf-fs_file) - 1;
-  if (bufsize = 0) {
-break;
-  }
+  /* FIXME: Using fstrcat rather than other means is a bit
+   * inefficient; this might be a problem for enormous queues with
+   * many fields. */
+  fstrcat(buf-fs_file,  );
+  fstrcat(buf-fs_file, tokarr[i]);
 }
 /* Ensure null termination. */
-buf-fs_file[sizeof(buf-fs_file)-1] = '\0';
+fstrterminate(buf-fs_file);
   }
 
   return(True);

-- 
Martin 




[PATCH] backport lprng_time parsing to appl-head

2002-04-19 Thread Martin Pool

This patch backports LPRng_time() from HEAD to APPLIANCE_HEAD without
modification.  As the comment says, it allows Samba to parse LPRng
output that supplies either just a time, or a date and time.

(I believe this fixes HP CR 594, because the lpr on that box supplies
a date.)

I'm not committing this directly because I want to be really careful
about that branch.  Could Tim, Jerry or jra let me know if you think
it's OK?

Thanks,
-- 
Martin



--- lpq_parse.c.~1.2.4.6.~  Fri Apr 19 17:13:30 2002
+++ lpq_parse.c Fri Apr 19 17:34:24 2002
@@ -180,20 +180,39 @@ the lpq output.  The lpq time looks like
 
 [EMAIL PROTECTED] June 30, 1998.
 Modified to work with the re-written parse_lpq_lprng routine.
+
+[EMAIL PROTECTED] Dec 17,1999
+Modified to work with lprng 3.16
+With lprng 3.16 The lpq time looks like
+   23:15:07
+   23:15:07.100
+   1999-12-16-23:15:07
+   1999-12-16-23:15:07.100
+
 */
 static time_t LPRng_time(char *time_string)
 {
-  time_t jobtime;
-  struct tm *t;
+   time_t jobtime;
+   struct tm t;
+
+   jobtime = time(NULL); /* default case: take current time */
+   t = *localtime(jobtime);
 
-  jobtime = time(NULL); /* default case: take current time */
-  t = localtime(jobtime);
-  t-tm_hour = atoi(time_string);
-  t-tm_min = atoi(time_string+3);
-  t-tm_sec = atoi(time_string+6);
-  jobtime = mktime(t);
+   if ( atoi(time_string)  24 ){
+   t.tm_hour = atoi(time_string);
+   t.tm_min = atoi(time_string+3);
+   t.tm_sec = atoi(time_string+6);
+   } else {
+   t.tm_year = atoi(time_string)-1900;
+   t.tm_mon = atoi(time_string+5)-1;
+   t.tm_mday = atoi(time_string+8);
+   t.tm_hour = atoi(time_string+11);
+   t.tm_min = atoi(time_string+14);
+   t.tm_sec = atoi(time_string+17);
+   }
+   jobtime = mktime(t);
 
-  return jobtime;
+   return jobtime;
 }
 
 




Re: Using nmbd without smb for browsing

2002-04-19 Thread LIBAULT David

Thank you very much for your answer. I will try to run smbd on my system, and 
check that it works.

The problem I have is that smbd (and nmbd) as I have built them are huge 
files even after being stripped (I get 1.5Mbytes for smbd and 615kbytes for 
nmbd). Is there a way to build smbd with only the necessary code to handle 
the browse list requests (and not file, printer, sharing, password controlled 
access ...) ? In other words is smbd modular in some way ?

Regards,

David.

Le Vendredi 19 Avril 2002 01:44, [EMAIL PROTECTED] a écrit :
 Hi,

 If you want Samba to act as a browse master then you need to be running
 smbd. The way that it works is that nmbd will collect the browsing
 information and write it to the browse.dat file. When a client wants to
 retrieve the browse list it will connect to the IPC$ share on the machine
 and issue a request to receive the browse list, thus requiring smbd to be
 running. Smbd will then read the browse.dat file to server this
 information.


 Note that this is a completely separate function from being a WINS server.
 Without smbd running you will not be able to browse, but you should still
 be able to access the computer by name, e.g. by typing \\machine in the Run
 dialog box.

 Cheers,

 Martin.

 -Original Message-
 From: LIBAULT David [mailto:[EMAIL PROTECTED]]
 Sent: Friday, 19 April 2002 3:10 AM
 To: [EMAIL PROTECTED]
 Subject: Using nmbd without smb for browsing

 Hi all,

 I would like 2 Windows PCs connected with PPP to a linux box to share
 their
 files and printers using netbios.

 The linux box doesn't have to appear in the network neighbourhood.
 So I run nmbd (and NOT smbd) in the linux box with the appropriate options
 in
 smb.conf to be a wins server and to be the domain browse master and local
 browse master (as I saw in the file browse.txt in the docs).

 One of the Windows PC is an XP computer. On this machine in the
 neighbourhood I see the workgroup name a entered in smb.conf
 (MY_WORKGROUP),

 but I can't browse it. The name resolution looks good though (I can ping
 the

 windows name of the linux box).

 In the tcpdump on this connection, it looks like the client sees the linux
 box (BLUEDSL), and the try to connect to a TCP port (that would probably be
 handled by smbd if it were here).

 Is there any chance I could make this configuration work ? Is anyone
 interested in having more logs/config files ?

 Regards,

 David.


 ps :

 I use samba  2.2.3a and  the linux box is based on an ARM processor, linux
 2.4.17.
 tcpdump on the linux box :

 linux box : name BLUEDSL, IP : 10.0.0.1
 XP machine : name CMO_LAP, IP : 10.7.58.2

 ...
 10  20.14 10.0.0.1 - 10.7.58.2NBNS Registration response NB
 10.7.58.2
  11  20.1810.7.58.2 - 10.0.0.1 NBNS Registration NB
 MY_WORKGROUP
   00
  12  20.18 10.0.0.1 - 10.7.58.2NBNS Registration response NB
 10.7.58.2
  13  20.2110.7.58.2 - 10.0.0.1 NBNS Registration NB CMO_LAP

 20
  14  20.21 10.0.0.1 - 10.7.58.2NBNS Wait for acknowledgment
 response
  15  20.2210.7.58.2 - 10.0.0.1 NBNS Registration NB
 MY_WORKGROUP
   1e
  16  20.22 10.0.0.1 - 10.7.58.2NBNS Registration response NB
 10.7.58.2
  17  26.8010.7.58.2 - 255.255.255.255 BROWSER Get Backup List
 Request
  18  26.80 10.0.0.1 - 10.7.58.2BROWSER Get Backup List
 Response 19  26.8110.7.58.2 - 10.0.0.1 NBNS Name query NB
 MY_WORKGROUP

 1b
  20  26.81 10.0.0.1 - 10.7.58.2NBNS Name query response NB
 10.0.0.1
  21  26.8310.7.58.2 - 10.0.0.1 BROWSER Get Backup List Request
  22  26.8310.7.58.2 - 10.0.0.1 NBNS Name query NB BLUEDSL

 20
  23  26.83 10.0.0.1 - 10.7.58.2BROWSER Get Backup List
 Response 24  26.84 10.0.0.1 - 10.7.58.2NBNS Name query
 response NB 10.0.0.1
  25  26.8510.7.58.2 - 10.0.0.1 TCP 3111  netbios-ssn [SYN]
 Seq=1608383483 Ack=0 Win=16384 Len=0
  26  26.85 10.0.0.1 - 10.7.58.2TCP netbios-ssn  3111 [RST,
 ACK]
 Seq=0 Ack=1608383484 Win=0 Len=0
  27  27.3410.7.58.2 - 10.0.0.1 TCP 3111  netbios-ssn [SYN]
 Seq=1608383483 Ack=0 Win=16384 Len=0
  28  27.34 10.0.0.1 - 10.7.58.2TCP netbios-ssn  3111 [RST,
 ACK]
 Seq=0 Ack=1608383484 Win=0 Len=0
  29  27.8610.7.58.2 - 10.0.0.1 TCP 3111  netbios-ssn [SYN]
 Seq=1608383483 Ack=0 Win=16384 Len=0
  30  27.86 10.0.0.1 - 10.7.58.2TCP netbios-ssn  3111 [RST,
 ACK]
 Seq=0 Ack=1608383484 Win=0 Len=0
  31  27.8810.7.58.2 - 10.0.0.1 NBNS Name query NB BLUEDSL

 20
  32  27.89 10.0.0.1 - 10.7.58.2NBNS Name query response NB
 10.0.0.1
  33  27.9010.7.58.2 - 10.0.0.1 TCP 3112  netbios-ssn [SYN]
 Seq=1608672262 Ack=0 Win=16384 Len=0
  34  27.90 10.0.0.1 - 10.7.58.2TCP netbios-ssn  3112 [RST,
 ACK]
 Seq=0 Ack=1608672263 Win=0 Len=0
  35  28.3510.7.58.2 - 10.0.0.1 TCP 3112  netbios-ssn [SYN]
 

plenty of samba daemons..

2002-04-19 Thread Prasad, Sreenivasa

Hi,

What is the reason for plenty of samba daemons  after copying a large no. of
files to my samba server.
How do I tune this?

Regards,

V.Sreenivasa Prasad.






Re: IPv6 patch for Samba 2.2.3a is available

2002-04-19 Thread Gerald Carter

On Thu, 18 Apr 2002, Nathan Lutchansky wrote:

  Naturally, any patch would need to be to HEAD.
 
 Of course.  The Samba 2.2.3a patch is only for prototyping and to provide
 support for those users who don't want to run HEAD code on their
 production systems.  :-)  Once I get some sort of blessing from a
 developer willing and able to commit a patch to CVS, I'll adapt the thing
 to HEAD.  -Nathan

Nathan,

Might i suggest that you post the link for the 2.2.3a patch to the main 
samba mailing list?  Like bartlett said, this support will definitely need 
to go into HEAD as opposed to SAMBA_2_2, but it would be good to get any 
interested people using and and providing feedback.





cheers, jerry
 -
 Hewlett-Packard http://www.hp.com
 SAMBA Team   http://www.samba.org
 --http://www.plainjoe.org
 Sam's Teach Yourself Samba in 24 Hours 2ed.  ISBN 0-672-32269-2
 --I never saved anything for the swim back. Ethan Hawk in Gattaca--





Re: Using nmbd without smb for browsing

2002-04-19 Thread Gerald Carter

On Thu, 18 Apr 2002, LIBAULT David wrote:

 Hi all,
 
 I would like 2 Windows PCs connected with PPP to a linux box to share
 their files and printers using netbios.
 
 The linux box doesn't have to appear in the network neighbourhood. So
 I run nmbd (and NOT smbd) in the linux box with the appropriate options
 in smb.conf to be a wins server and to be the domain browse master and
 local browse master (as I saw in the file browse.txt in the docs).
 
 One of the Windows PC is an XP computer. On this machine in the
 neighbourhood I see the workgroup name a entered in smb.conf
 (MY_WORKGROUP), but I can't browse it. The name resolution looks good
 though (I can ping the windows name of the linux box).

So you are trying to browse the Samba box from the Windows XP 
box but the Samba server is only running nmbd?   Browsing is 
implemented on top of SMB. You'll need smbd for this.





cheers, jerry
 -
 Hewlett-Packard http://www.hp.com
 SAMBA Team   http://www.samba.org
 --http://www.plainjoe.org
 Sam's Teach Yourself Samba in 24 Hours 2ed.  ISBN 0-672-32269-2
 --I never saved anything for the swim back. Ethan Hawk in Gattaca--





Re: Using nmbd without smb for browsing

2002-04-19 Thread LIBAULT David

Le Vendredi 19 Avril 2002 15:35, Gerald Carter a écrit :
 On Thu, 18 Apr 2002, LIBAULT David wrote:
  Hi all,
 
  I would like 2 Windows PCs connected with PPP to a linux box to share
  their files and printers using netbios.
 
  The linux box doesn't have to appear in the network neighbourhood. So
  I run nmbd (and NOT smbd) in the linux box with the appropriate options
  in smb.conf to be a wins server and to be the domain browse master and
  local browse master (as I saw in the file browse.txt in the docs).
 
  One of the Windows PC is an XP computer. On this machine in the
  neighbourhood I see the workgroup name a entered in smb.conf
  (MY_WORKGROUP), but I can't browse it. The name resolution looks good
  though (I can ping the windows name of the linux box).

 So you are trying to browse the Samba box from the Windows XP
 box but the Samba server is only running nmbd?   Browsing is
 implemented on top of SMB. You'll need smbd for this.


No, the linux (samba) box doesn't have to appear in the network 
neighbourhood, just the two (or more) Windows PCs each one connected with 
his own PPP link to the linux box :

Windows PC1 -PPP0- linux box -PPP1-Windows PC2
10.7.48.2 10.0.0.1   10.7.48.3

I just want PC1 to appear in the neighbourhood of PC2 and respectively. The 
linux is the wins server.

But it looks like even for that I need to have 1.6Mbytes of code running in 
addition to the 400k of nmbd...





 cheers, jerry
  -
  Hewlett-Packard http://www.hp.com
  SAMBA Team   http://www.samba.org
  --http://www.plainjoe.org
  Sam's Teach Yourself Samba in 24 Hours 2ed.  ISBN 0-672-32269-2
  --I never saved anything for the swim back. Ethan Hawk in Gattaca--




Win98 not registering in browse base

2002-04-19 Thread LIBAULT David

So, I tried to run smbd in the linux box.

To be able to browse the network with XP and Win2k I had to change the 
security level to share... When in security level = user, it wouldn't work.

Now the problem is that a Win98 PC wouldn't appear in the browse.dat file... 
It appears in the wins.dat file with the right name and IP address. And in 
the network neighbourhood, from the Win98 PC I can see only the PCs 
registered in the browse.dat file but not the Win98 PC itself...

Is there anything special to do to have Win98 PCs listed in the browse.dat 
file ?

David.




Re: Is SAMBA samfs aware of?

2002-04-19 Thread Bill Studenmund

On Fri, 19 Apr 2002, Tian-xiong Lu wrote:

 Hi there,

 we are running SAMBA 2.0.7 (bit older) on a Solaris 2.7 box on which
 there are standard UFS filesystem and SAMFS filesystem as well.

 The SAMFS is a filesystem used in HSM where files can be automatically
 archived to removable devices such as tapes and then files can be released
 from disks and become offline. The Windows 2000 remote storage is
 something similar to this.

 Our SAMBA server serves both UFS and samfs to windows workstations.
 I notice that when a user trys to open a samfs file that is offline, the user
 gets an error message. MS claims that windows 2000 can recognise offline
 files when its remote storage being used. It will show an icon indicating
 offlined files. When a user trys to open an offline file it will let the user wait 
until
 the file online. I just wonder if SAMBA can make windows 2000 be aware of
 offline files on the SAMBA server?

I'm not familiar with SAMFS, but I worked on a similar project for NetBSD.
The problem SAMBA would have with what we did for NetBSD was that we made
it so that userland processes couldn't notice that a file was being
migrated in from tape, so Samba wouldn't have a way to tell. :-|

Take care,

Bill





winbind enum {users|groups} ??

2002-04-19 Thread Jay Ts

Hi,

I was wondering about the winbind enum users and winbind enum groups
parameters. The descriptions in the winbindd(8) and smb.conf(5) manual
pages are a little skimpy.

Am I guessing correctly that:

a) The reason someone might want to turn them off is that on systems
   with a huge number of users (in the NT domain and on the local
   Unix system), the accesses to /etc/passwd and /etc/group can
   bog the system down, due to all the concurrent file opens on those
   two files?  (Especially since getting info on the domain users
   and groups involves network queries?)

b) When these parameters are turned off, that Samba/winbindd somehow
   modify the C library such that Samba _and_all_other_programs_ on
   the Unix system get blank data when the getpwent() function is called?

Also, what happens with winbindd and Samba when either of these is
turned off?  Does anything break? Or act differently?

BTW, I don't know if anyone else has reported this, but I noticed
some typos in the manpages:

1. In the winbindd(8) manpage, the default for winbind enum groups
   is listed as no.  I assume this is an error.

2. The two parameters are both listed as winbind enum in their
   descriptions in the smb.conf(5) manpage.

3. Just above that in the winbind cache time description, under
   Default:, it is listed as winbind cache type, rather than time.

Jay Ts
[EMAIL PROTECTED]