Possible bug (memory leak) in serving return code from tdb_fetch().

2002-11-22 Thread Arcady Chernyak
Hi.
I have analyzed code of the function: 

static struct printjob *print_job_find(int jobid)
{
static struct printjob pjob;
TDB_DATA ret;

ret = tdb_fetch(tdb, print_key(jobid));
if (!ret.dptr || ret.dsize != sizeof(pjob)) return NULL;

memcpy(pjob, ret.dptr, sizeof(pjob));
free(ret.dptr);
return pjob;
}

from the file printing\printing.c.

The function tdb_fetch() makes malloc() if ret.dptr != NULL.
If record was found, but we got a different size, we are going to return
NULL. 
In this case we shell get memory leak.
I suggest the following function code:

static struct printjob *print_job_find(int jobid)
{
static struct printjob pjob;
TDB_DATA ret;

ret = tdb_fetch(tdb, print_key(jobid));
if (ret.dptr == NULL) return NULL;
if (ret.dsize != sizeof(pjob)){
  free(ret.dptr);
  return NULL;
}
memcpy(pjob, ret.dptr, sizeof(pjob));
free(ret.dptr);
return pjob;
}

The same thing also happens in the files:
Lib/messages.c  function:   static BOOL message_recv
Nsswith/winbindd_cache.cfunction:   static uint32
cached_sequence_number


Regards
Arcady



Possible bug for 'directory mask' param

2002-09-05 Thread Gavin D. Nipper


Hello,

When a directory is created with Windows (2000 sp3) and with smbclient, 
the permissions differ on the newly created directory.

Example:

smb.conf contains:
directory mask = 0711


When smbclient creates the directory the permissions are as follows:
drwx--x--x

...but when I use Windows (2000 sp3) the permissions are:
drwxrw-rw-


Samba version is 2.2.5

--
Gavin D. Nipper
University of Oklahoma
Department of Mathematics





Possible bug?

2002-08-26 Thread Craig Packard

Hello all,

  I'm using the smbclient program to connect to a
share on a local/member win2k pro system of a win2k
domain.  I've done the following:

Create user:test pass:testtest
login: works

Create user:123456 Pass:123456
login: fails

I've tried this on three different systems so far and
it appears that a username that is all numeric will
not be able to login?  Can anyone else confirm this?


I've tripple checked all domain policies and see
nothing there.  The event log just shows the failed
login attempt with a event id 529 and login type 3. 
I've double checked that access this computer from the
network is set correctly.

I can't think of anything else.  Like I said the same
steps with a alpha username work.  Also if I use the
NET USE command from a Win2k box it works even with
the numeric username.


  - Craig


__
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com



Re: FW: [Samba] Possible bug!!

2002-08-15 Thread Andrew Bartlett

Kristyan Osborne wrote:
 
 -Original Message-
 From: Gerald (Jerry) Carter [mailto:[EMAIL PROTECTED]]
 Sent: 14 August 2002 16:14
 To: Kristyan Osborne
 Cc: [EMAIL PROTECTED]
 Subject: Re: [Samba] Possible bug!!
 
 On Mon, 12 Aug 2002, Kristyan Osborne wrote:
 
  I'm using samba head cvs from 01/08/02 with ldap support. I have set
  some global groups up, however when i run the command (from win2k
  client) net group it /DOMAIN i get system error 5 access is denied.
 
  When i look at the logs on the samba server i get
 
  [2002/08/12 11:43:30, 2] passdb/pdb_ldap.c:ldapsam_connect_system(398)
ldap_connect_system: successful connection to LDAP server
  [2002/08/12 11:43:30, 2] passdb/pdb_ldap.c:ldapsam_search_one_user(410)
 ldapsam_search_one_user: searching for:[((uid=it)(objectclass=sambaAccount))]
  [2002/08/12 11:43:30, 4] passdb/pdb_ldap.c:ldapsam_getsampwnam(1276)
 We don't find this user [it] count=0
 
 
  It seems samba is using uid=group instead of gid=group, is there
  something I have missed or is this a bug???
 
 You should forward this off to andrew bartlett since he rewrote all that
 stuff in HEAD.  Contact him on the samba-technical list.

I saw this when it first went past [EMAIL PROTECTED], but I can't see
what's wrong.  In particular, I'll need quite a few more details...

But there are code paths which will look up 'users as groups', in an
attempt to detect clashes.  Users and groups share the same NT
namespace.  I don't think this bit is your bug.

Andrew Bartlett

-- 
Andrew Bartlett [EMAIL PROTECTED]
Manager, Authentication Subsystems, Samba Team  [EMAIL PROTECTED]
Student Network Administrator, Hawker College   [EMAIL PROTECTED]
http://samba.org http://build.samba.org http://hawkerc.net



RE: Possible bug: File changed as we read it

2002-07-31 Thread Green, Paul

Bert Buckley [mailto:[EMAIL PROTECTED]] writes (edited for brevity):
 Synopsis:
 
 I do daily dumps from a Linux box of the Windows machines on 
 my network. (Kernel 2.4.7-10, Redhat 7.2., samba-2.2.1a-4 )
 These are done overnight.
 
 I mount the appropriate shared directories as a samba 
 filesystem and use tar to incrementally dump all recently
 changed files (using their time stamp). [snip]
 
 I now get a number of errors of the form:
 tar: ./Toxocara/Restore/Toxocara.mdb: file changed as 
 we read it
 
 The files that generate these errors are completely static.  
 There are 4 to 6 of them.  It seems always to be the same files.
 Their timestamps look perfectly normal.  There is nothing that I
 can find that is altering these files.  Their timestamps have
 not changed.

I have seen tar do this when the number of bytes returned by reading the
file does not agree with the size return by stat().  You can verify this by
writing a small test program that stats the file and then reads until EOF
counting up the bytes read.  If this small test case fails, then tar is
absolved.  

Are these local files or remotely-mounted (NFS) files?  Are they sparse
files?   Yeah, these things should not matter, but...  Oh, and are the
copies created by tar the same as the originals or not?  You didn't say.

(And then the completely generic answer...) Your version of Samba is rather
old. You might try the current version (2.2.5).

Hope this sheds a small amount of light.
PG




Re: possible bug?

2002-04-24 Thread Gerald Carter

On Tue, 23 Apr 2002, Donald Wade Jr. wrote:

 Samba 2.2.1a on mandrake 8.1  configuration with swat 
 Shares that are initially created through swat do not in the 
 file system.
 
 You have to go in and create them manually for example 
 with Konqueror.  Shouldn't the shares appear within the file 
 when they are created within swat?
 
 Any accuracy to this other than my own trials?

No. Swat only creates the configuration file.  You have to create
any necessary directories speficied in the config file.





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--





possible bug?

2002-04-23 Thread Donald Wade Jr.



Samba 2.2.1a on mandrake 8.1 configuration 
with swat 

Shares that are initially createdthrough swat 
do not in the 

file system.

You have to go in and create themmanually for 
example 

with Konqueror. Shouldn't the shares appear 
within the file 

when they are created within swat?

Any accuracy to this other than my own 
trials?