Possible memory leak password.c/pass_check_smb().

2002-04-08 Thread Adrian Chung

[sent to samba-general, should have probably send it here]

Hi!  I'm running Samba 2.2.3a with a whole bunch of Windows XP
clients, and have been noticing that Samba has been consuming all
available memory resources if left unchecked for about a week.

After some digging, and correlating the following messages in my logs:

[2002/04/07 19:42:17, 1] smbd/password.c:pass_check_smb(555)
  Couldn't find user 'nobody' in passdb.

I decided to put 'nobody' in my smbpasswd file.

After doing that, the leak seems to have gone away.

On further inspection, looking at source/smbd/password.c close to line
555:

[...]
BOOL pass_check_smb...
[..]
/* get the account information */
pdb_init_sam(sampass);
if (!pdb_getsampwnam(sampass, user)) {
DEBUG(1,(Couldn't find user '%s' in passdb.\n, user));
return(False);
}
[...]

It looks like pdb_init_sam() is called which actually malloc's memory,
but never free's it, and returns.

Not having looked at Samba code much, it is possible that this is
free'd elsewhere, but it seems suspicious given my symptoms, and the
fact that the rest of the code looks like:

/* Quit if the account was disabled. */
if(pdb_get_acct_ctrl(sampass)  ACB_DISABLED) {
DEBUG(1,(Account for user '%s' was disabled.\n,
user));
pdb_free_sam(sampass);
return(False);
}


if (pdb_get_acct_ctrl(sampass)  ACB_PWNOTREQ) {
if (lp_null_passwords()) {
DEBUG(3,(Account for user '%s' has no
password and null passwords are allowed.\n, user));
pdb_free_sam(sampass);
return(True);
} else {
DEBUG(3,(Account for user '%s' has no
password and null passwords are NOT allowed.\n, user));
pdb_free_sam(sampass);
return(False);
}
}

if (smb_password_ok(sampass, chal, lm_pwd, nt_pwd)) {
pdb_free_sam(sampass);
return(True);
}

DEBUG(2,(pass_check_smb failed - invalid password for user
[%s]\n, user));

pdb_free_sam(sampass);
return False;

--
Adrian Chung (adrian at enfusion-group dot com)
http://www.enfusion-group.com/~adrian
GPG Fingerprint: C620 C8EA 86BA 79CC 384C E7BE A10C 353B 919D 1A17
[toad.enfusion-group.com] up 15 days, 7:45, 8 users





[[¹ÌÄ£¿µ¾î] ¸®¾çÀÇ »ùÇà ¹× ¾îÇÐÇнÀ±â¸¦ µå¸³´Ï´Ù. [±¤°í]

2002-04-08 Thread ¸®¾ç







  













































































































CRAZY
ENGLISH »ùÇÃ


¼º

¸í





À̸ÞÀÏ





ÁÖ
¼Ò





Á÷
¾÷


Á÷¾÷ ÀÔ·Â
Á÷ÀåÀÎ
ÀÚ¿µ¾÷
´ëÇлý
°íµîÇлý
ÁßÇлý
ÃʵîÇлý
ÁÖºÎ
±âŸ




ÀüÈ­¹øÈ£


Áö ¿ª  ¹ø È£
 ¼­¿ï
ºÎ»ê
´ë±¸
ÀÎõ
±¤ÁÖ
´ëÀü
¿ï»ê
°æ±â
°­¿ø
ÃæºÏ
Ãæ³²
°æºÏ
°æ³²
ÀüºÏ
Àü³²
Á¦ÁÖ

-

-




À̵¿Åë½Å


ÀÌ µ¿   Åë ½Å
011
016
017
018
019

- 
- 



ÇнÀ°æÇè


ÇнÀ°æÇè ÀÔ·Â
µ¶ÇÐ
Çпø
Åë½Å±³Àç
ÀÎÅÍ³Ý °­ÀÇ




½Åûµ¿±â


½Åûµ¿±â ÀÔ·Â
ÀÚ±â°è¹ß
Àڳ౳À°
Ãë¾÷´ëºñ
À̹ξîÇÐÀ¯ÇÐ
TOEICTOFLE ´ëºñ
±âŸ





¹®
ÀÇ
ȍ
Ç×
  
  

























Copyright  2001 Cypus co.,
Ltd. All Rights Reserved.





  





º»
¸ÞÀÏÀº Á¤º¸Åë½ÅºÎ ±Ç°í »çÇ׿¡ ÀÇ°Å Á¦¸ñ¿¡ [±¤°í]¶ó Ç¥½ÃµÈ ±¤°í ¸ÞÀÏÀÔ´Ï´Ù.¼ö½Å°ÅºÎ

󸮰¡ ÀÌ·ç¾î Áý´Ï´Ù. °¨»çÇÕ´Ï´Ù.





Re: VFS recycle bin

2002-04-08 Thread Juergen Hasch

Am Montag, 8. April 2002 13:24 schrieb Andrew Bartlett:
  Add -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 to the compiler options
  and it works :-)

 The problem is that the VFS (and passdb for that matter) modules are
 libtool based :-).

 They are not created via the normal makefile system, and don't get the
 same complier options.  In the same way, passdb moudles can't be built
 on RedHat systems without some modification, becouse the kerberos
 headers are not in the right place.

 Yet again we see that libtool is an all or nothing thing ;-)

Couldn't configure.in be changed to supply the defines to config.h instead of 
adding it to CFLAGS in the makefile ?

Most source files (all ?) include config.h via includes.h anyway, so this 
could work.

...Juergen





password server = * is broken

2002-04-08 Thread Andrew Esh

I was testing the smb.conf parameter password server, and had no problems in
a domain with a PDC and two BDC's, but I listed the servers by name in the 
parameter. When I switched to using *, the client could no longer authenticate.

The problem appears to be the representation of the user name. In a successful
case, the code does this:


[2002/04/08 15:26:29, 3, pid=9645, effective(0, 0), real(0, 0)] 
smbd/reply.c:reply_sesssetup_and_X(847)
  Domain=[CENTRAL]  NativeOS=[Windows NT 1381] NativeLanMan=[]
[2002/04/08 15:26:29, 3, pid=9645, effective(0, 0), real(0, 0)] 
smbd/reply.c:reply_sesssetup_and_X(858)
  sesssetupX:name=[AndrewE]
[2002/04/08 15:26:29, 6, pid=9645, effective(0, 0), real(0, 0)] 
param/loadparm.c:lp_file_list_changed(2247)
  lp_file_list_changed()
  file /usr/local/tsms/etc/replication.readonly - 
/usr/local/tsms/etc/replication.readonly  last mod_time: Wed Dec 31 18:00:00 1969
  
  file /usr/local/tsms/etc/netbios.aliases - /usr/local/tsms/etc/netbios.aliases  
last mod_time: Wed Dec 31 18:00:00 1969
  
  file /usr/local/tsms/etc/unix_masks_and_modes - 
/usr/local/tsms/etc/unix_masks_and_modes  last mod_time: Mon Feb 18 17:27:30 2002
  
  file /usr/local/tsms/etc/application.appliance.smb.conf - 
/usr/local/tsms/etc/application.appliance.smb.conf  last mod_time: Wed Dec 31 18:00:00 
1969
  
  file /usr/local/samba/lib/smb.conf - /usr/local/samba/lib/smb.conf  last mod_time: 
Mon Apr  8 15:26:23 2002
  
[2002/04/08 15:26:30, 3, pid=9645, effective(0, 0), real(0, 0)] 
smbd/reply.c:reply_sesssetup_and_X(919)
  Using unix username CENTRAL+AndrewE

... and everything is fine from there on.



In the failing case, the code starts the same:


[2002/04/08 15:13:17, 3, pid=9521, effective(0, 0), real(0, 0)] 
smbd/reply.c:reply_sesssetup_and_X(847)
  Domain=[CENTRAL]  NativeOS=[Windows NT 1381] NativeLanMan=[]
[2002/04/08 15:13:17, 3, pid=9521, effective(0, 0), real(0, 0)] 
smbd/reply.c:reply_sesssetup_and_X(858)
  sesssetupX:name=[AndrewE]


 ... fails to get into line 919, and skips down to line 1018, which fails because of a 
bad user name:


[2002/04/08 15:13:18, 3, pid=9521, effective(0, 0), real(0, 0)] 
smbd/reply.c:reply_sesssetup_and_X(1018)
  No such user andrewe [CENTRAL] - using guest account
[2002/04/08 15:13:18, 10, pid=9521, effective(0, 0), real(0, 0)] 
smbd/password.c:register_vuid(288)
  register_vuid: (99,99) nobody AndrewE CENTRAL guest=1


What happened to CENTRAL+AndrewE? Why does this code near line 919 fail? :


if (sys_getpwnam(dom_user) != NULL) {
  pstrcpy(user, dom_user);
  DEBUG(3,(Using unix username %s\n, dom_user));
}


If this a code ordering problem? Is it trying to look up the user before it has a 
domain controller located?

I'll keep digging, but if this one looks familiar, save me the time, please.

-- 
Andrew C. Esh  mail:[EMAIL PROTECTED]
Tricord Systems, Inc.
2905 Northwest Blvd., Suite 20   763-557-9005 (main)
Plymouth, MN 55441-2644 USA  763-551-6418 (direct)
http://www.tricord.com - Tricord Home Page




libsmbclient -I equivalent?

2002-04-08 Thread Mike Rosack

I'm trying to upgrade an smbclient-based share crawler I've written to
libsmbclient and Alain's perl Filesys::SmbClient package.  This is for the
Georgia Tech campus network, so the crawler will span multiple subnets.

The problem I'm having is that about half of the clients I query won't
recognize an IP based smb URL like this: smb://128.61.xxx.xxx/share/.  The
campus WINS server is flaky, plus there are many duplicate hostnames over
the various subnets, so using it isn't really the answer in this scenario.

What I need is some way to write the URL with the hostname like this:
smb://hostname/share, and pass in the IP address to try to connect to.  Sort
of like doing this in smbclient:

smbclient //hostname/share -I 128.61.xxx.xxx

Is there some way to do this that I'm missing?


Thanks in advance,

Mike Rosack
www.sacknet.org
www.buzzsearch.org
[EMAIL PROTECTED]





Re: libsmbclient -I equivalent?

2002-04-08 Thread Richard Sharpe

On Mon, 8 Apr 2002, Mike Rosack wrote:

 I'm trying to upgrade an smbclient-based share crawler I've written to
 libsmbclient and Alain's perl Filesys::SmbClient package.  This is for the
 Georgia Tech campus network, so the crawler will span multiple subnets.
 
 The problem I'm having is that about half of the clients I query won't
 recognize an IP based smb URL like this: smb://128.61.xxx.xxx/share/.  The
 campus WINS server is flaky, plus there are many duplicate hostnames over
 the various subnets, so using it isn't really the answer in this scenario.
 
 What I need is some way to write the URL with the hostname like this:
 smb://hostname/share, and pass in the IP address to try to connect to.  Sort
 of like doing this in smbclient:
 
 smbclient //hostname/share -I 128.61.xxx.xxx

Hmmm, 128.61. ... I see what you mean ...

 Is there some way to do this that I'm missing?

This could be supplied in a couple of ways:

1. Provide a call/routine to libsmbclient that provides the target and 
source NetBIOS names to be used for all subsequent requests.

2. Extend the URL syntax to allow both the IP address and the NetBIOS name 
to be supplied.

3. Add code to have the library go out and retrieve the NetBIOS name from 
the target before trying to connect. I thought such code was already in 
the source, but maybe not.  This involves doing an adapter query or some 
such. [A quick perusal of libsmbclient reveals that opendir includes a 
call to name_status_find, but the main code for connecting to a server 
does not.

Of the three, one and three are easiest, and the code is left as an 
exercise for the reader :-)

Regards
-
Richard Sharpe, [EMAIL PROTECTED], [EMAIL PROTECTED], 
[EMAIL PROTECTED]