Re: [Samba] errors when copying large directories to/from samba/windows

2007-12-15 Thread Andreas Baitis

Jeremy Allison wrote:

On Sat, Dec 15, 2007 at 01:12:03PM +1100, Andreas Baitis wrote:
  

Hi

I'm having trouble with Samba, when I copy large complex directories to my 
Samba server, the target doesn't match the source, some files seem to be 
missing.


*Stats on source(windows client) are:*

Size: 4.99 GB (5,367,477,260 bytes)

Size on disk: 5.00 GB (5,376,487,424 bytes)

Contains: 4,481 files, 281 folders


*Stats on target(Samba server) are:*

Size: 4.92 GB (5,286,067,654 bytes)

Size on disk: 4.92 GB (5,287,628,800 bytes)

Contains: 3,733 files, 281 folders



I'm thinking it might have something to do with Windows/Linux filename or 
path length incompatibility.


What Samba settings should I set to ensure this doesn't happen, and are 
there any limitations one has to adhere to with regard Windows path length 
or filename format in order to ensure directories and files are copied 
properly?


The problem happens from both XP and Vista clients, the Samba server is 
standard Debian etch. Samba 3.0.24



We'll need much more info than this I'm afraid. What
directories/files are missing ? Is it repeatable ? Have
you tried with the latest 3.0.28 release ?

Pathname limits in Samba 3.0.x are 1024 bytes for the
full pathname, 256 bytes for each component.

These limits have been removed for 3.2 and it's down
to PATH_MAX on the underlying system.

Jeremy.
  

Hi Jeremy,

After doing an apt-get update/upgrade samba was updated by apt. The 
version remained the same.


The problem is now fixed.

So I'll explain further as a matter of interest, I'd like to know if it 
was in fact the update that fixed it.



Before the update, I had a look at the files in the command line on the 
server and they were all there, so it was a read/view problem rather 
than a write problem. The files were all in the same directory, and none 
of the paths or file names exceeded the limits you mention. I could not 
see any obvious/consistent differences between the files that were 
visible to the client and the files that were not??


these are some of the files that were visible:

\\server\dean\Quotes\2001 ES trading 2.doc
\\server\dean\Quotes\2006 DSE Knox.doc

these are some of the files that were not visible:

\\server\dean\Quotes\2001 ES trading.doc
\\server\dean\Quotes\2001A ES trading.doc
\\server\dean\Quotes\2003 Hi Fi Supermarket.doc

The problem was repeatable and it was always the same files that were 
invisible to the client (or Samba??).


So the problem seems to be fixed now, but I'm still a little weary, as 
this server is going to be used in a production environment.


I guess I need to find out what updates Debian did to the Etch release 
of Samba recently, see if any of them fit the bill?



Thanks Jeremy

Andreas B.

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] ExcludeProfileDirs and broken roaming profiles

2007-12-15 Thread Marcus Sobchak [EMAIL PROTECTED]
Hi,

since rolling out roaming profiles, some user profiles are growing very
fast. I like to keep the profiles small and think about changing
ExcludeProfileDirs default settings in Software\Microsoft\Windows NT
\CurrentVersion\Winlogon by System Policies to remove caches, cookies,
recent and other useless stuff. 

Which paths could be excluded without killing the benefits of roaming
profiles? Could your send me your settings and/or a working .adm? 

A second problem which comes up one or two times a day - and doesn't
depend on the size of the profiles - are broken profiles at the _first_
login. In most cases Thunderbird and Firefox paths couldn't be loaded
and the user is droped to the Default User profile. At a second login
everything works fine and the profile could be loaded without problems.

Thanks,
Marcus

system information:
samba3.0.24-6etch9
samba-common 3.0.24-6etch9

[profile$]
comment = Network Profiles Service
path = /vol/profiles
read only = no
create mask=0600
directory mask=0770
hide files = /desktop.ini/Desktop.ini/ntuser.ini/NTUSER.*/

Debian etch: 
Linux 2.6.18-5-686 #1 SMP Wed Oct 3 00:12:50 UTC 2007 i686 GNU/Linux

client side:
100% WinXP SP2, F-Secure 7.10


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] unauthorized acess attempt

2007-12-15 Thread samba

Gianluca Culot wrote:

Hello list
 
I'm facing a little security problem
 
I get A LOT (3 a minute) a such a message
 
 mail dovecot-auth: pam_winbind(dovecot): request failed: No such user, PAM

error was unknown user (13), NT error was NT_STATUS_NO_SUCH_USER

I'd like to know which is the user name used in such attempts
How can I get such info without raising log level to an inacceptable level
(which would cause my log file to explode !?! )


Have you looked at your dovecot logs to see who's trying to login at 
that time?


Don Piven
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Is 'force user/group' misbehaving?

2007-12-15 Thread António Oliveira
Hello list,

I'm running ubuntu server 7.10 amd64 and trying to set up a samba server for
a LAN.
Samba version is 3.0.26a IIRC (I can't access the machine ATM)

I'm stumped with a problem and I believe it's related, somehow, with the
'force user' parameter, so I created this testcase to seek for help...

In the example smb.conf I'm trying to create one share accessible to
everyone with a valid account in the server (people inside an office)

---8--
[global]
# This is mostly what came default in the ubuntu smb.conf file
   workgroup   = blarg
   netbios name = houston-we
   server string = got-a-problem
   dns proxy = no
# machine has also eth1 and eth2, both down ATM
   interfaces = 127.0.0.0/8 eth0
   bind interfaces only = true
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
   debug level = 2
   security = user
   null passwords = yes
   encrypt passwords = true
   passdb backend = tdbsam
   invalid users = root
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\sUNIX\spassword:* %n\n
*Retype\snew\sUNIX\spassword:* %n\n
*passwd:*password\supdated\ssuccessfully* .
   socket options = TCP_NODELAY

[public]
   path = /example
   browseable = yes
   writable = yes
   create mask = 777
   directory mask = 777
   force user = to
   force group = to

8-

/example is owned by root and has 777 permissions.

NB: This is just for testing with a farily simple smb.conf file and to set
any file access permission problems aside.

I have users 'to' and 'ti' created in both the system and the samba db and
also (-e)nabled in samba...

With the exact smb.conf shown, when I try to enter public, I'm asked a
user/pass. Wether I to/pass or ti/pass, i can't even see the contents of
public and the client complains that the resource/directory does not exist.

If I comment out the force user and group declarations, both to/pass and
ti/pass have access to the share with read and write permissions.

Should'n this work even with those force user / group declarations in
place?? I'm clueless right now :(

This is what shows up in log.(machine) when the share fails:
--8
[2007/12/14 15:55:55, 2] auth/auth.c:check_ntlm_password(309)
  check_ntlm_password:  authentication for user [to] - [to] - [to]
succeeded
[2007/12/14 15:55:55, 0] auth/auth_util.c:create_builtin_administrators(792)
  create_builtin_administrators: Failed to create Administrators
[2007/12/14 15:55:55, 2] auth/auth_util.c:create_local_nt_token(914)
  create_local_nt_token: Failed to create BUILTIN\Administrators group!
[2007/12/14 15:55:55, 0] auth/auth_util.c:create_builtin_users(758)
  create_builtin_users: Failed to create Users
[2007/12/14 15:55:55, 2] auth/auth_util.c:create_local_nt_token(941)
  create_local_nt_token: Failed to create BUILTIN\Users group!
[2007/12/14 15:55:55, 1] auth/auth_util.c:create_token_from_username(1110)
  sid_to_uid for to (S-1-5-21-133238273-2997305703-2950841162-3000) failed
8---

And, well, in case it's usefull, here's what shows up when accessing the
share works (no declaration of force user / group) :
---8--
[2007/12/14 16:30:12, 2] auth/auth.c:check_ntlm_password(309)
  check_ntlm_password:  authentication for user [to] - [to] - [to]
succeeded
[2007/12/14 16:30:12, 0] auth/auth_util.c:create_builtin_administrators(792)
  create_builtin_administrators: Failed to create Administrators
[2007/12/14 16:30:12, 2] auth/auth_util.c:create_local_nt_token(914)
  create_local_nt_token: Failed to create BUILTIN\Administrators group!
[2007/12/14 16:30:12, 0] auth/auth_util.c:create_builtin_users(758)
  create_builtin_users: Failed to create Users
[2007/12/14 16:30:12, 2] auth/auth_util.c:create_local_nt_token(941)
  create_local_nt_token: Failed to create BUILTIN\Users group!
[2007/12/14 16:30:12, 1] smbd/service.c:make_connection_snum(1033)
  withus-mobile1 (192.168.250.4) connect to service public initially as user
to (uid=1000, gid=1000) (pid 8601)
--8--

Any help would be very apreciated
Cheers,
--to
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-657-g1f352cd

2007-12-15 Thread Jeremy Allison
The branch, v3-2-test has been updated
   via  1f352cdd1976ad36484e146165df585b88ec5527 (commit)
  from  bc13e939546a5bcb78925a6b117e89fde20f6451 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit 1f352cdd1976ad36484e146165df585b88ec5527
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 11:38:28 2007 +0100

Fix a segfault

sid_to_string still expects a fstring

---

Summary of changes:
 source/groupdb/mapping_tdb.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/groupdb/mapping_tdb.c b/source/groupdb/mapping_tdb.c
index 2e4ed46..fa6e93c 100644
--- a/source/groupdb/mapping_tdb.c
+++ b/source/groupdb/mapping_tdb.c
@@ -394,8 +394,8 @@ static NTSTATUS one_alias_membership(const DOM_SID *member,
const char *p;
TALLOC_CTX *frame;
 
-   sid_to_string(string_sid, member);
-   slprintf(key, sizeof(key), %s%s, MEMBEROF_PREFIX, string_sid);
+   slprintf(key, sizeof(key), %s%s, MEMBEROF_PREFIX,
+sid_string_static(member));
 
dbuf = tdb_fetch_bystring(tdb, key);
 


-- 
Samba Shared Repository


svn commit: samba r26459 - in branches/SAMBA_4_0: . source/lib/ldb/ldb_ildap source/libcli

2007-12-15 Thread jelmer
Author: jelmer
Date: 2007-12-15 20:53:45 + (Sat, 15 Dec 2007)
New Revision: 26459

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26459

Log:
Build ildap module as shared module by default.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/config.mk
   branches/SAMBA_4_0/source/libcli/config.mk


Changeset:

Property changes on: branches/SAMBA_4_0
___
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/config.mk
===
--- branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/config.mk   2007-12-14 
17:32:48 UTC (rev 26458)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/config.mk   2007-12-15 
20:53:45 UTC (rev 26459)
@@ -3,7 +3,7 @@
 [MODULE::ldb_ildap]
 SUBSYSTEM = LIBLDB
 CFLAGS = -Ilib/ldb/include
-#OUTPUT_TYPE = SHARED_LIBRARY
+OUTPUT_TYPE = SHARED_LIBRARY
 PRIVATE_DEPENDENCIES = LIBTALLOC LIBCLI_LDAP
 INIT_FUNCTION = ldb_ildap_init
 ALIASES = ldapi ldaps ldap

Modified: branches/SAMBA_4_0/source/libcli/config.mk
===
--- branches/SAMBA_4_0/source/libcli/config.mk  2007-12-14 17:32:48 UTC (rev 
26458)
+++ branches/SAMBA_4_0/source/libcli/config.mk  2007-12-15 20:53:45 UTC (rev 
26459)
@@ -134,7 +134,7 @@
 
 [SUBSYSTEM::LIBCLI_RAW]
 PRIVATE_PROTO_HEADER = raw/raw_proto.h
-PRIVATE_DEPENDENCIES = LIBCLI_COMPOSITE 
+PRIVATE_DEPENDENCIES = LIBCLI_COMPOSITE LP_RESOLVE
 PUBLIC_DEPENDENCIES = samba-socket LIBPACKET gensec LIBCRYPTO
 LDFLAGS = $(SUBSYSTEM_LIBCLI_SMB_COMPOSITE_OUTPUT)
 OBJ_FILES = raw/rawfile.o \



[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-669-geb523ba

2007-12-15 Thread Volker Lendecke
The branch, v3-2-test has been updated
   via  eb523ba77697346a365589101aac379febecd546 (commit)
   via  3a0b1b2060facd5f1ac1461b23dd86c75cdd9458 (commit)
   via  7b8276aaa48852270c6b70b081c3f28e316a7a2c (commit)
   via  c7c885078be8fd3024c186044ac28275d7609679 (commit)
   via  c221c246b10e2dbbd54a9af2dc45de2eae237380 (commit)
   via  60e830b0f4571bd5d9039f2edd199534f2a4c341 (commit)
   via  0a911d38b8f4be382a9df60f9c6de0c500464b3a (commit)
   via  bb35e794ec129805e874ceba882bcc1e84791a09 (commit)
   via  3e4148c280efe154c3f8d552731c8b29d6977507 (commit)
   via  6312016e2727c2b5b1a4964a98cfb9585d77cc8c (commit)
   via  f00ab810d2540679bec109498ac89e1eafe18f03 (commit)
   via  9e3ef0923d71cc06b8445be2625ebd8dfed1b42d (commit)
  from  1f352cdd1976ad36484e146165df585b88ec5527 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit eb523ba77697346a365589101aac379febecd546
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 22:47:30 2007 +0100

s/sid_to_string/sid_to_fstring/

least surprise for callers

commit 3a0b1b2060facd5f1ac1461b23dd86c75cdd9458
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 22:33:52 2007 +0100

Use dom_sid_string for sid_string_talloc

Remove some code duplication, but introduce one more dependency on 
librpc/ndr.
Easily turned around so that librpc/ndr depends on lib/util_sid if necessary

commit 7b8276aaa48852270c6b70b081c3f28e316a7a2c
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 22:08:09 2007 +0100

sid_string_static is no more :-)

We now have four ways to do sid_to_string:

sid_to_string: Convert it into an existing fstring, when you have one

sid_string_talloc: The obvious thing

sid_string_tos: For the lazy, use only with care

sid_string_dbg: The one to use in DEBUG statements

commit c7c885078be8fd3024c186044ac28275d7609679
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 22:00:39 2007 +0100

Replace sid_string_static with sid_to_string

This adds 28 fstrings on the stack, but I think an fstring on the stack is
still far better than a static one.

commit c221c246b10e2dbbd54a9af2dc45de2eae237380
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 21:58:28 2007 +0100

Use sid_to_string directly

It seems a bit pointless to do a fstrcpy(dst, sid_string_static(src))

commit 60e830b0f4571bd5d9039f2edd199534f2a4c341
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 21:53:26 2007 +0100

Replace sid_string_static with sid_string_tos

In utils/ I was a bit lazy...

commit 0a911d38b8f4be382a9df60f9c6de0c500464b3a
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 21:49:15 2007 +0100

Use sid_string_talloc where we have a tmp talloc ctx

commit bb35e794ec129805e874ceba882bcc1e84791a09
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 21:11:36 2007 +0100

Replace sid_string_static by sid_string_dbg in DEBUGs

commit 3e4148c280efe154c3f8d552731c8b29d6977507
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 21:06:20 2007 +0100

Add sid_string_dbg

This makes use of the just added debug_ctx and will kill many
sid_string_static() calls

commit 6312016e2727c2b5b1a4964a98cfb9585d77cc8c
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 21:05:11 2007 +0100

Add debug_ctx according to an idea by Tridge

Sorry, Jeremy, I think for debug messages this is just the right way to do 
it.

commit f00ab810d2540679bec109498ac89e1eafe18f03
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 21:10:58 2007 +0100

Use sid_string_talloc where we have a tmp talloc ctx

commit 9e3ef0923d71cc06b8445be2625ebd8dfed1b42d
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Dec 15 19:00:42 2007 +0100

add sid_string_talloc

---

Summary of changes:
 source/auth/auth_util.c|   12 ++--
 source/auth/token_util.c   |7 +-
 source/groupdb/mapping.c   |2 +-
 source/groupdb/mapping_ldb.c   |   12 ++--
 source/groupdb/mapping_tdb.c   |   22 ---
 source/lib/afs.c   |2 +-
 source/lib/debug.c |   14 +
 source/lib/display_sec.c   |6 +-
 source/lib/privileges.c|   20 +++---
 source/lib/secdesc.c   |   25 +++-
 source/lib/smbldap_util.c  |2 +-
 source/lib/substitute.c|3 +-
 source/lib/util_seaccess.c |   25 +
 source/lib/util_sid.c  |   59 --
 source/libads/authdata.c   |   13 +++--
 source/libads/disp_sec.c   |6 +-
 source/libads/ldap.c   |7 +-
 source/libgpo/gpo_sec.c|4 +-
 source/librpc/ndr/sid.c   

svn commit: samba r26460 - in branches/SAMBA_4_0: . source source/auth/kerberos source/lib/samba3

2007-12-15 Thread jelmer
Author: jelmer
Date: 2007-12-15 22:23:30 + (Sat, 15 Dec 2007)
New Revision: 26460

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26460

Log:
Enable ldb python tests.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/auth/kerberos/config.mk
   branches/SAMBA_4_0/source/lib/samba3/config.mk
   branches/SAMBA_4_0/source/samba4-skip


Changeset:

Property changes on: branches/SAMBA_4_0
___
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/auth/kerberos/config.mk
===
--- branches/SAMBA_4_0/source/auth/kerberos/config.mk   2007-12-15 20:53:45 UTC 
(rev 26459)
+++ branches/SAMBA_4_0/source/auth/kerberos/config.mk   2007-12-15 22:23:30 UTC 
(rev 26460)
@@ -10,6 +10,6 @@
gssapi_parse.o \
krb5_init_context.o
 PUBLIC_DEPENDENCIES = HEIMDAL_KRB5 NDR_KRB5PAC samba-socket LIBCLI_RESOLVE
-PRIVATE_DEPENDENCIES = ASN1_UTIL auth_sam_reply CREDENTIALS_KRB5
+PRIVATE_DEPENDENCIES = ASN1_UTIL auth_sam_reply CREDENTIALS_KRB5 LIBPACKET 
LIBNDR
 # End SUBSYSTEM KERBEROS
 #

Modified: branches/SAMBA_4_0/source/lib/samba3/config.mk
===
--- branches/SAMBA_4_0/source/lib/samba3/config.mk  2007-12-15 20:53:45 UTC 
(rev 26459)
+++ branches/SAMBA_4_0/source/lib/samba3/config.mk  2007-12-15 22:23:30 UTC 
(rev 26460)
@@ -10,7 +10,7 @@
idmap.o winsdb.o samba3.o group.o \
registry.o secrets.o share_info.o
 PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBTDB NDR_SECURITY \
-  CREDENTIALS SMBPASSWD
+  CREDENTIALS SMBPASSWD LIBSECURITY
 # End SUBSYSTEM LIBSAMBA3
 
 
@@ -19,5 +19,6 @@
 [SUBSYSTEM::SMBPASSWD]
 PRIVATE_PROTO_HEADER = samba3_smbpasswd_proto.h
 OBJ_FILES = smbpasswd.o
+PRIVATE_DEPENDENCIES = CHARSET LIBSAMBA-UTIL
 # End SUBSYSTEM LIBSAMBA3
 

Modified: branches/SAMBA_4_0/source/samba4-skip
===
--- branches/SAMBA_4_0/source/samba4-skip   2007-12-15 20:53:45 UTC (rev 
26459)
+++ branches/SAMBA_4_0/source/samba4-skip   2007-12-15 22:23:30 UTC (rev 
26460)
@@ -49,7 +49,6 @@
 ^samba4.NET-API-BECOME-DC.*$   # Fails
 WINBIND# FIXME: This 
should not be skipped
 NSS-TEST   # Fails
-samba4.ldb.python  # Fails to link properly
 samba4.credentials.python  # Fails to link properly
 samba4.registry.python # Fails to link properly
 samba4.auth.python # Fails to link properly



svn commit: samba r26461 - in branches/SAMBA_4_0: . source/libcli/auth source/param

2007-12-15 Thread jelmer
Author: jelmer
Date: 2007-12-15 22:23:36 + (Sat, 15 Dec 2007)
New Revision: 26461

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26461

Log:
Tighten dependencies.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/libcli/auth/config.mk
   branches/SAMBA_4_0/source/param/config.mk


Changeset:

Property changes on: branches/SAMBA_4_0
___
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/libcli/auth/config.mk
===
--- branches/SAMBA_4_0/source/libcli/auth/config.mk 2007-12-15 22:23:30 UTC 
(rev 26460)
+++ branches/SAMBA_4_0/source/libcli/auth/config.mk 2007-12-15 22:23:36 UTC 
(rev 26461)
@@ -8,6 +8,7 @@
smbencrypt.o \
smbdes.o
 PUBLIC_DEPENDENCIES = \
-   SCHANNELDB MSRPC_PARSE
+   MSRPC_PARSE \
+   LIBSAMBA-CONFIG
 # End SUBSYSTEM LIBCLI_AUTH
 #

Modified: branches/SAMBA_4_0/source/param/config.mk
===
--- branches/SAMBA_4_0/source/param/config.mk   2007-12-15 22:23:30 UTC (rev 
26460)
+++ branches/SAMBA_4_0/source/param/config.mk   2007-12-15 22:23:36 UTC (rev 
26461)
@@ -47,7 +47,7 @@
 
 [SUBSYSTEM::SECRETS]
 OBJ_FILES = secrets.o
-PRIVATE_DEPENDENCIES = LIBLDB TDB_WRAP UTIL_TDB
+PRIVATE_DEPENDENCIES = LIBLDB TDB_WRAP UTIL_TDB NDR_SECURITY
 
 [PYTHON::param]
 SWIG_FILE = param.i



svn commit: samba r26462 - in branches/SAMBA_4_0: . source/heimdal_build source/lib/ldb-samba

2007-12-15 Thread jelmer
Author: jelmer
Date: 2007-12-15 22:23:38 + (Sat, 15 Dec 2007)
New Revision: 26462

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26462

Log:
Tighten dependencies.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/heimdal_build/config.mk
   branches/SAMBA_4_0/source/lib/ldb-samba/config.mk


Changeset:

Property changes on: branches/SAMBA_4_0
___
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/heimdal_build/config.mk
===
--- branches/SAMBA_4_0/source/heimdal_build/config.mk   2007-12-15 22:23:36 UTC 
(rev 26461)
+++ branches/SAMBA_4_0/source/heimdal_build/config.mk   2007-12-15 22:23:38 UTC 
(rev 26462)
@@ -429,7 +429,7 @@
 [SUBSYSTEM::HEIMDAL_GLUE]
 CFLAGS = -Iheimdal_build -Iheimdal/lib/krb5 -Iheimdal/lib/asn1 
-Iheimdal/lib/com_err 
 OBJ_FILES = glue.o
-PUBLIC_DEPENDENCIES = LIBNETIF
+PUBLIC_DEPENDENCIES = LIBNETIF LIBSAMBA-CONFIG
 # End SUBSYSTEM HEIMDAL_GLUE
 ###
 

Modified: branches/SAMBA_4_0/source/lib/ldb-samba/config.mk
===
--- branches/SAMBA_4_0/source/lib/ldb-samba/config.mk   2007-12-15 22:23:36 UTC 
(rev 26461)
+++ branches/SAMBA_4_0/source/lib/ldb-samba/config.mk   2007-12-15 22:23:38 UTC 
(rev 26462)
@@ -3,7 +3,7 @@
 [SUBSYSTEM::LDBSAMBA]
 PUBLIC_DEPENDENCIES = LIBLDB
 PRIVATE_PROTO_HEADER = ldif_handlers.h
-PRIVATE_DEPENDENCIES = LIBSECURITY SAMDB
+PRIVATE_DEPENDENCIES = LIBSECURITY SAMDB LIBNDR NDR_MISC
 OBJ_FILES = \
ldif_handlers.o
 # End SUBSYSTEM LDBSAMBA



svn commit: samba r26463 - in branches/SAMBA_4_0: . source/lib/samba3 source/libcli

2007-12-15 Thread jelmer
Author: jelmer
Date: 2007-12-15 22:23:42 + (Sat, 15 Dec 2007)
New Revision: 26463

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26463

Log:
Tighten dependencies.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/lib/samba3/config.mk
   branches/SAMBA_4_0/source/libcli/config.mk


Changeset:

Property changes on: branches/SAMBA_4_0
___
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/lib/samba3/config.mk
===
--- branches/SAMBA_4_0/source/lib/samba3/config.mk  2007-12-15 22:23:38 UTC 
(rev 26462)
+++ branches/SAMBA_4_0/source/lib/samba3/config.mk  2007-12-15 22:23:42 UTC 
(rev 26463)
@@ -10,7 +10,7 @@
idmap.o winsdb.o samba3.o group.o \
registry.o secrets.o share_info.o
 PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBTDB NDR_SECURITY \
-  CREDENTIALS SMBPASSWD LIBSECURITY
+  CREDENTIALS SMBPASSWD LIBSECURITY 
 # End SUBSYSTEM LIBSAMBA3
 
 

Modified: branches/SAMBA_4_0/source/libcli/config.mk
===
--- branches/SAMBA_4_0/source/libcli/config.mk  2007-12-15 22:23:38 UTC (rev 
26462)
+++ branches/SAMBA_4_0/source/libcli/config.mk  2007-12-15 22:23:42 UTC (rev 
26463)
@@ -17,6 +17,7 @@
 PRIVATE_PROTO_HEADER = util/clilsa.h
 OBJ_FILES = util/clilsa.o
 PUBLIC_DEPENDENCIES = RPC_NDR_LSA
+PRIVATE_DEPENDENCIES = LIBSECURITY
 
 [SUBSYSTEM::LIBCLI_COMPOSITE]
 PRIVATE_PROTO_HEADER = composite/proto.h
@@ -135,8 +136,8 @@
 [SUBSYSTEM::LIBCLI_RAW]
 PRIVATE_PROTO_HEADER = raw/raw_proto.h
 PRIVATE_DEPENDENCIES = LIBCLI_COMPOSITE LP_RESOLVE
+LDFLAGS = $(SUBSYSTEM_LIBCLI_SMB_COMPOSITE_OUTPUT)
 PUBLIC_DEPENDENCIES = samba-socket LIBPACKET gensec LIBCRYPTO
-LDFLAGS = $(SUBSYSTEM_LIBCLI_SMB_COMPOSITE_OUTPUT)
 OBJ_FILES = raw/rawfile.o \
raw/smb_signing.o \
raw/clisocket.o \



svn commit: samba r26464 - in branches/SAMBA_4_0: . source/auth source/auth/credentials source/lib/events source/libcli source/libcli/security source/param

2007-12-15 Thread jelmer
Author: jelmer
Date: 2007-12-15 22:23:45 + (Sat, 15 Dec 2007)
New Revision: 26464

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26464

Log:
Tighten dependencies.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/auth/config.mk
   branches/SAMBA_4_0/source/auth/credentials/config.mk
   branches/SAMBA_4_0/source/lib/events/config.mk
   branches/SAMBA_4_0/source/libcli/config.mk
   branches/SAMBA_4_0/source/libcli/security/config.mk
   branches/SAMBA_4_0/source/param/config.mk
   branches/SAMBA_4_0/source/param/loadparm.c


Changeset:

Property changes on: branches/SAMBA_4_0
___
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/auth/config.mk
===
--- branches/SAMBA_4_0/source/auth/config.mk2007-12-15 22:23:42 UTC (rev 
26463)
+++ branches/SAMBA_4_0/source/auth/config.mk2007-12-15 22:23:45 UTC (rev 
26464)
@@ -11,7 +11,7 @@
 [SUBSYSTEM::auth_system_session]
 OBJ_FILES = system_session.o
 PUBLIC_PROTO_HEADER = system_session_proto.h
-PRIVATE_DEPENDENCIES = auth_session
+PRIVATE_DEPENDENCIES = auth_session LIBSAMBA-UTIL
 
 [SUBSYSTEM::auth_sam]
 PRIVATE_PROTO_HEADER = auth_sam.h

Modified: branches/SAMBA_4_0/source/auth/credentials/config.mk
===
--- branches/SAMBA_4_0/source/auth/credentials/config.mk2007-12-15 
22:23:42 UTC (rev 26463)
+++ branches/SAMBA_4_0/source/auth/credentials/config.mk2007-12-15 
22:23:45 UTC (rev 26464)
@@ -7,7 +7,7 @@
credentials_files.o \
credentials_ntlm.o
 PUBLIC_DEPENDENCIES = \
-   LIBCLI_AUTH SECRETS LIBCRYPTO KERBEROS
+   LIBCLI_AUTH SECRETS LIBCRYPTO KERBEROS UTIL_LDB
 PRIVATE_DEPENDENCIES = CREDENTIALS_KRB5
 # End SUBSYSTEM CREDENTIALS
 #

Modified: branches/SAMBA_4_0/source/lib/events/config.mk
===
--- branches/SAMBA_4_0/source/lib/events/config.mk  2007-12-15 22:23:42 UTC 
(rev 26463)
+++ branches/SAMBA_4_0/source/lib/events/config.mk  2007-12-15 22:23:45 UTC 
(rev 26464)
@@ -33,7 +33,7 @@
 [SUBSYSTEM::LIBEVENTS]
 OBJ_FILES = events.o events_timed.o events_signal.o
 PUBLIC_HEADERS = events.h events_internal.h
-PUBLIC_DEPENDENCIES = LIBTALLOC
+PUBLIC_DEPENDENCIES = LIBTALLOC LIBSAMBA-UTIL
 # End SUBSYSTEM LIBEVENTS
 ##
 

Modified: branches/SAMBA_4_0/source/libcli/config.mk
===
--- branches/SAMBA_4_0/source/libcli/config.mk  2007-12-15 22:23:42 UTC (rev 
26463)
+++ branches/SAMBA_4_0/source/libcli/config.mk  2007-12-15 22:23:45 UTC (rev 
26464)
@@ -35,7 +35,7 @@
smb_composite/fetchfile.o \
smb_composite/appendacl.o \
smb_composite/fsinfo.o 
-PUBLIC_DEPENDENCIES = LIBCLI_COMPOSITE CREDENTIALS gensec
+PUBLIC_DEPENDENCIES = LIBCLI_COMPOSITE CREDENTIALS gensec LIBCLI_RESOLVE
 
 [SUBSYSTEM::NDR_NBT_BUF]
 PRIVATE_PROTO_HEADER = nbt/nbtname.h
@@ -74,7 +74,7 @@
dgram/netlogon.o \
dgram/ntlogon.o \
dgram/browse.o
-PUBLIC_DEPENDENCIES = LIBCLI_NBT
+PUBLIC_DEPENDENCIES = LIBCLI_NBT LIBNDR LIBCLI_RESOLVE
 
 [LIBRARY::LIBCLI_CLDAP]
 VERSION = 0.0.1

Modified: branches/SAMBA_4_0/source/libcli/security/config.mk
===
--- branches/SAMBA_4_0/source/libcli/security/config.mk 2007-12-15 22:23:42 UTC 
(rev 26463)
+++ branches/SAMBA_4_0/source/libcli/security/config.mk 2007-12-15 22:23:45 UTC 
(rev 26464)
@@ -6,7 +6,7 @@
access_check.o \
privilege.o \
sddl.o
-PUBLIC_DEPENDENCIES = NDR_MISC
+PUBLIC_DEPENDENCIES = NDR_MISC LIBNDR
 
 [PYTHON::swig_security]
 SWIG_FILE = security.i

Modified: branches/SAMBA_4_0/source/param/config.mk
===
--- branches/SAMBA_4_0/source/param/config.mk   2007-12-15 22:23:42 UTC (rev 
26463)
+++ branches/SAMBA_4_0/source/param/config.mk   2007-12-15 22:23:45 UTC (rev 
26464)
@@ -8,7 +8,7 @@
util.o \
../lib/version.o
 PUBLIC_DEPENDENCIES = LIBSAMBA-UTIL 
-PRIVATE_DEPENDENCIES = DYNCONFIG LIBREPLACE_EXT
+PRIVATE_DEPENDENCIES = DYNCONFIG LIBREPLACE_EXT CHARSET
 PUBLIC_PROTO_HEADER = proto.h
 PUBLIC_HEADERS = param.h
 
@@ -41,7 +41,7 @@
 SUBSYSTEM = share
 INIT_FUNCTION = share_ldb_init
 OBJ_FILES = share_ldb.o 
-PRIVATE_DEPENDENCIES = LIBLDB
+PRIVATE_DEPENDENCIES = LIBLDB LDB_WRAP
 # End MODULE share_ldb
 
 

Modified: branches/SAMBA_4_0/source/param/loadparm.c
===
--- branches/SAMBA_4_0/source/param/loadparm.c  2007-12-15 

Re: [SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-669-geb523ba

2007-12-15 Thread Jeremy Allison
On Sat, Dec 15, 2007 at 04:11:20PM -0600, Volker Lendecke wrote:
 The branch, v3-2-test has been updated
via  eb523ba77697346a365589101aac379febecd546 (commit)
via  3a0b1b2060facd5f1ac1461b23dd86c75cdd9458 (commit)
via  7b8276aaa48852270c6b70b081c3f28e316a7a2c (commit)
via  c7c885078be8fd3024c186044ac28275d7609679 (commit)
via  c221c246b10e2dbbd54a9af2dc45de2eae237380 (commit)
via  60e830b0f4571bd5d9039f2edd199534f2a4c341 (commit)
via  0a911d38b8f4be382a9df60f9c6de0c500464b3a (commit)
via  bb35e794ec129805e874ceba882bcc1e84791a09 (commit)
via  3e4148c280efe154c3f8d552731c8b29d6977507 (commit)
via  6312016e2727c2b5b1a4964a98cfb9585d77cc8c (commit)
via  f00ab810d2540679bec109498ac89e1eafe18f03 (commit)
via  9e3ef0923d71cc06b8445be2625ebd8dfed1b42d (commit)
   from  1f352cdd1976ad36484e146165df585b88ec5527 (commit)
 
 http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
 
 
 - Log -
 commit eb523ba77697346a365589101aac379febecd546
 Author: Volker Lendecke [EMAIL PROTECTED]
 Date:   Sat Dec 15 22:47:30 2007 +0100
 
 s/sid_to_string/sid_to_fstring/
 
 least surprise for callers

Thanks for these, I was planning to attack this next :-).

Jeremy.


svn commit: samba r26465 - in branches/SAMBA_4_0/source/utils: .

2007-12-15 Thread kai
Author: kai
Date: 2007-12-15 23:15:18 + (Sat, 15 Dec 2007)
New Revision: 26465

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26465

Log:
ntlm_auth: Remoce pstring.

Modified:
   branches/SAMBA_4_0/source/utils/ntlm_auth.c


Changeset:
Modified: branches/SAMBA_4_0/source/utils/ntlm_auth.c
===
--- branches/SAMBA_4_0/source/utils/ntlm_auth.c 2007-12-15 22:23:45 UTC (rev 
26464)
+++ branches/SAMBA_4_0/source/utils/ntlm_auth.c 2007-12-15 23:15:18 UTC (rev 
26465)
@@ -339,16 +339,25 @@
 **/
 static bool in_list(const char *s, const char *list, bool casesensitive)
 {
-   pstring tok;
+   char *tok;
+   size_t tok_len = 1024;
const char *p=list;
 
if (!list)
return false;
 
-   while (next_token(p, tok, LIST_SEP, sizeof(tok))) {
-   if ((casesensitive?strcmp:strcasecmp_m)(tok,s) == 0)
+   tok = (char *)malloc(tok_len);
+   if (!tok) {
+   return false;
+   }
+
+   while (next_token(p, tok, LIST_SEP, tok_len)) {
+   if ((casesensitive?strcmp:strcasecmp_m)(tok,s) == 0) {
+   free(tok);
return true;
+   }
}
+   free(tok);
return false;
 }
 



svn commit: samba r26466 - in branches/SAMBA_4_0/source/torture/basic: .

2007-12-15 Thread kai
Author: kai
Date: 2007-12-15 23:16:43 + (Sat, 15 Dec 2007)
New Revision: 26466

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26466

Log:
Janitorial: Remove pstrings and static char[]s from torture/basic/scanner.c

Modified:
   branches/SAMBA_4_0/source/torture/basic/scanner.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/basic/scanner.c
===
--- branches/SAMBA_4_0/source/torture/basic/scanner.c   2007-12-15 23:15:18 UTC 
(rev 26465)
+++ branches/SAMBA_4_0/source/torture/basic/scanner.c   2007-12-15 23:16:43 UTC 
(rev 26466)
@@ -23,12 +23,12 @@
 #include torture/util.h
 #include libcli/raw/libcliraw.h
 #include system/filesys.h
-#include pstring.h
 #include param/param.h
 
 #define VERBOSE 0
 #define OP_MIN 0
 #define OP_MAX 100
+#define PARAM_SIZE 1024
 
 /
 look for a partial hit
@@ -82,12 +82,12 @@
*rdata_len = t2.out.data.length;
 
talloc_free(mem_ctx);
-   
+
return status;
 }
 
 
-static NTSTATUS try_trans2_len(struct smbcli_state *cli, 
+static NTSTATUS try_trans2_len(struct smbcli_state *cli,
 const char *format,
 int op, int level,
 uint8_t *param, uint8_t *data,
@@ -97,14 +97,14 @@
NTSTATUS ret=NT_STATUS_OK;
 
ret = try_trans2(cli, op, param, data, param_len,
-sizeof(pstring), rparam_len, rdata_len);
-#if VERBOSE 
+PARAM_SIZE, rparam_len, rdata_len);
+#if VERBOSE
printf(op=%d level=%d ret=%s\n, op, level, nt_errstr(ret));
 #endif
if (!NT_STATUS_IS_OK(ret)) return ret;
 
*data_len = 0;
-   while (*data_len  sizeof(pstring)) {
+   while (*data_len  PARAM_SIZE) {
ret = try_trans2(cli, op, param, data, param_len,
 *data_len, rparam_len, rdata_len);
if (NT_STATUS_IS_OK(ret)) break;
@@ -125,124 +125,162 @@
 /
 static bool trans2_op_exists(struct smbcli_state *cli, int op)
 {
-   int data_len = 0;
-   int param_len = 0;
+   int data_len = PARAM_SIZE;
+   int param_len = PARAM_SIZE;
int rparam_len, rdata_len;
-   uint8_t param[1024], data[1024];
+   uint8_t *param, *data;
NTSTATUS status1, status2;
+   TALLOC_CTX *mem_ctx;
 
-   memset(data, 0, sizeof(data));
-   data_len = 4;
+   mem_ctx = talloc_init(trans2_op_exists);
 
/* try with a info level only */
-   param_len = sizeof(param);
-   data_len = sizeof(data);
 
-   memset(param, 0xFF, sizeof(param));
-   memset(data, 0xFF, sizeof(data));
-   
-   status1 = try_trans2(cli, 0x, param, data, param_len, data_len, 
+   param = talloc_array(mem_ctx, uint8_t, param_len);
+   data  = talloc_array(mem_ctx, uint8_t, data_len);
+
+   memset(param, 0xFF, param_len);
+   memset(data, 0xFF, data_len);
+
+   status1 = try_trans2(cli, 0x, param, data, param_len, data_len,
 rparam_len, rdata_len);
 
-   status2 = try_trans2(cli, op, param, data, param_len, data_len, 
+   status2 = try_trans2(cli, op, param, data, param_len, data_len,
 rparam_len, rdata_len);
 
-   if (NT_STATUS_EQUAL(status1, status2)) return false;
+   if (NT_STATUS_EQUAL(status1, status2)) {
+   talloc_free(mem_ctx);
+   return false;
+   }
 
printf(Found op %d (status=%s)\n, op, nt_errstr(status2));
 
+   talloc_free(mem_ctx);
return true;
 }
 
 /
 check for existance of a trans2 call
 /
-static bool scan_trans2(struct smbcli_state *cli, int op, int level, 
+static bool scan_trans2(struct smbcli_state *cli, int op, int level,
int fnum, int dnum, int qfnum, const char *fname)
 {
int data_len = 0;
int param_len = 0;
int rparam_len, rdata_len;
-   uint8_t param[1024], data[1024];
+   uint8_t *param, *data;
NTSTATUS status;
+   TALLOC_CTX *mem_ctx;
 
-   memset(data, 0, sizeof(data));
+   mem_ctx = talloc_init(scan_trans2);
+
+   data = talloc_array(mem_ctx, uint8_t, PARAM_SIZE);
+   param = talloc_array(mem_ctx, uint8_t, PARAM_SIZE);
+
+   memset(data, 0, PARAM_SIZE);
data_len = 4;
 
/* try with a info level only */
param_len = 2;
SSVAL(param, 0, level);
-   status = try_trans2_len(cli, void, op, level, param, data, param_len, 
data_len, 
-   rparam_len, rdata_len);
-   if (NT_STATUS_IS_OK(status)) return true;
+   status = try_trans2_len(cli, 

Build status as of Sun Dec 16 00:00:02 2007

2007-12-15 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-12-15 
00:00:40.0 +
+++ /home/build/master/cache/broken_results.txt 2007-12-16 00:00:57.0 
+
@@ -1,10 +1,10 @@
-Build status as of Sat Dec 15 00:00:01 2007
+Build status as of Sun Dec 16 00:00:02 2007
 
 Build counts:
 Tree Total  Broken Panic 
 SOC  0  0  0 
 build_farm   0  0  0 
-ccache   28 9  0 
+ccache   29 9  0 
 ctdb 0  0  0 
 distcc   1  0  0 
 ldb  29 11 0 
@@ -13,12 +13,12 @@
 pidl 18 5  0 
 ppp  10 8  0 
 python   0  0  0 
-rsync29 11 0 
+rsync29 12 0 
 samba-docs   0  0  0 
 samba-gtk4  4  0 
-samba4   26 17 1 
+samba4   26 18 1 
 samba_3_21  0  0 
-samba_3_2_test 27 17 0 
+samba_3_2_test 27 18 0 
 smb-build27 26 0 
 talloc   29 7  0 
 tdb  29 5  0 


svn commit: samba r26467 - in branches/SAMBA_4_0: . source/lib/replace source/lib/replace/system source/lib/socket

2007-12-15 Thread jelmer
Author: jelmer
Date: 2007-12-16 02:39:01 + (Sun, 16 Dec 2007)
New Revision: 26467

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26467

Log:
Use getifaddrs() for interface enumeration and provide replacements for 
platforms that don't have it in lib/replace.
Added:
   branches/SAMBA_4_0/source/lib/replace/getifaddrs.c
   branches/SAMBA_4_0/source/lib/replace/getifaddrs.m4
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/lib/replace/libreplace.m4
   branches/SAMBA_4_0/source/lib/replace/system/network.h
   branches/SAMBA_4_0/source/lib/socket/config.m4
   branches/SAMBA_4_0/source/lib/socket/netif.c


Changeset:
Sorry, the patch is too large (1044 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26467


svn commit: samba r26468 - in branches/SAMBA_4_0: . source/lib/replace source/lib/replace/test

2007-12-15 Thread jelmer
Author: jelmer
Date: 2007-12-16 02:49:52 + (Sun, 16 Dec 2007)
New Revision: 26468

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26468

Log:
Match getifaddrs more closely, add trivial test.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/lib/replace/getifaddrs.c
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c


Changeset:

Property changes on: branches/SAMBA_4_0
___
Name: bzr:revision-info
...skipped...
Name: bzr:file-ids
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/lib/replace/getifaddrs.c
===
--- branches/SAMBA_4_0/source/lib/replace/getifaddrs.c  2007-12-16 02:39:01 UTC 
(rev 26467)
+++ branches/SAMBA_4_0/source/lib/replace/getifaddrs.c  2007-12-16 02:49:52 UTC 
(rev 26468)
@@ -112,7 +112,6 @@
}
 
curif-ifa_name = strdup(ifr[i].ifr_name);
-   curif-ifa_flags = ifreq.ifr_flags;
curif-ifa_addr = sockaddr_dup(ifr[i].ifr_addr);
curif-ifa_dstaddr = NULL;
curif-ifa_data = NULL;
@@ -124,10 +123,7 @@
return -1;
}  
 
-   if (!(ifr[i].ifr_flags  IFF_UP)) {
-   freeifaddrs(curif);
-   continue;
-   }
+   curif-ifa_flags = ifr[i].ifr_flags;
 
if (ioctl(fd, SIOCGIFNETMASK, ifr[i]) != 0) {
freeifaddrs(*ifap);
@@ -201,6 +197,13 @@
for (i = 0; in  total  max_interfaces; i++) {
ifreq = ifr[i];
   
+   curif = calloc(1, sizeof(struct ifaddrs));
+   if (lastif == NULL) {
+   *ifap = curif;
+   } else {
+   lastif-ifa_next = (*ifap);
+   }
+
strioctl.ic_cmd = SIOCGIFFLAGS;
strioctl.ic_dp  = (char *)ifreq;
strioctl.ic_len = sizeof(struct ifreq);
@@ -208,11 +211,9 @@
freeifaddrs(*ifap);
return -1;
}
-   
-   if (!(ifreq.ifr_flags  IFF_UP)) {
-   continue;
-   }
 
+   curif-ifa_flags = ifreq.ifr_flags;
+   
strioctl.ic_cmd = SIOCGIFADDR;
strioctl.ic_dp  = (char *)ifreq;
strioctl.ic_len = sizeof(struct ifreq);
@@ -221,15 +222,7 @@
return -1;
}
 
-   curif = calloc(1, sizeof(struct ifaddrs));
-   if (lastif == NULL) {
-   *ifap = curif;
-   } else {
-   lastif-ifa_next = (*ifap);
-   }
-
curif-ifa_name = strdup(ifreq.ifr_name);
-   curif-ifa_flags = ifreq.ifr_flags;
curif-ifa_addr = sockaddr_dup(ifreq.ifr_addr);
curif-ifa_dstaddr = NULL;
curif-ifa_data = NULL;
@@ -310,7 +303,6 @@
}
 
curif-ifa_name = strdup(ifr-ifr_name);
-   curif-ifa_flags = ifr-ifr_flags;
curif-ifa_addr = sockaddr_dup(ifr-ifr_addr);
curif-ifa_dstaddr = NULL;
curif-ifa_data = NULL;
@@ -322,10 +314,7 @@
return -1;
}
 
-   if (!(ifr-ifr_flags  IFF_UP)) {
-   freeaddrinfo(curif);
-   continue;
-   }
+   curif-ifa_flags = ifr-ifr_flags;
 
if (ioctl(fd, SIOCGIFNETMASK, ifr) != 0) {
freeaddrinfo(*ifap);

Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2007-12-16 
02:39:01 UTC (rev 26467)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2007-12-16 
02:49:52 UTC (rev 26468)
@@ -856,6 +856,25 @@
return libreplace_test_strptime();
 }
 
+static int test_getifaddrs(void)
+{
+   struct ifaddrs *ifa;
+   int ret;
+
+   printf(test: getifaddrs\n);
+
+   ret = getifaddrs(ifa);
+   if (ret != 0) {
+   printf(failure: getifaddrs\n);
+   return false;
+   }
+
+   freeifaddrs(ifa);
+
+   printf(success: getifaddrs\n);
+   return true;
+}
+
 struct torture_context;
 bool torture_local_replace(struct torture_context *ctx)
 {
@@ -903,6 +922,7 @@
ret = test_MAX();
ret = test_socketpair();
ret = test_strptime();
+   ret = test_getifaddrs();
 
return ret;
 }



svn commit: samba r26469 - in branches/SAMBA_4_0: . source/lib/replace source/lib/replace/system

2007-12-15 Thread jelmer
Author: jelmer
Date: 2007-12-16 03:22:13 + (Sun, 16 Dec 2007)
New Revision: 26469

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=26469

Log:
Fix paths, only include IPv4 addresses for now.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/lib/replace/getifaddrs.c
   branches/SAMBA_4_0/source/lib/replace/getifaddrs.m4
   branches/SAMBA_4_0/source/lib/replace/system/network.h


Changeset:

Property changes on: branches/SAMBA_4_0
___
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/lib/replace/getifaddrs.c
===
--- branches/SAMBA_4_0/source/lib/replace/getifaddrs.c  2007-12-16 02:49:52 UTC 
(rev 26468)
+++ branches/SAMBA_4_0/source/lib/replace/getifaddrs.c  2007-12-16 03:22:13 UTC 
(rev 26469)
@@ -360,20 +360,25 @@
 
  int main()
 {
-   struct ifaddrs *ifs;
-   int total = get_interfaces(ifaces, MAX_INTERFACES);
-   int i;
-
-   int ret = getifaddrs(ifs);
+   struct ifaddrs *ifs = NULL;
+   int ret;
+   
+   ret = getifaddrs(ifs);
if (ret != 0) {
perror(getifaddrs() failed);
return 1;
}
 
while (ifs) {
-   printf(%-10s , ifs-ifr_name);
-   printf(IP=%s , inet_ntoa(((struct sockaddr_in 
*)ifs-ifr_addr)-sin_addr));
-   printf(NETMASK=%s\n, inet_ntoa(((struct sockaddr_in 
*)ifs-ifr_netmask)-sin_addr));
+   printf(%-10s , ifs-ifa_name);
+   if (ifs-ifa_addr != NULL  
+   ifs-ifa_addr-sa_family == AF_INET) {
+   printf(IP=%s , inet_ntoa(((struct sockaddr_in 
*)ifs-ifa_addr)-sin_addr));
+   if (ifs-ifa_netmask != NULL)
+   printf(NETMASK=%s, inet_ntoa(((struct 
sockaddr_in *)ifs-ifa_netmask)-sin_addr));
+   }
+   printf(\n);
+   ifs = ifs-ifa_next;
}
return 0;
 }

Modified: branches/SAMBA_4_0/source/lib/replace/getifaddrs.m4
===
--- branches/SAMBA_4_0/source/lib/replace/getifaddrs.m4 2007-12-16 02:49:52 UTC 
(rev 26468)
+++ branches/SAMBA_4_0/source/lib/replace/getifaddrs.m4 2007-12-16 03:22:13 UTC 
(rev 26469)
@@ -26,10 +26,8 @@
 #
 # This tests need LIBS=$NSL_LIBS $SOCKET_LIBS
 #
-old_CFLAGS=$CFLAGS
 old_LIBS=$LIBS
 LIBS=$NSL_LIBS $SOCKET_LIBS
-CFLAGS=$CFLAGS -Ilib/replace
 iface=no;
 ##
 # look for a method of finding the list of network interfaces
@@ -41,8 +39,8 @@
 #define NO_CONFIG_H 1
 #define HAVE_IFACE_GETIFADDRS 1
 #define AUTOCONF_TEST 1
-#include ${srcdir-.}/lib/replace/replace.c
-#include ${srcdir-.}/lib/replace/getifaddrs.c],
+#include $libreplacedir/replace.c
+#include $libreplacedir/getifaddrs.c],

samba_cv_HAVE_IFACE_GETIFADDRS=yes,samba_cv_HAVE_IFACE_GETIFADDRS=no,samba_cv_HAVE_IFACE_GETIFADDRS=cross)])
 CPPFLAGS=$SAVE_CPPFLAGS
 if test x$samba_cv_HAVE_IFACE_GETIFADDRS = xyes; then
@@ -58,7 +56,7 @@
 #define HAVE_IFACE_AIX 1
 #define AUTOCONF_TEST 1
 #undef _XOPEN_SOURCE_EXTENDED
-#include ${srcdir-.}/lib/replace/getifaddrs.c],
+#include $libreplacedir/getifaddrs.c],

samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
 if test x$samba_cv_HAVE_IFACE_AIX = xyes; then
 iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
@@ -71,7 +69,7 @@
 AC_TRY_RUN([
 #define HAVE_IFACE_IFCONF 1
 #define AUTOCONF_TEST 1
-#include ${srcdir-.}/lib/replace/getifaddrs.c],
+#include $libreplacedir/getifaddrs.c],

samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
 if test x$samba_cv_HAVE_IFACE_IFCONF = xyes; then
 iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is 
available])
@@ -83,12 +81,11 @@
 AC_TRY_RUN([
 #define HAVE_IFACE_IFREQ 1
 #define AUTOCONF_TEST 1
-#include ${srcdir-.}/lib/replace/getifaddrs.c],
+#include $libreplacedir/getifaddrs.c],

samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
 if test x$samba_cv_HAVE_IFACE_IFREQ = xyes; then
 iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
 fi
 fi
 
-CFLAGS=$old_CFLAGS
 LIBS=$old_LIBS

Modified: branches/SAMBA_4_0/source/lib/replace/system/network.h
===
--- branches/SAMBA_4_0/source/lib/replace/system/network.h  2007-12-16 
02:49:52 UTC (rev 26468)
+++ branches/SAMBA_4_0/source/lib/replace/system/network.h  2007-12-16 
03:22:13 UTC (rev 26469)
@@ -102,7 +102,7 @@
 struct ifaddrs {
struct ifaddrs   *ifa_next; /* Pointer to next struct */
char *ifa_name; /* Interface name */
-   u_int ifa_flags;   

[SCM] Samba Shared Repository - branch v3-0-test updated - release-3-0-28-34-ge2c4d91

2007-12-15 Thread Jeremy Allison
The branch, v3-0-test has been updated
   via  e2c4d91a331001b4cae82e9820323036812b5bcd (commit)
  from  44ba475acc854258e83d26d45dc35c69da69aed8 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test


- Log -
commit e2c4d91a331001b4cae82e9820323036812b5bcd
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Dec 15 22:28:46 2007 -0800

More work on bug #5082, use LC_ALL as this takes
precedence.
Jeremy.

---

Summary of changes:
 source/smbd/chgpasswd.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/chgpasswd.c b/source/smbd/chgpasswd.c
index 4ec8452..b4b60f1 100644
--- a/source/smbd/chgpasswd.c
+++ b/source/smbd/chgpasswd.c
@@ -500,7 +500,7 @@ BOOL chgpasswd(const char *name, const struct passwd *pass,
if (lp_pam_password_change()) {
BOOL ret;
 #ifdef HAVE_SETLOCALE
-   char *prevlocale = setlocale(LC_MESSAGES, C);
+   char *prevlocale = setlocale(LC_ALL, C);
 #endif
 
if (as_root)
@@ -516,7 +516,7 @@ BOOL chgpasswd(const char *name, const struct passwd *pass,
unbecome_root();
 
 #ifdef HAVE_SETLOCALE
-   setlocale(LC_MESSAGES, prevlocale);
+   setlocale(LC_ALL, prevlocale);
 #endif
 
return ret;


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-670-g446ebae

2007-12-15 Thread Jeremy Allison
The branch, v3-2-test has been updated
   via  446ebae76d6796b30e4c71ff7190337c28637be6 (commit)
  from  eb523ba77697346a365589101aac379febecd546 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit 446ebae76d6796b30e4c71ff7190337c28637be6
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Dec 15 22:28:38 2007 -0800

More work on bug #5082, use LC_ALL as this takes
precedence.
Jeremy.

---

Summary of changes:
 source/smbd/chgpasswd.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/chgpasswd.c b/source/smbd/chgpasswd.c
index 58b67a5..a277e72 100644
--- a/source/smbd/chgpasswd.c
+++ b/source/smbd/chgpasswd.c
@@ -520,7 +520,7 @@ bool chgpasswd(const char *name, const struct passwd *pass,
if (lp_pam_password_change()) {
bool ret;
 #ifdef HAVE_SETLOCALE
-   const char *prevlocale = setlocale(LC_MESSAGES, C);
+   const char *prevlocale = setlocale(LC_ALL, C);
 #endif
 
if (as_root)
@@ -536,7 +536,7 @@ bool chgpasswd(const char *name, const struct passwd *pass,
unbecome_root();
 
 #ifdef HAVE_SETLOCALE
-   setlocale(LC_MESSAGES, prevlocale);
+   setlocale(LC_ALL, prevlocale);
 #endif
 
return ret;


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-671-ge799eb8

2007-12-15 Thread Jeremy Allison
The branch, v3-2-test has been updated
   via  e799eb8da6f5e7a2173ba6b8fb040430fd1c6f34 (commit)
  from  446ebae76d6796b30e4c71ff7190337c28637be6 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit e799eb8da6f5e7a2173ba6b8fb040430fd1c6f34
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Dec 15 23:05:30 2007 -0800

Cope with valgrind  3.2.x.
Jeremy.

---

Summary of changes:
 source/lib/clobber.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/clobber.c b/source/lib/clobber.c
index b97262a..e77e786 100644
--- a/source/lib/clobber.c
+++ b/source/lib/clobber.c
@@ -53,7 +53,11 @@ void clobber_region(const char *fn, unsigned int line, char 
*dest, size_t len)
 * (This is not redundant with the clobbering above.  The
 * marking might not actually take effect if we're not running
 * under valgrind.) */
+#if defined(VALGRIND_MAKE_MEM_UNDEFINED)
+   VALGRIND_MAKE_MEM_UNDEFINED(dest, len);
+#elif defined(VALGRIND_MAKE_WRITABLE)
VALGRIND_MAKE_WRITABLE(dest, len);
+#endif
 #endif /* VALGRIND */
 #endif /* DEVELOPER */
 }


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-0-test updated - release-3-0-28-35-g38eca7a

2007-12-15 Thread Jeremy Allison
The branch, v3-0-test has been updated
   via  38eca7a2d0d4b899c3ff94dc3ec51e103ac49cdd (commit)
  from  e2c4d91a331001b4cae82e9820323036812b5bcd (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test


- Log -
commit 38eca7a2d0d4b899c3ff94dc3ec51e103ac49cdd
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Dec 15 23:05:37 2007 -0800

Cope with valgrind  3.2.x.
Jeremy.

---

Summary of changes:
 source/lib/clobber.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/clobber.c b/source/lib/clobber.c
index fb3a0dc..d3a9c59 100644
--- a/source/lib/clobber.c
+++ b/source/lib/clobber.c
@@ -54,7 +54,11 @@ void clobber_region(const char *fn, unsigned int line, char 
*dest, size_t len)
 * (This is not redundant with the clobbering above.  The
 * marking might not actually take effect if we're not running
 * under valgrind.) */
+#if defined(VALGRIND_MAKE_MEM_UNDEFINED)
+   VALGRIND_MAKE_MEM_UNDEFINED(dest, len);
+#elif defined(VALGRIND_MAKE_WRITABLE)
VALGRIND_MAKE_WRITABLE(dest, len);
+#endif
 #endif /* VALGRIND */
 #endif /* DEVELOPER */
 }


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-672-gd0e3384

2007-12-15 Thread Jeremy Allison
The branch, v3-2-test has been updated
   via  d0e33840fb4cfc85990d3ee327428b0854a22722 (commit)
  from  e799eb8da6f5e7a2173ba6b8fb040430fd1c6f34 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit d0e33840fb4cfc85990d3ee327428b0854a22722
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Dec 15 23:22:25 2007 -0800

Added patch originally by Andreas Schneider [EMAIL PROTECTED]
to cause us to behave like Vista when looking for remote
machine principal. Modified by me.
Jeremy.

---

Summary of changes:
 source/configure.in|   24 
 source/libads/kerberos.c   |   52 
 source/libsmb/cliconnect.c |   50 +++--
 3 files changed, 118 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/configure.in b/source/configure.in
index 7272ae4..ac60b6f 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -4221,6 +4221,30 @@ if test x$with_ads_support != xno; then
 fi
   fi
 
+  AC_CACHE_CHECK([for krb5_principal_get_realm],
+samba_cv_HAVE_KRB5_PRINCIPAL_GET_REALM,[
+AC_TRY_LINK([#include krb5.h],
+  [krb5_context ctx = NULL; krb5_principal princ = NULL; const char *str = 
krb5_principal_get_realm(ctx, princ);],
+  samba_cv_HAVE_KRB5_PRINCIPAL_GET_REALM=yes,
+  samba_cv_HAVE_KRB5_PRINCIPAL_GET_REALM=no)])
+
+  if test x$samba_cv_HAVE_KRB5_PRINCIPAL_GET_REALM = xyes; then
+AC_DEFINE(HAVE_KRB5_PRINCIPAL_GET_REALM,1,
+   [Whether the function krb5_principal_get_realm is defined])
+  fi
+
+  AC_CACHE_CHECK([for krb5_princ_realm],
+samba_cv_HAVE_KRB5_PRINC_REALM,[
+AC_TRY_LINK([#include krb5.h],
+  [krb5_context ctx = NULL; krb5_principal princ = NULL; const char *str = 
krb5_princ_realm(ctx, princ)-data;],
+  samba_cv_HAVE_KRB5_PRINC_REALM=yes,
+  samba_cv_HAVE_KRB5_PRINC_REALM=no)])
+
+  if test x$samba_cv_HAVE_KRB5_PRINC_REALM = xyes; then
+AC_DEFINE(HAVE_KRB5_PRINC_REALM,1,
+   [Whether the macro krb5_princ_realm is defined])
+  fi
+
   #
   #
   # Now the decisions whether we can support krb5
diff --git a/source/libads/kerberos.c b/source/libads/kerberos.c
index 29e5661..02e14f4 100644
--- a/source/libads/kerberos.c
+++ b/source/libads/kerberos.c
@@ -487,6 +487,58 @@ char* kerberos_secrets_fetch_des_salt( void )
return salt;
 }
 
+/
+ Routine to get the default realm from the kerberos credentials cache.
+ Caller must free if the return value is not NULL.
+/
+
+char *kerberos_get_default_realm_from_ccache( void )
+{
+   char *realm = NULL;
+   krb5_context ctx = NULL;
+   krb5_ccache cc = NULL;
+   krb5_principal princ = NULL;
+
+   initialize_krb5_error_table();
+   if (krb5_init_context(ctx)) {
+   return NULL;
+   }
+
+   DEBUG(5,(kerberos_get_default_realm_from_ccache: 
+   Trying to read krb5 cache: %s\n,
+   krb5_cc_default_name(ctx)));
+   if (krb5_cc_default(ctx, cc)) {
+   DEBUG(0,(kerberos_get_default_realm_from_ccache: 
+   failed to read default cache\n));
+   goto out;
+   }
+   if (krb5_cc_get_principal(ctx, cc, princ)) {
+   DEBUG(0,(kerberos_get_default_realm_from_ccache: 
+   failed to get default principal\n));
+   goto done;
+   }
+
+#if defined(HAVE_KRB5_PRINCIPAL_GET_REALM)
+   realm = SMB_STRDUP(krb5_principal_get_realm(ctx, princ));
+#elif defined(HAVE_KRB5_PRINC_REALM)
+   realm = SMB_STRDUP(krb5_princ_realm(ctx, princ)-data);
+#endif
+
+  out:
+
+   if (princ) {
+   krb5_free_principal(ctx, princ);
+   }
+   if (cc) {
+   krb5_cc_close(ctx, cc);
+   }
+   if (ctx) {
+   krb5_free_context(ctx);
+   }
+done:
+   return realm;
+}
+
 
 /
  Routine to get the salting principal for this service.  This is 
diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c
index 45c2020..52ff699 100644
--- a/source/libsmb/cliconnect.c
+++ b/source/libsmb/cliconnect.c
@@ -37,6 +37,8 @@ static const struct {
{-1,NULL}
 };
 
+static const char *star_smbserver_name = *SMBSERVER;
+
 /**
  * Set the user session key for a connection
  * @param cli The cli structure to add it too
@@ -858,10 +860,42 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state 
*cli, const char *user,
}
}

-   rc = cli_session_setup_kerberos(cli, principal, domain);
-  

[SCM] Samba Shared Repository - branch v3-0-test updated - release-3-0-28-36-g02b5280

2007-12-15 Thread Jeremy Allison
The branch, v3-0-test has been updated
   via  02b5280a8b35346dc41279bab80a4cec8a7515eb (commit)
  from  38eca7a2d0d4b899c3ff94dc3ec51e103ac49cdd (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test


- Log -
commit 02b5280a8b35346dc41279bab80a4cec8a7515eb
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Dec 15 23:22:17 2007 -0800

Added patch originally by Andreas Schneider [EMAIL PROTECTED]
to cause us to behave like Vista when looking for remote
machine principal. Modified by me.
Jeremy.

---

Summary of changes:
 source/configure.in|   24 
 source/libads/kerberos.c   |   52 
 source/libsmb/cliconnect.c |   49 ++--
 3 files changed, 117 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/configure.in b/source/configure.in
index 91f1582..d9fc21b 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -3944,6 +3944,30 @@ if test x$with_ads_support != xno; then
   fi
 
 
+  AC_CACHE_CHECK([for krb5_principal_get_realm],
+samba_cv_HAVE_KRB5_PRINCIPAL_GET_REALM,[
+AC_TRY_LINK([#include krb5.h],
+  [krb5_context ctx = NULL; krb5_principal princ = NULL; const char *str = 
krb5_principal_get_realm(ctx, princ);],
+  samba_cv_HAVE_KRB5_PRINCIPAL_GET_REALM=yes,
+  samba_cv_HAVE_KRB5_PRINCIPAL_GET_REALM=no)])
+
+  if test x$samba_cv_HAVE_KRB5_PRINCIPAL_GET_REALM = xyes; then
+AC_DEFINE(HAVE_KRB5_PRINCIPAL_GET_REALM,1,
+   [Whether the function krb5_principal_get_realm is defined])
+  fi
+
+  AC_CACHE_CHECK([for krb5_princ_realm],
+samba_cv_HAVE_KRB5_PRINC_REALM,[
+AC_TRY_LINK([#include krb5.h],
+  [krb5_context ctx = NULL; krb5_principal princ = NULL; const char *str = 
krb5_princ_realm(ctx, princ)-data;],
+  samba_cv_HAVE_KRB5_PRINC_REALM=yes,
+  samba_cv_HAVE_KRB5_PRINC_REALM=no)])
+
+  if test x$samba_cv_HAVE_KRB5_PRINC_REALM = xyes; then
+AC_DEFINE(HAVE_KRB5_PRINC_REALM,1,
+   [Whether the macro krb5_princ_realm is defined])
+  fi
+
   #
   #
   # Now the decisions whether we can support krb5
diff --git a/source/libads/kerberos.c b/source/libads/kerberos.c
index c74c98d..6e3063d 100644
--- a/source/libads/kerberos.c
+++ b/source/libads/kerberos.c
@@ -362,6 +362,58 @@ char* kerberos_secrets_fetch_des_salt( void )
return salt;
 }
 
+/
+ Routine to get the default realm from the kerberos credentials cache.
+ Caller must free if the return value is not NULL.
+/
+
+char *kerberos_get_default_realm_from_ccache( void )
+{
+   char *realm = NULL;
+   krb5_context ctx = NULL;
+   krb5_ccache cc = NULL;
+   krb5_principal princ = NULL;
+
+   initialize_krb5_error_table();
+   if (krb5_init_context(ctx)) {
+   return NULL;
+   }
+
+   DEBUG(5,(kerberos_get_default_realm_from_ccache: 
+   Trying to read krb5 cache: %s\n,
+   krb5_cc_default_name(ctx)));
+   if (krb5_cc_default(ctx, cc)) {
+   DEBUG(0,(kerberos_get_default_realm_from_ccache: 
+   failed to read default cache\n));
+   goto out;
+   }
+   if (krb5_cc_get_principal(ctx, cc, princ)) {
+   DEBUG(0,(kerberos_get_default_realm_from_ccache: 
+   failed to get default principal\n));
+   goto done;
+   }
+
+#if defined(HAVE_KRB5_PRINCIPAL_GET_REALM)
+   realm = SMB_STRDUP(krb5_principal_get_realm(ctx, princ));
+#elif defined(HAVE_KRB5_PRINC_REALM)
+   realm = SMB_STRDUP(krb5_princ_realm(ctx, princ)-data);
+#endif
+
+  out:
+
+   if (princ) {
+   krb5_free_principal(ctx, princ);
+   }
+   if (cc) {
+   krb5_cc_close(ctx, cc);
+   }
+   if (ctx) {
+   krb5_free_context(ctx);
+   }
+done:
+   return realm;
+}
+
 
 /
  Routine to get the salting principal for this service.  This is 
diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c
index d458ce2..fb94ff8 100644
--- a/source/libsmb/cliconnect.c
+++ b/source/libsmb/cliconnect.c
@@ -40,6 +40,8 @@ static const struct {
{-1,NULL}
 };
 
+static const char *star_smbserver_name = *SMBSERVER;
+
 /**
  * Set the user session key for a connection
  * @param cli The cli structure to add it too
@@ -861,10 +863,41 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state 
*cli, const char *user,
}
}

-   rc = cli_session_setup_kerberos(cli, principal, domain);
- 

[SCM] Samba Shared Repository - branch v3-0-test updated - release-3-0-28-37-g2cf54d5

2007-12-15 Thread Jeremy Allison
The branch, v3-0-test has been updated
   via  2cf54d5f41f55897c94e9a0b7cb1ffe4e26f2c50 (commit)
  from  02b5280a8b35346dc41279bab80a4cec8a7515eb (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test


- Log -
commit 2cf54d5f41f55897c94e9a0b7cb1ffe4e26f2c50
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Dec 15 23:32:22 2007 -0800

Doh, fix typo in error exit.
Jeremy.

---

Summary of changes:
 source/libads/kerberos.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/libads/kerberos.c b/source/libads/kerberos.c
index 6e3063d..5adc98e 100644
--- a/source/libads/kerberos.c
+++ b/source/libads/kerberos.c
@@ -390,7 +390,7 @@ char *kerberos_get_default_realm_from_ccache( void )
if (krb5_cc_get_principal(ctx, cc, princ)) {
DEBUG(0,(kerberos_get_default_realm_from_ccache: 
failed to get default principal\n));
-   goto done;
+   goto out;
}
 
 #if defined(HAVE_KRB5_PRINCIPAL_GET_REALM)
@@ -410,7 +410,7 @@ char *kerberos_get_default_realm_from_ccache( void )
if (ctx) {
krb5_free_context(ctx);
}
-done:
+
return realm;
 }
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-673-g44918f3

2007-12-15 Thread Jeremy Allison
The branch, v3-2-test has been updated
   via  44918f39c0598eec681eb9e5c65452f04809c375 (commit)
  from  d0e33840fb4cfc85990d3ee327428b0854a22722 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit 44918f39c0598eec681eb9e5c65452f04809c375
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Dec 15 23:32:28 2007 -0800

Doh, fix typo in error exit.
Jeremy.

---

Summary of changes:
 source/libads/kerberos.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/libads/kerberos.c b/source/libads/kerberos.c
index 02e14f4..227f95d 100644
--- a/source/libads/kerberos.c
+++ b/source/libads/kerberos.c
@@ -515,7 +515,7 @@ char *kerberos_get_default_realm_from_ccache( void )
if (krb5_cc_get_principal(ctx, cc, princ)) {
DEBUG(0,(kerberos_get_default_realm_from_ccache: 
failed to get default principal\n));
-   goto done;
+   goto out;
}
 
 #if defined(HAVE_KRB5_PRINCIPAL_GET_REALM)
@@ -535,7 +535,7 @@ char *kerberos_get_default_realm_from_ccache( void )
if (ctx) {
krb5_free_context(ctx);
}
-done:
+
return realm;
 }
 


-- 
Samba Shared Repository