Re: [Samba] SAMBA as PDC - Pls Help!

2007-05-09 Thread Cristian Livadaru

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi, not quite sure if I understand your Problem, but I will answer  
your questions, maybe this will help.


On May 9, 2007, at 3:58 AM, chris reyes wrote:


Concerns  Questions:
1.  Do I need WINS  DNS to set SAMBAas PDC?


no


2.  I installed NetBeui and was able to ping the SAMBA PDC with its
NetBios name, without NetBeui I can only ping the IP but without the
NetBios name.
3.  I can also ping from Samba PDC the WinXP machine.
4.  I’ve already disabled the WinXP Personal Firewall Settings.
5.  The WinXP in the laptop is freshly installed with the default
workgroup membership as “WORKGROUP”


you have to tell windows that it belongs to a domain now. I have no  
windows machine here, but it should be something like this: right  
click on my computer, properties, computer name. then click on  
change, select domain and enter your new workgroup name and hit  
enter. The windows will ask a password, here it wants a Admin user  
from your samba PDC!



6.  The Samba PDC is supposedly be the Authentication, File and Print
server.


you will also need cups if you want to print.


7.  Pag nag “testparm” ako lahat naman ok at running


ehm... I don't understand this


8.  Am I missing something?



just try and see if it works :)

- --
Cristian Livadaru
http://livadaru.net



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFGQWn/J3lv8BSSgqARAsTQAKC/x4kTxEFq3Tw4c/Etxw/G8JRSOQCdGvB6
6jtAOrdgwmH/yrD+0+DGCVw=
=Smns
-END PGP SIGNATURE-
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Data missing in samba shares

2007-05-09 Thread Volker Lendecke
On Wed, May 09, 2007 at 11:07:58AM +0530, Rahul wrote:
 We are using windows XP professional as the client OS and the samba version
 is 3.0.x.

The x is interesting, as well as your smb.conf and a debug
level 10 log of smbd.

Volker


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

R: R: [Samba] LS not showing AD owner username and groupname

2007-05-09 Thread Gianluca Culot

 -Messaggio originale-
 Da: Gerald (Jerry) Carter [mailto:[EMAIL PROTECTED]
 Inviato: mercoledì 9 maggio 2007 0.21
 A: Gianluca Culot
 Cc: [EMAIL PROTECTED] Samba. Org
 Oggetto: Re: R: [Samba] LS not showing AD owner username and groupname


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Gianluca Culot wrote
 :
  wbinfo -i returns correct infos about AD users, and none for local users
  mail# /usr/local/etc/apache22  wbinfo -i user1
  user1:*:2144:1513:User One:/home/user1:/bin/csh
 
  But I have NO GETENT executable

  perl -e '@user = getpwnam(DOMAIN\\user); print @user\n;'





 cheers, jerry
 =
 Samba--- http://www.samba.org
 Centeris ---  http://www.centeris.com
 What man is a man who does not make the world better?  --Balian
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.6 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFGQPfGIR7qMdg1EfYRArBXAKCwdzHmigpI8JNbBOExtje80q4yJwCfQU31
 NoMpUfHFprKCE5hAoOur2HQ=
 =z093
 -END PGP SIGNATURE-


Thanks for the Hint...
as maybe you have understood...I'm not a pro !

so... again... I see no error at all !
mail# ~  perl -e '@user = getpwnam(DMSWARE\\robertasimula); print
@user\n;'
robertasimula * 2114 1513 0  Roberta Simula /home/robertasimula /bin/csh 0
mail# ~ 

and I've extended you suggestion with a call to getgrnam
mail# ~  perl -e '@user = getpwnam(MYDOMAIN\\user1); print @user\n;
@group = getgrnam(MYDOMAIN\\domain users); print @group\n;'
user1 * 2114 1513 0  User One /home/user1 /bin/csh 0
domain users x 1513 risrobot administrator
mail# ~ 

as far as I can see it is Perfect

I've checked every log file
/var/log/messages
/var/log/samba/*

no error, except if I try to get info about a non existing user or domain !

[2007/05/09 09:45:03, 1] nsswitch/winbindd_group.c:winbindd_getgrnam(259)
  group domain administrator in domain MYDOMAIN does not exist
[2007/05/09 09:45:06, 1] nsswitch/winbindd_group.c:winbindd_getgrnam(259)
  group domain administrators in domain MYDOMAIN does not exist


yet LS is NOT showing user name and user group in file listing... this is
not actually a problem for me (as i know groups by ID) but for other
people... who can make a mess when managing shares or others...


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


[Samba] HELP! running 3.0.23c-2 on fedora core 6 strange slow speed problem

2007-05-09 Thread Bill Fung

Hi

i have experience deploying samba for several sites. Recently, i encounter a 
very strange problem. The site has been running samba and
sendmail on a server since nov 2006 and everything is fine. At mid Apr 2007, i 
add a new network interface eth1 for some reason:

BEFORE CHANGE
=

 INTERNET
 ^
 |
||
| ADSL MODEM |
||
 ^
 |
||
|   ROUTER1  |
|| 192.168.1.1
 ^
 |
||---
|   SWITCH   |--- XP CLIENTS (192.168.1.0/255.255.255.0)
||---
 ^
 |
|| eth0:192.168.1.2
|   SAMBA|
||


AFTER CHANGE
=

 INTERNET
 ^
 |
||
| ADSL MODEM |
||
 ^
 |
||
|   ROUTER1  |
|| 192.168.1.1
 ^
 |
|| eth1:192.168.1.2
|   SAMBA|
|| eth0:192.168.2.2
 |
 v
||---
|   SWITCH   |--- XP CLIENTS (192.168.2.0/255.255.255.0)
||---
 |
 v
|| 192.168.2.1
|   ROUTER2  |
||
 |
 v
||
| ADSL MODEM |
||
 |
 v
 INTERNET (VPN to remote site 192.168.0.0/255.255.255.0)

Simply speaking, samba/vpn traffic will go thru eth0 and email/other traffic 
will go thru eth0.
After the change, i encounter that the following strange situation:

1) copying files from XP clients to samba server is OK (no speed change, copy a 
16mb file in less than 3 seconds)

2) copying files from samba share to XP clients is sometimes normal and 
somestimes very slow (copy a 16mb files take about 3 minutes), strange
enough, when in the progress of copying a large file (200mb), the traffic could 
be speed up by copying a smaller file (16mb) at the same time. In
this case, the 16mb file will be copied at normal speed (3second), and you 
could observe the progress indicator of the 200mb file is speed up
during the copying of 16mb file. The progress indicator of the 200mb file will 
slow down again after copying the 16mb file.

Below is the routing table:
Kernel IP routing table
Destination Gateway Genmask Flags Metric RefUse Iface
192.168.2.0 0.0.0.0 255.255.255.0   U 0  0   0 eth0 
192.168.1.0 0.0.0.0 255.255.255.0   U 0  0   0 eth1 
192.168.0.0 192.168.2.1 255.255.255.0   UG0  0   0 eth0 
169.254.0.0 0.0.0.0 255.255.0.0 U 0  0   0 eth1 
0.0.0.0 192.168.1.1 0.0.0.0 UG0  0   0 eth1


I add a specific route to remote site 192.168.0.0/255.255.255.0 thru vpn by 
/sbin/route add -net 192.168.0.0/24 gw 192.168.2.1 dev eth0

Here is what i try:
1) uninstall samba and install again, start newly install samba again with 
default config with minimal changes. problem persist!
2) replace switch with another new switch, problem persist!!
3) i start a ftp service on the samba server and verify the network speed is 
normal, implying that network card/switch has no problem

I guess the problem may be caused by:
1) routing problem
2) samba multiple interface problem
3) samba ip change from 192.168.1.2 to 192.168.2.2

For 2), I have man smb.conf and add the following to my smb.conf:
interfaces = 192.168.2.0/24
But problem still persist.

For 3), anyone have any hints on that? changing ip of samba server will cause 
problem??

Any help will be highly appreciated. Thanks a lot in advanced.



--
Regards,
Bill

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


Re: [Samba] Data missing in samba shares

2007-05-09 Thread Rahul

Sorry for not mentioning the correct samba version number. We are  Samba is
3.0.20. The server is running on linux kernel 2.6.9 and the basic hw
configuration is Pentium Dual Core,512 mb ram and 1TB Storage. We are mainly
storing large documents of nearly 2-5 GB size. Ya some files are there in
directories too. All the data is missing from some shares. Data is missing
from server too.


On 5/9/07, Volker Lendecke [EMAIL PROTECTED] wrote:


On Wed, May 09, 2007 at 11:07:58AM +0530, Rahul wrote:
 We are using windows XP professional as the client OS and the samba
version
 is 3.0.x.

The x is interesting, as well as your smb.conf and a debug
level 10 log of smbd.

Volker





--
regards,
Rahul Sahadevan
SANAT Technologies
(Intel Storage Community member)
http://www.sanatdata.net
mob : 09884
423254
 
 Dont tell people your problems ...
 70% dont care and other 30% are glad!!
 
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Data missing in samba shares

2007-05-09 Thread Volker Lendecke
On Wed, May 09, 2007 at 03:55:01PM +0530, Rahul wrote:
 Sorry for not mentioning the correct samba version number. We are  Samba is
 3.0.20. The server is running on linux kernel 2.6.9 and the basic hw
 configuration is Pentium Dual Core,512 mb ram and 1TB Storage. We are mainly
 storing large documents of nearly 2-5 GB size. Ya some files are there in
 directories too. All the data is missing from some shares. Data is missing
 from server too.

Then this is not a Samba bug. You might dig up your backup
tapes, after you've done a fsck on the file system.

Volker


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

Re: [Samba] Data missing in samba shares

2007-05-09 Thread Rahul

Yeah we got the solution, in the server some of the shares were not mounted,
thats why we were not able to see the contents . But i dont know what
happened on reboot that these shares were
unmounted. Anyhow the issue is solved :-)


On 5/9/07, Volker Lendecke [EMAIL PROTECTED] wrote:


On Wed, May 09, 2007 at 03:55:01PM +0530, Rahul wrote:
 Sorry for not mentioning the correct samba version number. We are  Samba
is
 3.0.20. The server is running on linux kernel 2.6.9 and the basic hw
 configuration is Pentium Dual Core,512 mb ram and 1TB Storage. We are
mainly
 storing large documents of nearly 2-5 GB size. Ya some files are there
in
 directories too. All the data is missing from some shares. Data is
missing
 from server too.

Then this is not a Samba bug. You might dig up your backup
tapes, after you've done a fsck on the file system.

Volker





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


[Samba] log file format

2007-05-09 Thread Rahul

Hi list,
  Issue regarding the samba log files. In the samba configuration
file Global settings i have the parameter to
get log files of particular samba shares in the share_name.log format. For
that i have given the parameter as
   log file = /var/log/%S.log
According to the docs the log files will be generated for particular shares
in the /var/log and for %S the sharename has to come.
But for us its showing as %S.log itself. We have tried with %m and %U which
is replaced with the machine netbios name and the samba
username respectively.
Can anybody tell me why its not working with %S? Or i have to do something
more to get it work?
I am attaching Global Settings part of the samba configuration file here,

[global]
   server string=sanat server
   netbios name=sanat
   wins server=192.168.0.1
   log level=2
   security=user
   encrypt passwords=yes
   socket options=TCP_NODELAY
   read raw=yes
   write raw=yes
   oplocks=no
   level2 oplocks=no
   template shell=/bin/false
   unix extensions=no
   directory mask=0770
   create mask=0770
   veto
files=/aquota.group/aquota.user/lost+found/.owner*/quota.user/quota.group/
   root preexec=/usr/local/samba/bin/smb-preexec '%S' '%I' '%U' '%a'
'%T'
   root preexec close=Yes
   root postexec=/usr/local/samba/bin/smb-postexec '%S' '%I' '%U' '%a'
'%T'
   log file = /var/log/%S.log


Thanks in advance.
--
regards,
Rahul
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] nsswitch wins reverse lookup

2007-05-09 Thread Peter Eser
For all interested:
We solved the issue for us with patching nsswitch/wins.c
Seems there is no gethostbyaddr support in the original (why not?).
Found an old solaris patch (lost the name originator) and modified it to run
with 3.0.24 for our purposes.

Here's the patch, mainly the new function  _nss_wins_gethostbyaddr_r against
3.0.24:

*** nsswitch/wins.c.org 2007-05-08 08:51:30.0 +0200
+++ nsswitch/wins.c 2007-05-08 11:42:14.0 +0200
@@ -125,8 +125,6 @@
  return ret;
 }

-#ifdef HAVE_NS_API_H
-
 static NODE_STATUS_STRUCT *lookup_byaddr_backend(char *addr, int *count)
 {
  int fd;
@@ -150,6 +148,8 @@
  return status;
 }

+#ifdef HAVE_NS_API_H
+
 /* IRIX version */

 int init(void)
@@ -375,4 +375,105 @@
  return _nss_wins_gethostbyname_r(
   name, he, buffer, buflen, h_errnop);
 }
+
+
/***
*
+  gethostbyaddr()
+
**/
+  NSS_STATUS
+  _nss_wins_gethostbyaddr_r(const char *addr, int length, int type,
+   struct hostent *he, char *buffer, size_t buflen,
+   int *errnop, int *h_errnop)
+  {
+   enum { AddressStringSize = 16 };
+   char **host_addresses, **host_aliases;
+   char address_string[AddressStringSize];
+   NODE_STATUS_STRUCT *status;
+   int i, rc, count, true_count;
+   size_t namelen;
+
+   memset(he, '\0', sizeof(*he));
+
+   /* I don't think you can do WINS over IPV6 - fv */
+   if (length != INADDRSZ || type != AF_INET) {
+return NSS_STATUS_NOTFOUND;
+   }
+
+   rc = snprintf(address_string, AddressStringSize, %d.%d.%d.%d,
+(uchar) addr[0], (uchar) addr[1], (uchar) addr[2],
+(uchar) addr[3]);
+   if (rc  0 || rc  AddressStringSize) {
+return NSS_STATUS_NOTFOUND;
+   }
+
+   status = lookup_byaddr_backend(address_string, count);
+   if (!status) {
+return NSS_STATUS_NOTFOUND;
+   }
+
+   true_count = 0;
+   for (i=0;icount;i++) {
+/* ignore group names */
+if (status[i].flags  0x80 || !(status[i].type == 0x20 ||
status[i].type == 0x00 ) ) continue;
+++true_count;
+   }
+
+   if (true_count  1) {
+return NSS_STATUS_NOTFOUND;
+   }
+   if (buflen  (true_count+3)*INADDRSZ) {
+/* no ENOMEM error type?! */
+return NSS_STATUS_NOTFOUND;
+   }
+   host_addresses = (char **)buffer;
+   he-h_addr_list = host_addresses;
+   buffer += 2 * INADDRSZ;
+   buflen -= 2 * INADDRSZ;
+   host_addresses[0] = buffer;
+   host_addresses[1] = NULL;
+   memcpy(buffer, addr, INADDRSZ);
+   buffer += INADDRSZ;
+   buflen -= INADDRSZ;
+   he-h_addrtype = AF_INET;
+   he-h_length = INADDRSZ;
+
+   if (true_count == 1) {
+he-h_aliases = host_addresses + 1;
+   } else {
+host_aliases = (char **)buffer;
+he-h_aliases = host_aliases;
+host_aliases[true_count-1] = NULL;
+buffer += true_count * INADDRSZ;
+buflen -= true_count * INADDRSZ;
+   }
+
+   true_count = 0;
+   for (i=0;icount;i++) {
+/* ignore group names */
+if (status[i].flags  0x80 || !(status[i].type == 0x20 ||
status[i].type == 0x00 ) ) continue;
+/* assume first name is 'canonical' name */
+if (true_count == 0) {
+ he-h_name = buffer;
+} else {
+ *host_aliases = buffer;
+ host_aliases++;
+}
+namelen = strlen(status[i].name);
+if (buflen  namelen + 1) {
+ /* no ENOMEM error type?! */
+ return NSS_STATUS_NOTFOUND;
+}
+memcpy(buffer, status[i].name, namelen);
+buffer += namelen;
+*buffer = '\0';
+buffer++;
+buflen -= namelen + 1;
+true_count++;
+   }
+
+   if (status)
+free(status);
+
+   return NSS_STATUS_SUCCESS;
+  }
+
 #endif


Take care!!
The if:   (status[i].flags  0x80 || !(status[i].type == 0x20 ||
status[i].type == 0x00 ) )
is modified for our purposes by try and error, I don't know what flags and
type
would be the correct ones (I think they come from windows (e.g. NetBios
Client type=)?).

Perhaps it helps someone






 Nobody an idea, need more information from me?

 Getting reverse lookups to work is important for me.
 Has somebody reverse lookups over wins working?

 Many thanks


 I don't get reverse lookups (gethostbyaddr) over winbind wins to work.
 Normal lookups work and also wbinfo -I gives back a netbios name for an
IP.
 
 my entry in nsswitch.conf is  hosts:  files dns wins
 (dns reverse lookups ar ok)
 
 The wins server is also samba and runs on another server.
 
 Many thanks for any help...

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


[Samba] Samba PDC, OpenLDAP: net groupmap list and Login doesnt work

2007-05-09 Thread Jens Schmidt
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello List,

after i installed Samba and the OpenLDAP, i configured this Team with
some Howtos in the internet.

So, now i populated the data into the LDAP with
$ smbldap-populate -u 1550 -g 1500
which worked well.

Now i can see groups and users and machines in the LDAP Database.

Then i added a new Testuser with smbldap-useradd -m -a jens (which i
can see in the database, too).

But if i want to connect over ssh or to the Samba i get a error messages
permission denied.

Then i want to try to list the groupmaps and get the following error:

[EMAIL PROTECTED] ~# net groupmap list
[2007/05/09 14:41:44, 0] passdb/pdb_ldap.c:ldapsam_setsamgrent(3051)
  ldapsam_setsamgrent: LDAP search failed: No such object
[2007/05/09 14:41:44, 0] passdb/pdb_ldap.c:ldapsam_enum_group_mapping(3123)
  ldapsam_enum_group_mapping: Unable to open passdb
[EMAIL PROTECTED] ~#

Can Anyone help me, with that Problem? I think, if i can solve this
error message, i get closer to the permission denied problem  :-) .

Thanks in advance.

Jens
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBRkHDa4nNy9K3Yw0FAQIjtxAAg9yOUVxDxSHq3M9Lhdtm5DDxtwSpbjaS
J3DbNqZE3M6N4Ld+ymf85zL2bip93mhZ4o+Vw+L3Qp9ArOKmp/GisOPyWKhFrKU5
IKPZDi1JwqrvX9x33wQ615CVu7UR7PFN8oqarSXJaUoqE6kcWGUO0cLJNUz5TW1J
mcvFP8HxDKKjOgCn+k/DBT1lio0a+ShEiZUkWx9AqQFqEPXKwl+QcrDEY2l/9N/J
YDpSw6StZKalys1I5K1E49FYzuYKgXoTPqsXr+fGhuwUPadk6xEwy+NV9oKlHgT6
OE7WWKsy/guhgUpH8y5VZch5QQydJZ0NEjrCPjQ7A/zxFyFIEBrLGUA/kOJXm+q0
no4nSg6HqLaz+Sim+F9+EB6K0S/9NgdTztqQSPxOfHplwscjeJkjpzJ5uMEFQDEa
6Luqs3DwGzeyEMOGxJ/aoRpYrMRLFj6/hP6X376pAy4nkFWtjMlhmaR/Dk0ZfFy1
6OSA3mrCHT2j25MwX1SGY7Abj6iUcjAKrGwkKAn6TRLYU8sgVVFLWoE8Tbe84xrz
fsPWXF/pKTCxuGJJ3bDiaH9BOf/CZdwpRVrua/+30UXm5JCI1odVs/oZGd+eoAzt
1g5EiRm8WDxENdndo4ctuRL+b4hqCOqDGCzy6fR8Uo8N/buHvjZjzcQfmJq54o8B
WHB+pPszfZQ=
=cHPl
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Unexpected feature (success!) re Roaming Profiles

2007-05-09 Thread Stefan Winter
Hello list,

I'm currently replacing a NT4 stand-alone with a Samba-3.0.24 implementation. 
I faced some tough hours trying to mimic a rather peculiar setting in the NT4 
domain: some users had Roaming Profiles, while others hadn't. But this Local 
vs. Roam was NOT specified on the client device, but pushed from the NT4 
server. So the box in User Profiles where one can usually select whether the 
roaming or a local profile is to be used was grayed out for the local-only 
users.

This is a desirable situation in our company: some secreteriat girls jump from 
computer to computer and NEED a romaing profile, while engineers sit at PC 
and Notebook simultaneously and fear inconsistent profiles when both devices 
simultaneously access their same roaming profile.

The problem I faced was that I saw no easy way to mimic that in Samba. The 
official HOWTO mentioned that Roaming Profiles are a global setting, and that 
disabling it can only be done by editing registry keys on the clients - no 
auto-disabling from server-side.

By coincidence, I found that when one uses pdbedit to

pdbedit -u whatever --profile=

then at least Windows XP SP2 treats this empty string at logon time as user 
is not eligible for roaming profile, automatically uses a local profile and 
grays out the ability to switch to roaming - all this without error messages, 
meaning that this is somehow an intended behaviour.

The HOWTO doesn't mention this explicitly, and also the man page of pdbedit 
only mentions you can change the profile path - not the corner case described 
above.

I found it quite cool that this actually works, and wanted to say thank you to 
all the developers here - and for the community, would like to request that 
the documentation is updated in that respect, so that others can profit of 
this nice feature of selectively disabling Roaming Profiles for some users, 
while by default allowing them.

Happy greetings,

Stefan Winter

P.S.: NT4 is about to die here :-)

-- 
Stefan WINTER

Stiftung RESTENA - Réseau Téléinformatique de l'Education Nationale et de 
la Recherche
Ingenieur Forschung  Entwicklung

6, rue Richard Coudenhove-Kalergi
L-1359 Luxembourg
E-Mail: [EMAIL PROTECTED]     Tel.:     +352 424409-1
http://www.restena.lu                Fax:      +352 422473


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

Re: [Samba] log file format

2007-05-09 Thread Gerald (Jerry) Carter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rahul wrote:

 Can anybody tell me why its not working with %S? 

%S is only valid within the context of a share connection.



cheers, jerry
=
Samba--- http://www.samba.org
Centeris ---  http://www.centeris.com
What man is a man who does not make the world better?  --Balian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGQcdrIR7qMdg1EfYRAt4TAKCLcAyQ7+RjNtnElFM8XtTbP3HznACfY9D1
DjDFo2Rj907SH3xXrabmsVg=
=cSUN
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] nsswitch wins reverse lookup

2007-05-09 Thread Gerald (Jerry) Carter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Peter Eser wrote:
 For all interested:
 We solved the issue for us with patching nsswitch/wins.c
 Seems there is no gethostbyaddr support in the original (why not?).
 Found an old solaris patch (lost the name originator) and modified it to run
 with 3.0.24 for our purposes.
 
 Here's the patch, mainly the new function  _nss_wins_gethostbyaddr_r against
 3.0.24:


Peter,

In the future, please include patches as attachments (inline
munges the formatting).  If you don't mind, please file a bug
at https://bugzilla.samba.org/ and attach this patch to it.
Thanks.





cheers, jerry
=
Samba--- http://www.samba.org
Centeris ---  http://www.centeris.com
What man is a man who does not make the world better?  --Balian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGQcfjIR7qMdg1EfYRAii6AJwMALp2B7nsjPFMl0IEvzhgO4Y6vgCg2mBc
kBCRuh9VGoP0w0W/qJoZmIQ=
=8Wtu
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] -s file permission flag

2007-05-09 Thread David Durham, Jr.

I'm new samba user, and new to this list.  I have a fs mount to a
windows share from Ubuntu 7.0.4.   Samba version looks like 3.  When I
copy files I get file permissions like this:

 -rwxr-Sr-t

I'm not familiar with the S and t flags.  Will someone kindly point me
to some documentation about them.  Also, is there a recommended
searchable archive of this list?

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


Fwd: [Samba] -s file permission flag

2007-05-09 Thread John Drescher

-- Forwarded message --
From: John Drescher [EMAIL PROTECTED]
Date: May 9, 2007 10:24 AM
Subject: Re: [Samba] -s file permission flag
To: David Durham, Jr. [EMAIL PROTECTED]


On 5/9/07, David Durham, Jr. [EMAIL PROTECTED] wrote:

I'm new samba user, and new to this list.  I have a fs mount to a
windows share from Ubuntu 7.0.4.   Samba version looks like 3.  When I
copy files I get file permissions like this:

  -rwxr-Sr-t

I'm not familiar with the S and t flags.  Will someone kindly point me
to some documentation about them.  Also, is there a recommended
searchable archive of this list?


See here:

http://www.greenend.org.uk/rjk/2004/perms.html

John


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


[Samba] tree connect failed: Call returned zero bytes (EOF)

2007-05-09 Thread Chris Rogers
I am having trouble getting samba 3.0.24 to work with FC6. I currently 
have Samba 3.0.10 running on SL4.4 with no problems
if I check the smb service both smbd and nmbd are running but when I try 
smbclient -L localhost -U% I get the following:


Domain=[EARTHTEST] OS=[Unix] Server=[Samba 3.0.24-4.fc6]
tree connect failed: Call returned zero bytes (EOF).

Most google searches have not turned up anything helpful.

Most (removed shares) of my smb.conf settings are below.
[global]
  workgroup = EARTHTEST
  server string = Samba Server
  security = user
  hosts allow = 192.168.2. 134.117.32. 127.
  load printers = yes
cups options = raw
  log file = /var/log/samba/%m.log
interfaces = 192.168.2.169/24 134.117.32.169/24
  os level = 65
  domain master = yes
  preferred master = yes
  domain logons = yes
  wins support = yes



--
Chris Rogers
Computing Specialist, Earth Science and Biology
Carleton University, Ottawa. Ontario
2102 Herzberg Building
Ph (613) 520 2600 ext. 1847
Fax (613) 520-2569
[EMAIL PROTECTED]

Earth Sciences Website
http://www.earthsci.carleton.ca

Earth Sciences Tech Support Website
http://www.earthsci.carleton.ca/support

Poor planning on your part does not constitute an emergency on mine...


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


Re: R: R: [Samba] LS not showing AD owner username and groupname

2007-05-09 Thread Gerald (Jerry) Carter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Gianluca Culot wrote:

 Thanks for the Hint...
 as maybe you have understood...I'm not a pro !

 so... again... I see no error at all !
 mail# ~  perl -e '@user = getpwnam(DMSWARE\\robertasimula); print
 @user\n;'
 robertasimula * 2114 1513 0  Roberta Simula /home/robertasimula /bin/csh 0
 mail# ~ 

 and I've extended you suggestion with a call to getgrnam
 mail# ~  perl -e '@user = getpwnam(MYDOMAIN\\user1); print @user\n;
 @group = getgrnam(MYDOMAIN\\domain users); print @group\n;'
 user1 * 2114 1513 0  User One /home/user1 /bin/csh 0
 domain users x 1513 risrobot administrator
 mail# ~ 

What about perl -e '@user = getpwuid(10); print @user\n;
Same pricipal as getgrgid().





cheers, jerry
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGQfQJIR7qMdg1EfYRAoD1AJ91JpSIkTUNal9TBqtDUYKPS8piDQCg0lcl
HL0ESmRPxRMWbEEgPOeBe74=
=2DHg
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


R: R: R: [Samba] LS not showing AD owner username and groupname

2007-05-09 Thread Gianluca Culot

 -Messaggio originale-
 Da: Gerald (Jerry) Carter [mailto:[EMAIL PROTECTED]
 Inviato: mercoledì 9 maggio 2007 18.17
 A: Gianluca Culot
 Cc: [EMAIL PROTECTED] Samba. Org
 Oggetto: Re: R: R: [Samba] LS not showing AD owner username and
 groupname


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Gianluca Culot wrote:

  Thanks for the Hint...
  as maybe you have understood...I'm not a pro !

  so... again... I see no error at all !
  mail# ~  perl -e '@user = getpwnam(DMSWARE\\robertasimula); print
  @user\n;'
  robertasimula * 2114 1513 0  Roberta Simula /home/robertasimula
 /bin/csh 0
  mail# ~ 

  and I've extended you suggestion with a call to getgrnam
  mail# ~  perl -e '@user = getpwnam(MYDOMAIN\\user1); print @user\n;
  @group = getgrnam(MYDOMAIN\\domain users); print @group\n;'
  user1 * 2114 1513 0  User One /home/user1 /bin/csh 0
  domain users x 1513 risrobot administrator
  mail# ~ 

 What about perl -e '@user = getpwuid(10); print @user\n;
 Same pricipal as getgrgid().





 cheers, jerry
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.6 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFGQfQJIR7qMdg1EfYRAoD1AJ91JpSIkTUNal9TBqtDUYKPS8piDQCg0lcl
 HL0ESmRPxRMWbEEgPOeBe74=
 =2DHg
 -END PGP SIGNATURE-


well this

mail# ~  perl -e '@user = getpwuid(10); print @user\n;'

give
empty line
as result
Same getgrgid

could be my UID database for samba is corrupted ?
I've upgraded from 14b... and something in configuration changed.
but I supposed samba would adjust automatically UIDs and that eventually I'd
change the ownership of hoem directories for my email users

well
thanks A LOT for your great helping.
I banged my head on this problem for whole day long and learned a lot about
samba...
I'll resume tomorrow (Central Europe Time)

Thanks
Gianluca


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


Re: [Samba] TDB functionality document

2007-05-09 Thread Aravinda Guzzar

Hi Simo,

Thanks for the information, the information was indeed very helpful.

I have asked this questin in the samba-technical lists too.

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


Re: [Samba] Possible problem w/ 'idmap restore' under 3.0.25rc3

2007-05-09 Thread simo
On Fri, 2007-05-04 at 19:14 -0500, Don Meyer wrote:
 At 06:00 PM 5/4/2007, simo wrote:
 Sorry for the problem, this slipped through during recent patches to fix
 the sid checking layer violation and the idmap offline code.
 
 
 No problem.
 
 I may have another for you, however.   This patch enables me to 
 successfully restore when using a tdb backend.  However, when using 
 idmap_ldap, it seems that winbind is opening a connection to the ldap 
 server and not closing it for many updates/queries.
 
 When I try 'net idmap restore' when using idmap_ldap, the command 
 will plug away until the ldap server starts complaining accept(8) 
 failed errno=24 (Too many open files).   netstat -aln shows around 
 1000 open connections from winbind on another system. (The one with 
 3.0.25rc3+)

Found the problem, see patch for revision 22771.
Another one-liner :/

Thanks again for testing rc3 out.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: [EMAIL PROTECTED]
http://samba.org

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


[Samba] Newbie User Migration Questions

2007-05-09 Thread Mike Rushton


OK,  As I plan and plot this migration .  This is what I think I wanna 
try to do.   What do you thing of this - 
Our old NT server, has a Domain called Engineering.   We were not 
retiring users, because in NT, if you retire a user you can never use it 
again.  So when we retired  jones for Susie Jones, when Tom Jones  was 
hired we could not use jones as a user again.  So we had to make  user 
like tjones or jonest or jones1.

When someone would leave we would just disable the account.
We really never got into the roaming profiles or groups for that 
matter.  I see that there are migration tools, but if we have 50 users 
that must authenticate, that is a high estimate.


What I want to do is get the Linux/Samba box running, and maybe make a 
new domain, lets say Corporate.  Because the users are all screwed up 
and I don't want to import all of them, I guess I could create them on 
this new machine.
From what I read, I would have to add the user to unix, add the user to 
Samba, and if the machine is Win2k or XP,  add the machine to the 
domain.   Then I would move everyone over to this new domain. 
The old NT PDC has DHCP on it, excluding likethe first 75 ip's for the 
servers.  I would have to set up DHCP the same way on the new server and 
disable it on the old one.

Does this sound logical ???
We have a real, fussy application running on the old server, that I 
really can not change, nor change the client on the workstations - all 
of the stuff is written into the registry - we don't have support so I 
want to leave it on the old server until we can convert.


We just may be able to pull this off.I never liked Microsoft's 
support.We may be better off on Linux or Unix.


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


[Samba] revalidate User

2007-05-09 Thread Carlos Gomez Gomez Brizulela

i hava a samba 3.0.22 under ubuntu and revalidate parameter dont work.

i need revalidate e user authentication in some shared resource.

sorry my english

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


[Samba] samba doesn't map to guest account

2007-05-09 Thread Michael Nice
Hi group,

now after 6 hours non-stop trying to solve this issue I decided to
contact the list!
I actually just want to mount an samba share as guest via mount -t cifs
..., but I alway get a mount error 13 = Permission denied.

I tried the following (and many else)

  mount -t cifs //172.16.0.3/ebooks /mnt/ebooks -o guest
  mount -t cifs //172.16.0.3/ebooks /mnt/ebooks -o
user=someuser,password=somepass

(both also with the sec options none,ntlm,ntlmi,ntlmv2,ntlmv2i or smbfs
instead of cifs) and always got mount error 13 = Permission denied. I
just wanted samba to map me to the guest-account but it wouldn't


I then tried

  mount -t cifs //172.16.0.3/ebooks /mnt/ebooks -o
user=realuser,password=realpass

(where realuser is a privileged user that really exists) and it worked!!


I also tried

  mount -t cifs //172.16.0.3/upload /mnt/ebooks -o guest

(where 'upload' has a force user/group option set. Look below in
smb.conf) and it worked!! Yes, it mapped me to the right account!!


But no matter what I did SAMBA-WON'T-MAP-MY-ACCOUNT-TO-GUEST on other
shares than upload!!!


Btw: I can connect with a windows-client and I can connect with
smbclient and it works like a charm - which makes me much more confused ?:-(

Is this a general issue or am i just too stupid to find the solution??


Greetz,

M i c h a e l




CLIENT-SIDE:
gentoo 2.6.20-gentoo-r7
mount.cifs version: 1.10-3.0.24


SERVER-SIDE:
gentoo 2.6.19-gentoo-r5
samba v3.0.24

--- smb.conf ---
[global]
workgroup = GALLIA
netbios name = Asterix
server string = Asterix
log file = /var/log/samba/log.%m
log level = 3 passdb:10 auth:1 winbind:2
max log size = 50
hosts allow = 172.16.0. 192.168.
guest account = smbguest
map to guest = bad user
security = user
encrypt passwords = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = no
hide dot files = no
domain master = no
domain logons = no
preferred master = no
oplocks = no
display charset = UTF-8
unix charset = UTF-8

[ebooks]
comment = eBook Directory
path = /samba/ebooks
public = yes
writeable = no
write list = @smbroot
force group = +smbroot
directory mask = 0775
create mask = 0664

[upload]
comment = Upload Directory
path = /samba/upload
public = yes
writeable = yes
force user = smbguest
force group = smbguest
directory mask = 0775
create mask = 0664

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


Re: [Samba] HELP! running 3.0.23c-2 on fedora core 6 strange slow speed problem

2007-05-09 Thread Bill Fung

Hi,

I remove the new added network interface eth1 yesterday and problem persist:

LATEST CHANGE
=

INTERNET
^
|
||
| ADSL MODEM |
||
^
|
||
|   ROUTER1  |
|| 192.168.2.254
^
|
|  ||
|  |   SAMBA|
|  || eth0:192.168.2.2
| /
|/
||---
|   SWITCH   |--- XP CLIENTS (192.168.2.0/255.255.255.0)
||---
|
v
|| 192.168.2.1
|   ROUTER2  |
||
|
v
||
| ADSL MODEM |
||
|
v
INTERNET (VPN to remote site 192.168.0.0/255.255.255.0)

Now, all traffic all thru eth0, routing table as follow:
Kernel IP routing table
Destination Gateway Genmask Flags Metric RefUse 
Iface

192.168.2.0 0.0.0.0 255.255.255.0   U 0  00 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0  00 eth0
0.0.0.0 192.168.2.254   0.0.0.0 UG0  00 eth0

Let me repeat the problem:
1) copying files from XP clients to samba server is OK (no speed change, 
copy a 16mb file in less than 3 seconds)
2) copying files from samba share to XP clients is sometimes normal and 
sometimes very slow (copy a 16mb files take about 3 minutes), strange 
enough, when in the progress of copying a large file (200mb), the 
traffic could be SPEED UP by copying a smaller file (16mb) at the same 
time. In this case, the 16mb file will be copied at normal speed 
(3second), and you could observe the progress indicator of the 200mb 
file is speed up during the copying of 16mb file. The progress indicator 
of the 200mb file will slow down again after copying the 16mb file.


I figure out:
1) not hardware problem - because ftp to samba server is fast and switch 
has been replaced

2) not routing now - because there is only 1 network card is installed now

I try yesterday:
1) change samba server ip from 192.168.2.2 to 192.168.1.2 (like before) 
and problem persist.

2) remark the vscan-clamav option and problem persist.

I will try to uninstall the samba and install again today to see if it 
helps... really strange problem. Anyone encounter before?

I forget to give the background:
samba-3.0.23c-2
kernel 2.6.20-1.2944.fc6
below is testparm result:
Load smb config files from /etc/samba/smb.conf
Processing section [homes]
Processing section [netlogon]
Processing section [publictemp]
Processing section [management]
Processing section [photo]
Processing section [account]
Processing section [alldata]
Loaded services file OK.
Server role: ROLE_DOMAIN_PDC
Press enter to see a dump of your service definitions

[global]
   unix charset = BIG5
   workgroup = GROUPX
   server string = File Server
   update encrypted = Yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *New*UNIX*password* %n\n 
*ReType*new*UNIX*password* %n\n 
*passwd:*all*authentication*tokens*updated*successfully*

   passwd chat debug = Yes
   unix password sync = Yes
   log level = 3 passdb:5 auth:10 winbind:2
   log file = /var/log/samba/%m.log
   add user script = /usr/sbin/useradd %u
   delete user script = /usr/sbin/userdel %u
   add group script = /usr/sbin/groupadd %g
   delete group script = /usr/sbin/groupdel %g
   delete user from group script = /usr/sbin/deluser %u %g
   add machine script = /usr/sbin/adduser -n -g machines -c Machine 
-d /dev/null -s /bin/false %u

   logon script = user.bat
   logon path =
   logon home =
   domain logons = Yes
   os level = 99
   preferred master = Yes
   domain master = Yes
   dns proxy = No
   wins support = Yes
   hosts allow = 192.168.0., 192.168.1., 192.168.2., 192.168.3., 127.
   cups options = raw

[homes]
   comment = Home Directories
   path = /sambahome/%S
   valid users = %S
   read only = No
   create mask = 0755
   browseable = No
   vfs objects = vscan-clamav
   vscan-clamav:config-file = /etc/samba/vscan-clamav.conf

[netlogon]
   comment = Network Logon Service
   path = /sambahome/netlogon
   guest ok = Yes
   share modes = No
   vfs objects = vscan-clamav
   vscan-clamav:config-file = /etc/samba/vscan-clamav.conf

[publictemp]
   comment = Public Stuff
   path = /sambahome/public
   read only = No
   guest only = Yes
   guest ok = Yes
   vfs objects = vscan-clamav
   vscan-clamav:config-file = /etc/samba/vscan-clamav.conf


--
Regards,
Bill

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


[Samba] Samba domain clients take too long to log in

2007-05-09 Thread rolandpish

Hi there,
I have a Samba+LDAP Debian box as a primary domain controller.
I configured the server in order to support roaming profiles.

Everything is working perfectly. Roaming profiles are loaded and
saved correctly from the server for every user on the domain.
The big problem is this: after typing username and password from
a Windows XP client computer, it starts reading the profile from the
samba server; it says: loading settings, then it says: applying settings,
then it becomes stalled, and after about 2 minutes the computer starts
to load the desktop.

I have these packages installed: dhcp3-server, bind9, openldap (and required
packages as libnss-ldap, libpam-ldap, etc) and samba server.
Do I need something else (a package or configuration) in order to
avoid this?
Why do clients last too much before the Windows desktop is ready to use?

I would really appreciate your help because I have days fighting with this
and I have mad users at me and I don't know what to do.

Best Regards

Just in case, this is my smb.conf:

# /etc/samba/smb.conf
# samba configuration file

[global]
workgroup = linuxnet
netbios name = smbserver
server string = Samba PDC Version %v
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192 SO_RCVBUF=8192

os level = 65
preferred master = yes
local master = yes
domain master = yes
domain logons = yes

security = user
guest ok = no
encrypt passwords = yes
null passwords = no
hosts allow = 127.0.0.1 192.168.2.0/255.255.255.0
# NOTE: I had to disable wins support because clients weren't able
# to join the domain. Once I disabled wins support clients joined the
# domain succesfully
#name resolve order = wins lmhosts host bcast
#wins support = yes
#dns proxy = no

time server = yes

log file = /var/log/samba/log.%m
log level = 2
max log size = 50
hide unreadable = yes
hide dot files = yes

# LDAP
passdb backend = ldapsam:ldap://127.0.0.1
ldap suffix = dc=linuxnet
ldap machine suffix = ou=machines
ldap user suffix = ou=users
ldap group suffix = ou=groups
ldap admin dn = cn=admin,dc=linuxnet
ldap delete dn = no
enable privileges = yes
ldap password sync = yes

# roaming profiles
logon home = \\%L\%U\.profile
logon drive = H:
logon path = \\%L\profiles\%U
logon script = netlogon.bat OR %U.bat

add machine script = /usr/sbin/smbldap-useradd -w %u

#=== SAMBA SHARES ===

[netlogon]
path = /home/samba/netlogon
guest ok = no
read only = yes
browseable = no

[homes]
path = /home/users/%U
comment = HOME Folders
browseable = no
writeable = yes
valid users = %S
read only = no
guest ok = no
inherit permissions = yes

[profiles]
path = /home/samba/profiles
read only = no
writeable = yes
browseable = no
guest ok = no
hide files = /desktop.ini/ntuser.ini/NTUSER.*/
create mask = 0600
directory mask = 0700
csc policy = disable
profile acls = yes
-- 
View this message in context: 
http://www.nabble.com/Samba-domain-clients-take-too-long-to-log-in-tf3719763.html#a10407396
Sent from the Samba - General mailing list archive at Nabble.com.

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


Rev 12124: Get rid of a couple more references to global_params. in file:///home/jelmer/bzr.samba/SAMBA_4_0/

2007-05-09 Thread Jelmer Vernooij
At file:///home/jelmer/bzr.samba/SAMBA_4_0/


revno: 12124
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: SAMBA_4_0
timestamp: Wed 2007-05-09 12:46:52 +0200
message:
  Get rid of a couple more references to global_params.
modified:
  source/param/loadparm.csvn-v2:[EMAIL PROTECTED]
=== modified file 'source/param/loadparm.c'
--- a/source/param/loadparm.c   2007-05-09 01:11:50 +
+++ b/source/param/loadparm.c   2007-05-09 10:46:52 +
@@ -10,6 +10,7 @@
Copyright (C) Stefan (metze) Metzmacher 2002
Copyright (C) Jim McDonough ([EMAIL PROTECTED])  2003.
Copyright (C) James Myers 2003 [EMAIL PROTECTED]
+   Copyright (C) Jelmer Vernooij 2007 [EMAIL PROTECTED]

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -64,13 +65,11 @@
 #include lib/util/dlinklist.h
 #include param/loadparm.h
 
-static BOOL bLoaded = false;
-
 #define standard_sub_basic(str,len)
 
 /* some helpful bits */
-#define LP_SNUM_OK(i) (((i) = 0)  ((i)  global_params.iNumServices)  
global_params.ServicePtrs[(i)]-valid)
-#define VALID(i) global_params.ServicePtrs[i]-valid
+#define LP_SNUM_OK(ctx, i) (((i) = 0)  ((i)  (ctx)-iNumServices)  
(ctx)-ServicePtrs[(i)]-valid)
+#define VALID(ctx, i) ctx-ServicePtrs[i]-valid
 
 static BOOL do_parameter_var(struct loadparm_context *, 
 const char 
*pszParmName, const char *fmt, ...);
@@ -103,7 +102,6 @@
char *szPidDir;
char *szSetupDir;
char *szServerString;
-   char *szAutoServices;
char *szPasswdChat;
char *szConfigFile;
char *szShareBackend;
@@ -255,15 +253,15 @@
True,   /* bAvailable */
True,   /* bBrowseable */
True,   /* bRead_only */
-   False,  /* bPrint_ok */
-   False,  /* bMap_system */
-   False,  /* bMap_hidden */
+   false,  /* bPrint_ok */
+   false,  /* bMap_system */
+   false,  /* bMap_hidden */
True,   /* bMap_archive */
True,   /* bStrictLocking */
NULL,   /* copymap */
-   False,  /* bMSDfsRoot */
-   False,  /* bStrictSync */
-   False,  /* bCIFileSystem */
+   false,  /* bMSDfsRoot */
+   false,  /* bStrictSync */
+   false,  /* bCIFileSystem */
NULL,   /* Parametric options */
 
  /* dummy */
@@ -276,11 +274,20 @@
 struct loadparm_context {
int iNumServices;
service **ServicePtrs;
+   
+   /* Files used by this loadparm context */
+   struct file_lists {
+   struct file_lists *next;
+   char *name;
+   char *subfname;
+   time_t modtime;
+   } *file_lists;
 };
 
 struct loadparm_context global_params = {
.iNumServices = 0,
.ServicePtrs = NULL,
+   .file_lists = NULL,
 };
 
 #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
@@ -539,8 +546,6 @@

{config file, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szConfigFile), NULL, 
NULL, FLAG_HIDE},
{share backend, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szShareBackend), 
NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
-   {preload, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szAutoServices), NULL, 
NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
-   {auto services, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szAutoServices), 
NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
{lock dir, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szLockDir), NULL, NULL, 
FLAG_HIDE}, 
{lock directory, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szLockDir), NULL, 
NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
{modules dir, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szModulesDir), NULL, 
NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
@@ -815,19 +820,19 @@
  int fn_name(void) {return(*(int *)(ptr));}
 
 #define FN_LOCAL_STRING(fn_name,val) \
- const char *fn_name(int i) {return(lp_string((LP_SNUM_OK(i)  
global_params.ServicePtrs[(i)]-val) ? global_params.ServicePtrs[(i)]-val : 
sDefault.val));}
+ const char *fn_name(int i) {return(lp_string((LP_SNUM_OK(global_params, i) 
 global_params.ServicePtrs[(i)]-val) ? global_params.ServicePtrs[(i)]-val : 
sDefault.val));}
 #define FN_LOCAL_CONST_STRING(fn_name,val) \
- const char *fn_name(int i) {return (const char *)((LP_SNUM_OK(i)  
global_params.ServicePtrs[(i)]-val) ? global_params.ServicePtrs[(i)]-val : 
sDefault.val);}
+ const char *fn_name(int i) {return (const char *)((LP_SNUM_OK(global_params, 
i)  global_params.ServicePtrs[(i)]-val) ? 

Rev 12125: Avoid use of typedefs, in Samba 4 style. in file:///home/jelmer/bzr.samba/SAMBA_4_0/

2007-05-09 Thread Jelmer Vernooij
At file:///home/jelmer/bzr.samba/SAMBA_4_0/


revno: 12125
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: SAMBA_4_0
timestamp: Wed 2007-05-09 12:52:43 +0200
message:
  Avoid use of typedefs, in Samba 4 style.
modified:
  source/param/loadparm.csvn-v2:[EMAIL PROTECTED]
=== modified file 'source/param/loadparm.c'
--- a/source/param/loadparm.c   2007-05-09 10:46:52 +
+++ b/source/param/loadparm.c   2007-05-09 10:52:43 +
@@ -88,7 +88,7 @@
 /* 
  * This structure describes global (ie., server-wide) parameters.
  */
-typedef struct
+struct global
 {
int server_role;
 
@@ -189,15 +189,14 @@
int bDisableNetbios;
int bRpcBigEndian;
struct param_opt *param_opt;
-}
-global;
+};
 
-static global Globals;
+static struct global Globals;
 
 /* 
  * This structure describes a single service. 
  */
-typedef struct
+struct service
 {
int valid;
char *szService;
@@ -229,13 +228,12 @@
struct param_opt *param_opt;
 
char dummy[3];  /* for alignment */
-}
-service;
+};
 
 
 /* This is a default service used to prime a services structure */
-static service sDefault = {
-   True,   /* valid */
+static struct service sDefault = {
+   true,   /* valid */
NULL,   /* szService */
NULL,   /* szPath */
NULL,   /* szCopy */
@@ -250,14 +248,14 @@
1000,   /* iMaxPrintJobs */
0,  /* iMaxConnections */
0,  /* iCSCPolicy */
-   True,   /* bAvailable */
-   True,   /* bBrowseable */
-   True,   /* bRead_only */
+   true,   /* bAvailable */
+   true,   /* bBrowseable */
+   true,   /* bRead_only */
false,  /* bPrint_ok */
false,  /* bMap_system */
false,  /* bMap_hidden */
-   True,   /* bMap_archive */
-   True,   /* bStrictLocking */
+   true,   /* bMap_archive */
+   true,   /* bStrictLocking */
NULL,   /* copymap */
false,  /* bMSDfsRoot */
false,  /* bStrictSync */
@@ -273,7 +271,7 @@
 
 struct loadparm_context {
int iNumServices;
-   service **ServicePtrs;
+   struct service **ServicePtrs;

/* Files used by this loadparm context */
struct file_lists {
@@ -955,13 +953,13 @@
 static int map_parameter(const char *pszParmName);
 static int getservicebyname(struct loadparm_context *ctx, 
const char 
*pszServiceName,
-   service * pserviceDest);
-static void copy_service(service * pserviceDest,
-service * pserviceSource, int *pcopymapDest);
+   struct service * 
pserviceDest);
+static void copy_service(struct service * pserviceDest,
+struct service * pserviceSource, int *pcopymapDest);
 static BOOL service_ok(struct loadparm_context *ctx, int iService);
 static BOOL parse_section(const char *pszSectionName, void *);
 static BOOL parse_parameter(const char *, const char *, void *);
-static void init_copymap(service * pservice);
+static void init_copymap(struct service * pservice);
 
 /* This is a helper function for parametrical options support. */
 /* It returns a pointer to parametrical option value if it exists or NULL 
otherwise */
@@ -1157,9 +1155,9 @@
  Initialise a service to the defaults.
 ***/
 
-static void init_service(service * pservice)
+static void init_service(struct service * pservice)
 {
-   memset((char *)pservice, '\0', sizeof(service));
+   ZERO_STRUCTP(pservice);
copy_service(pservice, sDefault, NULL);
 }
 
@@ -1167,7 +1165,7 @@
  Free the dynamically allocated parts of a service struct.
 ***/
 
-static void free_service(service *pservice)
+static void free_service(struct service *pservice)
 {
int i;
 struct param_opt *data, *pdata;
@@ -1217,10 +1215,10 @@
 ***/
 
 static int add_a_service(struct loadparm_context *ctx, 
-const service *pservice, const 
char *name)
+const struct service 
*pservice, const char *name)
 {
int i;
-   service tservice;
+   struct service tservice;
int 

Rev 12126: Use talloc in loadparm. in file:///home/jelmer/bzr.samba/SAMBA_4_0/

2007-05-09 Thread Jelmer Vernooij
At file:///home/jelmer/bzr.samba/SAMBA_4_0/


revno: 12126
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: SAMBA_4_0
timestamp: Wed 2007-05-09 13:28:13 +0200
message:
  Use talloc in loadparm.
modified:
  source/lib/util/util_str.c svn-v2:[EMAIL PROTECTED]
  source/param/loadparm.csvn-v2:[EMAIL PROTECTED]
=== modified file 'source/lib/util/util_str.c'
--- a/source/lib/util/util_str.c2007-04-19 14:21:56 +
+++ b/source/lib/util/util_str.c2007-05-09 11:28:13 +
@@ -246,36 +246,23 @@
 }
 
 /**
- Set a string value, allocing the space for the string
-**/
-static BOOL string_init(char **dest,const char *src)
-{
-   if (!src) src = ;
-
-   (*dest) = strdup(src);
-   if ((*dest) == NULL) {
-   DEBUG(0,(Out of memory in string_init\n));
-   return False;
-   }
-   return True;
-}
-
-/**
- Free a string value.
-**/
-_PUBLIC_ void string_free(char **s)
-{
-   if (s) SAFE_FREE(*s);
-}
-
-/**
  Set a string value, deallocating any existing space, and allocing the space
  for the string
 **/
-_PUBLIC_ BOOL string_set(char **dest, const char *src)
+_PUBLIC_ BOOL string_set(TALLOC_CTX *mem_ctx, char **dest, const char *src)
 {
-   string_free(dest);
-   return string_init(dest,src);
+   if (dest != NULL)
+   talloc_free(*dest);
+
+   if (src == NULL) 
+   src = ;
+
+   (*dest) = talloc_strdup(mem_ctx, src);
+   if ((*dest) == NULL) {
+   DEBUG(0,(Out of memory in string_set\n));
+   return false;
+   }
+   return true;
 }
 
 /**

=== modified file 'source/param/loadparm.c'
--- a/source/param/loadparm.c   2007-05-09 10:52:43 +
+++ b/source/param/loadparm.c   2007-05-09 11:28:13 +
@@ -598,7 +598,7 @@
 parm_table[i].type == P_USTRING) 
parm_table[i].ptr 
!(parm_table[i].flags  FLAG_CMDLINE)) {
-   string_set(parm_table[i].ptr, );
+   string_set(ctx, parm_table[i].ptr, );
}
}
 
@@ -974,30 +974,28 @@
if (lookup_service = ctx-iNumServices) 
return NULL;

-   data = (lookup_service  0) ? 
-   Globals.param_opt : ctx-ServicePtrs[lookup_service]-param_opt;
 
asprintf(vfskey, %s:%s, type, option);
strlower(vfskey);
 
-   while (data) {
+   data = (lookup_service  0) ? 
+   Globals.param_opt : ctx-ServicePtrs[lookup_service]-param_opt;
+   for (; data; data = data-next) {
if (strcmp(data-key, vfskey) == 0) {
free(vfskey);
return data-value;
}
-   data = data-next;
}
 
if (lookup_service = 0) {
/* Try to fetch the same option but from globals */
/* but only if we are not already working with Globals */
-   data = Globals.param_opt;
-   while (data) {
+   
+   for (data = Globals.param_opt; data; data = data-next) {
if (strcmp(data-key, vfskey) == 0) {
free(vfskey);
return data-value;
}
-   data = data-next;
}
}
 
@@ -1167,45 +1165,7 @@
 
 static void free_service(struct service *pservice)
 {
-   int i;
-struct param_opt *data, *pdata;
-   if (!pservice)
-   return;
-
-   if (pservice-szService)
-   DEBUG(5, (free_service: Freeing service %s\n,
-  pservice-szService));
-
-   string_free(pservice-szService);
-   SAFE_FREE(pservice-copymap);
-
-   for (i = 0; parm_table[i].label; i++) {
-   if ((parm_table[i].type == P_STRING ||
-parm_table[i].type == P_USTRING) 
-   parm_table[i].class == P_LOCAL) {
-   string_free((char **)
-   (((char *)pservice) +
-PTR_DIFF(parm_table[i].ptr, sDefault)));
-   } else if (parm_table[i].type == P_LIST 
-  parm_table[i].class == P_LOCAL) {
-   char ***listp = (char ***)(((char *)pservice) + 
-  PTR_DIFF(parm_table[i].ptr, 
sDefault));
-   talloc_free(*listp);
-   *listp = NULL;
-   }
-   }
-   
-   DEBUG(5,(Freeing parametrics:\n));
-   data = pservice-param_opt;
-   while (data) {
-   DEBUG(5,([%s = %s]\n, data-key, data-value));
-   string_free(data-key);
-   string_free(data-value);
-   pdata = data-next;
- 

svn commit: samba r22766 - in branches/SAMBA_3_0/source: passdb rpc_server utils

2007-05-09 Thread vlendec
Author: vlendec
Date: 2007-05-09 11:39:55 + (Wed, 09 May 2007)
New Revision: 22766

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

Log:
Merge from 3_0:

r22412 | obnox | 2007-04-20 14:23:36 +0200 (Fr, 20 Apr 2007) | 5 lines

Add a deletelocalgroup subcommand to net sam.

Thanks to Karolin Seeger [EMAIL PROTECTED].



Modified:
   branches/SAMBA_3_0/source/passdb/pdb_interface.c
   branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c
   branches/SAMBA_3_0/source/utils/net_sam.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/pdb_interface.c
===
--- branches/SAMBA_3_0/source/passdb/pdb_interface.c2007-05-09 00:52:46 UTC 
(rev 22765)
+++ branches/SAMBA_3_0/source/passdb/pdb_interface.c2007-05-09 11:39:55 UTC 
(rev 22766)
@@ -904,35 +904,28 @@
return pdb-del_groupmem(pdb, mem_ctx, group_rid, member_rid);
 }
 
-BOOL pdb_find_alias(const char *name, DOM_SID *sid)
-{
-   struct pdb_methods *pdb = pdb_get_methods();
-   return NT_STATUS_IS_OK(pdb-find_alias(pdb, name, sid));
-}
-
 NTSTATUS pdb_create_alias(const char *name, uint32 *rid)
 {
struct pdb_methods *pdb = pdb_get_methods();
return pdb-create_alias(pdb, name, rid);
 }
 
-BOOL pdb_delete_alias(const DOM_SID *sid)
+NTSTATUS pdb_delete_alias(const DOM_SID *sid)
 {
struct pdb_methods *pdb = pdb_get_methods();
-   return NT_STATUS_IS_OK(pdb-delete_alias(pdb, sid));
-   
+   return pdb-delete_alias(pdb, sid);
 }
 
-BOOL pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info)
+NTSTATUS pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info)
 {
struct pdb_methods *pdb = pdb_get_methods();
-   return NT_STATUS_IS_OK(pdb-get_aliasinfo(pdb, sid, info));
+   return pdb-get_aliasinfo(pdb, sid, info);
 }
 
-BOOL pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info)
+NTSTATUS pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info)
 {
struct pdb_methods *pdb = pdb_get_methods();
-   return NT_STATUS_IS_OK(pdb-set_aliasinfo(pdb, sid, info));
+   return pdb-set_aliasinfo(pdb, sid, info);
 }
 
 NTSTATUS pdb_add_aliasmem(const DOM_SID *alias, const DOM_SID *member)

Modified: branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c
===
--- branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c  2007-05-09 00:52:46 UTC 
(rev 22765)
+++ branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c  2007-05-09 11:39:55 UTC 
(rev 22766)
@@ -1354,7 +1354,7 @@
DOM_SID   sid;
struct acct_info info;
uint32acc_granted;
-   BOOL ret;
+   NTSTATUS status;
 
r_u-status = NT_STATUS_OK;
 
@@ -1368,11 +1368,11 @@
}
 
become_root();
-   ret = pdb_get_aliasinfo(sid, info);
+   status = pdb_get_aliasinfo(sid, info);
unbecome_root();

-   if ( !ret )
-   return NT_STATUS_NO_SUCH_ALIAS;
+   if ( !NT_STATUS_IS_OK(status))
+   return status;
 
if ( !(r_u-ctr = TALLOC_ZERO_P( p-mem_ctx, ALIAS_INFO_CTR )) ) 
return NT_STATUS_NO_MEMORY;
@@ -4301,7 +4301,7 @@
uint32 acc_granted;
SE_PRIV se_rights;
BOOL can_add_accounts;
-   BOOL ret;
+   NTSTATUS status;
DISP_INFO *disp_info = NULL;
 
DEBUG(5, (_samr_delete_dom_alias: %d\n, __LINE__));
@@ -4340,15 +4340,15 @@
become_root();
 
/* Have passdb delete the alias */
-   ret = pdb_delete_alias(alias_sid);
+   status = pdb_delete_alias(alias_sid);

if ( can_add_accounts )
unbecome_root();

/ END SeAddUsers BLOCK */
 
-   if ( !ret )
-   return NT_STATUS_ACCESS_DENIED;
+   if ( !NT_STATUS_IS_OK(status))
+   return status;
 
if (!close_policy_hnd(p, q_u-alias_pol))
return NT_STATUS_OBJECT_NAME_INVALID;
@@ -4693,8 +4693,8 @@
struct acct_info info;
ALIAS_INFO_CTR *ctr;
uint32 acc_granted;
-   BOOL ret;
BOOL can_mod_accounts;
+   NTSTATUS status;
DISP_INFO *disp_info = NULL;
 
if (!get_lsa_policy_samr_sid(p, q_u-alias_pol, group_sid, 
acc_granted, disp_info))
@@ -4709,18 +4709,16 @@
/* get the current group information */
 
become_root();
-   ret = pdb_get_aliasinfo( group_sid, info );
+   status = pdb_get_aliasinfo( group_sid, info );
unbecome_root();
 
-   if ( !ret ) {
-   return NT_STATUS_NO_SUCH_ALIAS;
-   }
+   if ( !NT_STATUS_IS_OK(status))
+   return status;
 
switch (ctr-level) {
case 2:
{
fstring group_name, acct_name;
-   NTSTATUS status;
 
/* We currently do not 

svn commit: samba r22767 - in branches/SAMBA_3_0/source: passdb rpc_server utils

2007-05-09 Thread vlendec
Author: vlendec
Date: 2007-05-09 11:40:48 + (Wed, 09 May 2007)
New Revision: 22767

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

Log:
Argl. Typed in 'svn ci' in the wrong branch. Revert.

Modified:
   branches/SAMBA_3_0/source/passdb/pdb_interface.c
   branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c
   branches/SAMBA_3_0/source/utils/net_sam.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/pdb_interface.c
===
--- branches/SAMBA_3_0/source/passdb/pdb_interface.c2007-05-09 11:39:55 UTC 
(rev 22766)
+++ branches/SAMBA_3_0/source/passdb/pdb_interface.c2007-05-09 11:40:48 UTC 
(rev 22767)
@@ -904,28 +904,35 @@
return pdb-del_groupmem(pdb, mem_ctx, group_rid, member_rid);
 }
 
+BOOL pdb_find_alias(const char *name, DOM_SID *sid)
+{
+   struct pdb_methods *pdb = pdb_get_methods();
+   return NT_STATUS_IS_OK(pdb-find_alias(pdb, name, sid));
+}
+
 NTSTATUS pdb_create_alias(const char *name, uint32 *rid)
 {
struct pdb_methods *pdb = pdb_get_methods();
return pdb-create_alias(pdb, name, rid);
 }
 
-NTSTATUS pdb_delete_alias(const DOM_SID *sid)
+BOOL pdb_delete_alias(const DOM_SID *sid)
 {
struct pdb_methods *pdb = pdb_get_methods();
-   return pdb-delete_alias(pdb, sid);
+   return NT_STATUS_IS_OK(pdb-delete_alias(pdb, sid));
+   
 }
 
-NTSTATUS pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info)
+BOOL pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info)
 {
struct pdb_methods *pdb = pdb_get_methods();
-   return pdb-get_aliasinfo(pdb, sid, info);
+   return NT_STATUS_IS_OK(pdb-get_aliasinfo(pdb, sid, info));
 }
 
-NTSTATUS pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info)
+BOOL pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info)
 {
struct pdb_methods *pdb = pdb_get_methods();
-   return pdb-set_aliasinfo(pdb, sid, info);
+   return NT_STATUS_IS_OK(pdb-set_aliasinfo(pdb, sid, info));
 }
 
 NTSTATUS pdb_add_aliasmem(const DOM_SID *alias, const DOM_SID *member)

Modified: branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c
===
--- branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c  2007-05-09 11:39:55 UTC 
(rev 22766)
+++ branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c  2007-05-09 11:40:48 UTC 
(rev 22767)
@@ -1354,7 +1354,7 @@
DOM_SID   sid;
struct acct_info info;
uint32acc_granted;
-   NTSTATUS status;
+   BOOL ret;
 
r_u-status = NT_STATUS_OK;
 
@@ -1368,11 +1368,11 @@
}
 
become_root();
-   status = pdb_get_aliasinfo(sid, info);
+   ret = pdb_get_aliasinfo(sid, info);
unbecome_root();

-   if ( !NT_STATUS_IS_OK(status))
-   return status;
+   if ( !ret )
+   return NT_STATUS_NO_SUCH_ALIAS;
 
if ( !(r_u-ctr = TALLOC_ZERO_P( p-mem_ctx, ALIAS_INFO_CTR )) ) 
return NT_STATUS_NO_MEMORY;
@@ -4301,7 +4301,7 @@
uint32 acc_granted;
SE_PRIV se_rights;
BOOL can_add_accounts;
-   NTSTATUS status;
+   BOOL ret;
DISP_INFO *disp_info = NULL;
 
DEBUG(5, (_samr_delete_dom_alias: %d\n, __LINE__));
@@ -4340,15 +4340,15 @@
become_root();
 
/* Have passdb delete the alias */
-   status = pdb_delete_alias(alias_sid);
+   ret = pdb_delete_alias(alias_sid);

if ( can_add_accounts )
unbecome_root();

/ END SeAddUsers BLOCK */
 
-   if ( !NT_STATUS_IS_OK(status))
-   return status;
+   if ( !ret )
+   return NT_STATUS_ACCESS_DENIED;
 
if (!close_policy_hnd(p, q_u-alias_pol))
return NT_STATUS_OBJECT_NAME_INVALID;
@@ -4693,8 +4693,8 @@
struct acct_info info;
ALIAS_INFO_CTR *ctr;
uint32 acc_granted;
+   BOOL ret;
BOOL can_mod_accounts;
-   NTSTATUS status;
DISP_INFO *disp_info = NULL;
 
if (!get_lsa_policy_samr_sid(p, q_u-alias_pol, group_sid, 
acc_granted, disp_info))
@@ -4709,16 +4709,18 @@
/* get the current group information */
 
become_root();
-   status = pdb_get_aliasinfo( group_sid, info );
+   ret = pdb_get_aliasinfo( group_sid, info );
unbecome_root();
 
-   if ( !NT_STATUS_IS_OK(status))
-   return status;
+   if ( !ret ) {
+   return NT_STATUS_NO_SUCH_ALIAS;
+   }
 
switch (ctr-level) {
case 2:
{
fstring group_name, acct_name;
+   NTSTATUS status;
 
/* We currently do not support renaming groups in the
   the BUILTIN domain.  Refer to util_builtin.c to 
understand 
@@ -4774,17 

svn commit: samba r22768 - in branches/SAMBA_3_0_26/source/utils: .

2007-05-09 Thread vlendec
Author: vlendec
Date: 2007-05-09 11:41:32 + (Wed, 09 May 2007)
New Revision: 22768

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

Log:
Merge from 3_0:

r22412 | obnox | 2007-04-20 14:23:36 +0200 (Fr, 20 Apr 2007) | 5 lines

Add a deletelocalgroup subcommand to net sam.

Thanks to Karolin Seeger [EMAIL PROTECTED].


Modified:
   branches/SAMBA_3_0_26/source/utils/net_sam.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/utils/net_sam.c
===
--- branches/SAMBA_3_0_26/source/utils/net_sam.c2007-05-09 11:40:48 UTC 
(rev 22767)
+++ branches/SAMBA_3_0_26/source/utils/net_sam.c2007-05-09 11:41:32 UTC 
(rev 22768)
@@ -572,6 +572,46 @@
 }
 
 /*
+ * Delete a local group
+ */
+
+static int net_sam_deletelocalgroup(int argc, const char **argv)
+{
+   DOM_SID sid;
+enum lsa_SidType type;
+const char *dom, *name;
+   int ret;
+
+   if (argc != 1) {
+   d_fprintf(stderr, usage: net sam deletelocalgroup name\n);
+   return -1;
+   }
+
+   if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_ISOLATED,
+dom, name, sid, type)) {
+   d_fprintf(stderr, Could not find name %s.\n, argv[0]);
+   return -1;
+   }
+
+   if (type != SID_NAME_ALIAS) {
+   d_fprintf(stderr, %s is a %s, not a local group.\n, argv[0],
+ sid_type_lookup(type));
+   return -1;
+   }
+
+   ret = pdb_delete_alias(sid);
+
+   if ( !ret ) {
+   d_fprintf(stderr, Could not delete local group %s.\n, 
argv[0]);
+   return -1;
+   }
+
+   d_printf(Deleted local group %s.\n, argv[0]);
+
+   return 0;
+}
+
+/*
  * Create a local group
  */
 
@@ -1341,6 +1381,8 @@
  Create a new BUILTIN group },
{ createlocalgroup, net_sam_createlocalgroup,
  Create a new local group },
+   { deletelocalgroup, net_sam_deletelocalgroup,
+ Delete an existing local group },
{ mapunixgroup, net_sam_mapunixgroup,
  Map a unix group to a domain group },
{ addmem, net_sam_addmem,



Rev 12126: Fix include location. in file:///home/jelmer/bzr.samba/real4/

2007-05-09 Thread Jelmer Vernooij
At file:///home/jelmer/bzr.samba/real4/


revno: 12126
revision-id: [EMAIL PROTECTED]
parent: svn-v2:[EMAIL PROTECTED]
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: real4
timestamp: Wed 2007-05-09 13:51:14 +0200
message:
  Fix include location.
modified:
  source/dsdb/samdb/ldb_modules/entryUUID.c svn-v2:[EMAIL PROTECTED]
  source/dsdb/samdb/ldb_modules/samba3sam.c svn-v2:[EMAIL PROTECTED]
=== modified file 'source/dsdb/samdb/ldb_modules/entryUUID.c'
--- a/source/dsdb/samdb/ldb_modules/entryUUID.c 2007-04-27 11:13:37 +
+++ b/source/dsdb/samdb/ldb_modules/entryUUID.c 2007-05-09 11:51:14 +
@@ -31,7 +31,7 @@
 #include ldb/include/ldb.h
 #include ldb/include/ldb_private.h
 #include ldb/include/ldb_errors.h
-#include ldb/modules/ldb_map.h
+#include ldb/ldb_map/ldb_map.h
 
 #include librpc/gen_ndr/ndr_misc.h
 #include librpc/ndr/libndr.h

=== modified file 'source/dsdb/samdb/ldb_modules/samba3sam.c'
--- a/source/dsdb/samdb/ldb_modules/samba3sam.c 2007-02-15 12:54:58 +
+++ b/source/dsdb/samdb/ldb_modules/samba3sam.c 2007-05-09 11:51:14 +
@@ -9,7 +9,7 @@
 #include ldb/include/ldb.h
 #include ldb/include/ldb_private.h
 #include ldb/include/ldb_errors.h
-#include ldb/modules/ldb_map.h
+#include ldb/ldb_map/ldb_map.h
 #include system/passwd.h
 
 #include librpc/gen_ndr/ndr_security.h



svn commit: samba r22769 - in branches/SAMBA_4_0: . source/dsdb/samdb/ldb_modules

2007-05-09 Thread jelmer
Author: jelmer
Date: 2007-05-09 11:51:39 + (Wed, 09 May 2007)
New Revision: 22769

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

Log:
Fix include location.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/entryUUID.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samba3sam.c


Changeset:

Property changes on: branches/SAMBA_4_0
___
Name: bzr:revprop:branch-nick
   - SAMBA_4_0
   + real4
Name: bzr:merge
...skipped...

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/entryUUID.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/entryUUID.c
2007-05-09 11:41:32 UTC (rev 22768)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/entryUUID.c
2007-05-09 11:51:39 UTC (rev 22769)
@@ -31,7 +31,7 @@
 #include ldb/include/ldb.h
 #include ldb/include/ldb_private.h
 #include ldb/include/ldb_errors.h
-#include ldb/modules/ldb_map.h
+#include ldb/ldb_map/ldb_map.h
 
 #include librpc/gen_ndr/ndr_misc.h
 #include librpc/ndr/libndr.h

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samba3sam.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samba3sam.c
2007-05-09 11:41:32 UTC (rev 22768)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samba3sam.c
2007-05-09 11:51:39 UTC (rev 22769)
@@ -9,7 +9,7 @@
 #include ldb/include/ldb.h
 #include ldb/include/ldb_private.h
 #include ldb/include/ldb_errors.h
-#include ldb/modules/ldb_map.h
+#include ldb/ldb_map/ldb_map.h
 #include system/passwd.h
 
 #include librpc/gen_ndr/ndr_security.h



Rev 12127: Use service struct pointers rather than integers where possible. in file:///home/jelmer/bzr.samba/SAMBA_4_0/

2007-05-09 Thread Jelmer Vernooij
At file:///home/jelmer/bzr.samba/SAMBA_4_0/


revno: 12127
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: SAMBA_4_0
timestamp: Wed 2007-05-09 14:00:26 +0200
message:
  Use service struct pointers rather than integers where possible.
modified:
  source/param/loadparm.csvn-v2:[EMAIL PROTECTED]
=== modified file 'source/param/loadparm.c'
--- a/source/param/loadparm.c   2007-05-09 11:28:13 +
+++ b/source/param/loadparm.c   2007-05-09 12:00:26 +
@@ -1174,7 +1174,7 @@
  service. 
 ***/
 
-static int add_a_service(struct loadparm_context *ctx, 
+static struct service *add_a_service(struct loadparm_context *ctx, 
 const struct service 
*pservice, const char *name)
 {
int i;
@@ -1197,7 +1197,7 @@
data = pdata;
}
ctx-ServicePtrs[i]-param_opt = NULL;
-   return i;
+   return ctx-ServicePtrs[i];
}
}
 
@@ -1215,7 +1215,7 @@
   
if (!tsp) {
DEBUG(0,(add_a_service: failed to enlarge 
ServicePtrs!\n));
-   return (-1);
+   return NULL;
}
else {
ctx-ServicePtrs = tsp;
@@ -1223,7 +1223,7 @@
}
if (!ctx-ServicePtrs[ctx-iNumServices]) {
DEBUG(0,(add_a_service: out of memory!\n));
-   return (-1);
+   return NULL;
}
 
ctx-iNumServices++;
@@ -1236,7 +1236,7 @@
copy_service(ctx-ServicePtrs[i], tservice, NULL);
if (name)
string_set(ctx, ctx-ServicePtrs[i]-szService, name);
-   return i;
+   return ctx-ServicePtrs[i];
 }
 
 /***
@@ -1248,13 +1248,12 @@
 const char *pszHomename, int iDefaultService, 
 const char *user, const char *pszHomedir)
 {
-   int i;
pstring newHomedir;
 
-   i = add_a_service(ctx, ctx-ServicePtrs[iDefaultService], pszHomename);
+   struct service *svc = add_a_service(ctx, 
ctx-ServicePtrs[iDefaultService], pszHomename);
 
-   if (i  0)
-   return (False);
+   if (svc == NULL)
+   return false;
 
if (!(*(ctx-ServicePtrs[iDefaultService]-szPath))
|| strequal(ctx-ServicePtrs[iDefaultService]-szPath, 
lp_pathname(-1))) {
@@ -1264,16 +1263,16 @@
string_sub(newHomedir,%H, pszHomedir, sizeof(newHomedir)); 
}
 
-   string_set(ctx, ctx-ServicePtrs[i]-szPath, newHomedir);
+   string_set(svc, svc-szPath, newHomedir);
 
-   if (!(*(ctx-ServicePtrs[i]-comment))) {
+   if (!(*(svc-comment))) {
pstring comment;
slprintf(comment, sizeof(comment) - 1,
 Home directory of %s, user);
-   string_set(ctx, ctx-ServicePtrs[i]-comment, comment);
+   string_set(ctx, svc-comment, comment);
}
-   ctx-ServicePtrs[i]-bAvailable = sDefault.bAvailable;
-   ctx-ServicePtrs[i]-bBrowseable = sDefault.bBrowseable;
+   svc-bAvailable = sDefault.bAvailable;
+   svc-bBrowseable = sDefault.bBrowseable;
 
DEBUG(3, (adding home's share [%s] for user '%s' at '%s'\n, 
pszHomename, 
   user, newHomedir));
@@ -1285,7 +1284,7 @@
  Add a new service, based on an old one.
 ***/
 
-int lp_add_service(struct loadparm_context *ctx, 
+struct service *lp_add_service(struct loadparm_context *ctx, 
   const char *pszService, int iDefaultService)
 {
return (add_a_service(ctx, ctx-ServicePtrs[iDefaultService], 
pszService));
@@ -1299,25 +1298,25 @@
  const char *name, const char 
*fstype)
 {
pstring comment;
-   int i = add_a_service(ctx, sDefault, name);
+   struct service *svc = add_a_service(ctx, sDefault, name);
 
-   if (i  0)
-   return (False);
+   if (svc == NULL)
+   return false;
 
slprintf(comment, sizeof(comment) - 1,
 %s Service (%s), fstype, Globals.szServerString);
 
-   string_set(ctx, ctx-ServicePtrs[i]-szPath, tmpdir());
-   string_set(ctx, ctx-ServicePtrs[i]-comment, comment);
-   string_set(ctx, ctx-ServicePtrs[i]-fstype, fstype);
-   ctx-ServicePtrs[i]-iMaxConnections = -1;
-   ctx-ServicePtrs[i]-bAvailable = true;
-   ctx-ServicePtrs[i]-bRead_only = true;
-   

svn commit: samba r22770 - in branches/SAMBA_3_0_RELEASE/source: . lib modules nsswitch rpc_client rpc_parse rpc_server smbd

2007-05-09 Thread jerry
Author: jerry
Date: 2007-05-09 16:26:43 + (Wed, 09 May 2007)
New Revision: 22770

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

Log:
sync with SAMBA_3_0_25 as of svn r22765
Modified:
   branches/SAMBA_3_0_RELEASE/source/configure.in
   branches/SAMBA_3_0_RELEASE/source/lib/charcnv.c
   branches/SAMBA_3_0_RELEASE/source/modules/vfs_afsacl.c
   branches/SAMBA_3_0_RELEASE/source/nsswitch/idmap.c
   branches/SAMBA_3_0_RELEASE/source/nsswitch/winbindd_async.c
   branches/SAMBA_3_0_RELEASE/source/nsswitch/winbindd_group.c
   branches/SAMBA_3_0_RELEASE/source/rpc_client/cli_svcctl.c
   branches/SAMBA_3_0_RELEASE/source/rpc_parse/parse_misc.c
   branches/SAMBA_3_0_RELEASE/source/rpc_server/srv_lsa_nt.c
   branches/SAMBA_3_0_RELEASE/source/smbd/notify.c
   branches/SAMBA_3_0_RELEASE/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0_RELEASE/source/configure.in
===
--- branches/SAMBA_3_0_RELEASE/source/configure.in  2007-05-09 11:51:39 UTC 
(rev 22769)
+++ branches/SAMBA_3_0_RELEASE/source/configure.in  2007-05-09 16:26:43 UTC 
(rev 22770)
@@ -5764,10 +5764,6 @@
 AC_SUBST(WINBIND_NSS_EXTRA_LIBS)
 AC_SUBST(NSSSONAMEVERSIONSUFFIX)
 
-if test $BLDSHARED = true -a x$HAVE_WINBIND = xyes; then
-   NSS_MODULES=${WINBIND_NSS} ${WINBIND_WINS_NSS}
-fi
-
 AC_SUBST(SMB_KRB5_LOCATOR)
 
 # Check the setting of --with-winbind
@@ -5802,6 +5798,10 @@
WINBIND_WINS_NSS=
 fi
 
+if test $BLDSHARED = true -a x$HAVE_WINBIND = xyes; then
+   NSS_MODULES=${WINBIND_NSS} ${WINBIND_WINS_NSS}
+fi
+
 if test x$HAVE_WINBIND = xyes; then
 AC_MSG_RESULT(yes)
AC_DEFINE(WITH_WINBIND,1,[Whether to build winbind])

Modified: branches/SAMBA_3_0_RELEASE/source/lib/charcnv.c
===
--- branches/SAMBA_3_0_RELEASE/source/lib/charcnv.c 2007-05-09 11:51:39 UTC 
(rev 22769)
+++ branches/SAMBA_3_0_RELEASE/source/lib/charcnv.c 2007-05-09 16:26:43 UTC 
(rev 22770)
@@ -972,13 +972,18 @@
 
ret = convert_string(CH_DOS, CH_UNIX, src, src_len, dest, dest_len, 
True);
if (ret == (size_t)-1) {
+   ret = 0;
dest_len = 0;
}
 
-   if (dest_len)
-   dest[MIN(ret, dest_len-1)] = 0;
-   else 
+   if (dest_len  ret) {
+   /* Did we already process the terminating zero ? */
+   if (dest[MIN(ret-1, dest_len-1)] != 0) {
+   dest[MIN(ret, dest_len-1)] = 0;
+   }
+   } else  {
dest[0] = 0;
+   }
 
return src_len;
 }
@@ -1219,10 +1224,14 @@
if (src_len == (size_t)-1)
src_len = ret*2;

-   if (dest_len)
-   dest[MIN(ret, dest_len-1)] = 0;
-   else 
+   if (dest_len  ret) {
+   /* Did we already process the terminating zero ? */
+   if (dest[MIN(ret-1, dest_len-1)] != 0) {
+   dest[MIN(ret, dest_len-1)] = 0;
+   }
+   } else {
dest[0] = 0;
+   }
 
return src_len;
 }

Modified: branches/SAMBA_3_0_RELEASE/source/modules/vfs_afsacl.c
===
--- branches/SAMBA_3_0_RELEASE/source/modules/vfs_afsacl.c  2007-05-09 
11:51:39 UTC (rev 22769)
+++ branches/SAMBA_3_0_RELEASE/source/modules/vfs_afsacl.c  2007-05-09 
16:26:43 UTC (rev 22770)
@@ -616,7 +616,7 @@
uid_to_sid(owner_sid, sbuf.st_uid);
gid_to_sid(group_sid, sbuf.st_gid);
 
-   if (num_aces) {
+   if (afs_acl-num_aces) {
nt_ace_list = TALLOC_ARRAY(mem_ctx, SEC_ACE, afs_acl-num_aces);
 
if (nt_ace_list == NULL)

Modified: branches/SAMBA_3_0_RELEASE/source/nsswitch/idmap.c
===
--- branches/SAMBA_3_0_RELEASE/source/nsswitch/idmap.c  2007-05-09 11:51:39 UTC 
(rev 22769)
+++ branches/SAMBA_3_0_RELEASE/source/nsswitch/idmap.c  2007-05-09 16:26:43 UTC 
(rev 22770)
@@ -1025,17 +1025,16 @@
DEBUG(10, (Query backends to map sids-ids\n));
 
/* split list per domain */
-
-   if (num_domains) {
-   dom_ids = TALLOC_ZERO_ARRAY(ctx, struct id_map **, num_domains);
-   IDMAP_CHECK_ALLOC(dom_ids);
-   counters = TALLOC_ZERO_ARRAY(ctx, int, num_domains);
-   IDMAP_CHECK_ALLOC(counters);
-   } else {
-   dom_ids = NULL;
-   counters = NULL;
+   if (num_domains == 0) {
+   DEBUG(1, (No domains available?\n));
+   return NT_STATUS_UNSUCCESSFUL;
}
 
+   dom_ids = TALLOC_ZERO_ARRAY(ctx, struct id_map **, num_domains);
+   IDMAP_CHECK_ALLOC(dom_ids);
+   counters = TALLOC_ZERO_ARRAY(ctx, int, num_domains);
+   IDMAP_CHECK_ALLOC(counters);
+
/* partition the requests by domain */
 
for 

svn commit: samba r22771 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_25/source/nsswitch SAMBA_3_0_26/source/nsswitch

2007-05-09 Thread idra
Author: idra
Date: 2007-05-09 21:38:41 + (Wed, 09 May 2007)
New Revision: 22771

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

Log:

One liner fix for idmap_ldap
Fixes the strange behavior we were seeing about idmap_ldap creating
a new connection for each query.

Jerry we need this in for 3.0.25


Modified:
   branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c
   branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c
   branches/SAMBA_3_0_26/source/nsswitch/idmap_ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c
===
--- branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c 2007-05-09 16:26:43 UTC 
(rev 22770)
+++ branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c 2007-05-09 21:38:41 UTC 
(rev 22771)
@@ -821,6 +821,7 @@
talloc_set_destructor(ctx, idmap_ldap_close_destructor);
 
dom-private_data = ctx;
+   dom-initialized = True;
 
talloc_free(config_option);
return NT_STATUS_OK;

Modified: branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c
===
--- branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c  2007-05-09 16:26:43 UTC 
(rev 22770)
+++ branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c  2007-05-09 21:38:41 UTC 
(rev 22771)
@@ -818,6 +818,7 @@
talloc_set_destructor(ctx, idmap_ldap_close_destructor);
 
dom-private_data = ctx;
+   dom-initialized = True;
 
talloc_free(config_option);
return NT_STATUS_OK;

Modified: branches/SAMBA_3_0_26/source/nsswitch/idmap_ldap.c
===
--- branches/SAMBA_3_0_26/source/nsswitch/idmap_ldap.c  2007-05-09 16:26:43 UTC 
(rev 22770)
+++ branches/SAMBA_3_0_26/source/nsswitch/idmap_ldap.c  2007-05-09 21:38:41 UTC 
(rev 22771)
@@ -818,6 +818,7 @@
talloc_set_destructor(ctx, idmap_ldap_close_destructor);
 
dom-private_data = ctx;
+   dom-initialized = True;
 
talloc_free(config_option);
return NT_STATUS_OK;



Rev 266: merged ronnies code to delay client requests when in recovery mode in http://samba.org/~tridge/ctdb

2007-05-09 Thread tridge

revno: 266
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell [EMAIL PROTECTED]
branch nick: tridge
timestamp: Thu 2007-05-10 07:43:18 +1000
message:
  merged ronnies code to delay client requests when in recovery mode
modified:
  common/ctdb_daemon.c   ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1

revno: 197.1.90
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Wed 2007-05-09 14:08:11 +1000
message:
  hang the event from the retry structure instead of the hdr structure

revno: 197.1.89
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Wed 2007-05-09 14:06:47 +1000
message:
  when we are in recovery mode and we get a REQ_CALL from a client,
  defer it for one second and try again   
=== modified file 'common/ctdb_daemon.c'
--- a/common/ctdb_daemon.c  2007-05-08 23:59:23 +
+++ b/common/ctdb_daemon.c  2007-05-09 21:43:18 +
@@ -334,6 +334,30 @@
 }
 
 
+struct ctdb_client_retry {
+   struct ctdb_client *client;
+   struct ctdb_req_call *call;
+};
+
+static void daemon_request_call_from_client(struct ctdb_client *client, 
+   struct ctdb_req_call *c);
+
+/*
+  triggered after a one second delay, retrying a client packet
+  that was deferred because of the daemon being in recovery mode
+ */
+static void retry_client_packet(struct event_context *ev, struct timed_event 
*te, 
+   struct timeval t, void *private_data)
+{
+   struct ctdb_client_retry *retry = talloc_get_type(private_data, struct 
ctdb_client_retry);
+
+   daemon_request_call_from_client(retry-client, retry-call);
+
+   talloc_free(retry);
+}
+
+
+
 /*
   this is called when the ctdb daemon received a ctdb request call
   from a local client over the unix domain socket
@@ -350,6 +374,29 @@
int ret;
struct ctdb_context *ctdb = client-ctdb;
 
+   if (ctdb-recovery_mode != CTDB_RECOVERY_NORMAL) {
+   struct ctdb_client_retry *retry;
+   
+   DEBUG(0,(__location__  ctdb call %u from client
+ while we are in recovery mode. Deferring it\n, 
+c-hdr.reqid)); 
+
+   /* hang the event and the structure off client */
+   retry = talloc(client, struct ctdb_client_retry);
+   CTDB_NO_MEMORY_VOID(ctdb, retry);
+   retry-client = client;
+   retry-call   = c;
+   
+   /* this ensures that after the retry happens we
+  eventually free this request */
+   talloc_steal(retry, c);
+   
+   event_add_timed(ctdb-ev, retry, timeval_current_ofs(1,0), 
retry_client_packet, retry);
+   return;
+   }
+
+
+
ctdb-status.total_calls++;
ctdb-status.pending_calls++;
 



Rev 270: remove old s3 recovery code in http://samba.org/~tridge/ctdb

2007-05-09 Thread tridge

revno: 270
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell [EMAIL PROTECTED]
branch nick: tridge
timestamp: Thu 2007-05-10 08:49:57 +1000
message:
  remove old s3 recovery code
  fixed vnnmap wire format in recover daemon
modified:
  direct/ctdb_recoverd.c recoverd.c-20070503213540-bvxuyd9jm1f7ig90-1
  tools/ctdb_control.c   
ctdb_control.c-20070426122705-9ehj1l5lu2gn9kuj-1
  tools/monitor_recovery.sh  
monitor_recovery.sh-20070508220533-oy7s689rcjsu7yte-1

Diff too large for email (254, the limit is 200).


Rev 267: moved the vnn_map initialisation out of the cmdline code in http://samba.org/~tridge/ctdb

2007-05-09 Thread tridge

revno: 267
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell [EMAIL PROTECTED]
branch nick: tridge
timestamp: Thu 2007-05-10 07:55:46 +1000
message:
  moved the vnn_map initialisation out of the cmdline code
modified:
  common/cmdline.c   cmdline.c-20070416041216-w1zvz91bkdsgjckw-1
  common/ctdb.c  ctdb.c-20061127094323-t50f58d65iaao5of-2
  common/ctdb_daemon.c   ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1
=== modified file 'common/cmdline.c'
--- a/common/cmdline.c  2007-05-08 23:59:23 +
+++ b/common/cmdline.c  2007-05-09 21:55:46 +
@@ -89,7 +89,7 @@
 struct ctdb_context *ctdb_cmdline_init(struct event_context *ev)
 {
struct ctdb_context *ctdb;
-   int i, ret;
+   int ret;
 
if (ctdb_cmdline.nlist == NULL) {
printf(You must provide a node list with --nlist\n);
@@ -156,26 +156,6 @@
}
}
 
-   /* initialize the vnn mapping table */
-/*
-XXX we currently initialize it to the maximum number of nodes to 
-XXX make it behave the same way as previously.  
-XXX Once we have recovery working we should initialize this always to 
-XXX generation==0 (==invalid) and let the recovery tool populate this 
-XXX table for the daemons. 
-*/
-   ctdb-vnn_map = talloc_zero_size(ctdb, offsetof(struct ctdb_vnn_map, 
map) + 4*ctdb-num_nodes);
-   if (ctdb-vnn_map == NULL) {
-   DEBUG(0,(__location__  Unable to allocate vnn_map 
structure\n));
-   exit(1);
-   }
-   ctdb-vnn_map-generation = 1;
-   ctdb-vnn_map-size = ctdb-num_nodes;
-   for(i=0;ictdb-vnn_map-size;i++){
-   ctdb-vnn_map-map[i] = i%ctdb-num_nodes;
-   }
-
-
return ctdb;
 }
 

=== modified file 'common/ctdb.c'
--- a/common/ctdb.c 2007-05-06 19:02:48 +
+++ b/common/ctdb.c 2007-05-09 21:55:46 +
@@ -152,6 +152,25 @@
return -1;
}
}
+
+   /* initialize the vnn mapping table now that we have num_nodes setup */
+/*
+XXX we currently initialize it to the maximum number of nodes to 
+XXX make it behave the same way as previously.  
+XXX Once we have recovery working we should initialize this always to 
+XXX generation==0 (==invalid) and let the recovery tool populate this 
+XXX table for the daemons. 
+*/
+   ctdb-vnn_map = talloc_zero_size(ctdb, offsetof(struct ctdb_vnn_map, 
map) + 4*ctdb-num_nodes);
+   if (ctdb-vnn_map == NULL) {
+   DEBUG(0,(__location__  Unable to allocate vnn_map 
structure\n));
+   exit(1);
+   }
+   ctdb-vnn_map-generation = 1;
+   ctdb-vnn_map-size = ctdb-num_nodes;
+   for(i=0;ictdb-vnn_map-size;i++){
+   ctdb-vnn_map-map[i] = i%ctdb-num_nodes;
+   }

talloc_free(lines);
return 0;

=== modified file 'common/ctdb_daemon.c'
--- a/common/ctdb_daemon.c  2007-05-09 21:43:18 +
+++ b/common/ctdb_daemon.c  2007-05-09 21:55:46 +
@@ -721,7 +721,6 @@

close(fd[1]);
 
-
ctdb-ev = event_context_init(NULL);
fde = event_add_fd(ctdb-ev, ctdb, fd[0], 
EVENT_FD_READ|EVENT_FD_AUTOCLOSE, ctdb_read_from_parent, fd[0]);
fde = event_add_fd(ctdb-ev, ctdb, ctdb-daemon.sd, 
EVENT_FD_READ|EVENT_FD_AUTOCLOSE, ctdb_accept_client, ctdb);



Rev 269: fixed setvnnmap to use wire structures too in http://samba.org/~tridge/ctdb

2007-05-09 Thread tridge

revno: 269
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell [EMAIL PROTECTED]
branch nick: tridge
timestamp: Thu 2007-05-10 08:22:26 +1000
message:
  fixed setvnnmap to use wire structures too
modified:
  common/ctdb_client.c   ctdb_client.c-20070411010216-3kd8v37k61steeya-1
  common/ctdb_recover.c  
ctdb_recover.c-20070503002147-admmfgt1oj6gexfo-1
=== modified file 'common/ctdb_client.c'
--- a/common/ctdb_client.c  2007-05-09 22:13:19 +
+++ b/common/ctdb_client.c  2007-05-09 22:22:26 +
@@ -990,9 +990,19 @@
int ret;
TDB_DATA data, outdata;
int32_t res;
-
-   data.dsize = offsetof(struct ctdb_vnn_map, map) + 4*vnnmap-size;
-   data.dptr  = (unsigned char *)vnnmap;
+   struct ctdb_vnn_map_wire *map;
+   size_t len;
+
+   len = offsetof(struct ctdb_vnn_map_wire, map) + 
sizeof(uint32_t)*vnnmap-size;
+   map = talloc_size(mem_ctx, len);
+   CTDB_NO_MEMORY_VOID(ctdb, map);
+
+   map-generation = vnnmap-generation;
+   map-size = vnnmap-size;
+   memcpy(map-map, vnnmap-map, sizeof(uint32_t)*map-size);
+   
+   data.dsize = len;
+   data.dptr  = (uint8_t *)map;
 
ret = ctdb_control(ctdb, destnode, 0, 
   CTDB_CONTROL_SETVNNMAP, 0, data, 
@@ -1002,6 +1012,8 @@
return -1;
}
 
+   talloc_free(map);
+
return 0;
 }
 

=== modified file 'common/ctdb_recover.c'
--- a/common/ctdb_recover.c 2007-05-09 22:13:19 +
+++ b/common/ctdb_recover.c 2007-05-09 22:22:26 +
@@ -52,12 +52,19 @@
 int 
 ctdb_control_setvnnmap(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA 
indata, TDB_DATA *outdata)
 {
-   if (ctdb-vnn_map) {
-   talloc_free(ctdb-vnn_map);
-   ctdb-vnn_map = NULL;
-   }
-
-   ctdb-vnn_map = (struct ctdb_vnn_map *)talloc_memdup(ctdb, indata.dptr, 
indata.dsize);
+   struct ctdb_vnn_map_wire *map = (struct ctdb_vnn_map_wire *)indata.dptr;
+
+   talloc_free(ctdb-vnn_map);
+
+   ctdb-vnn_map = talloc(ctdb, struct ctdb_vnn_map);
+   CTDB_NO_MEMORY(ctdb, ctdb-vnn_map);
+
+   ctdb-vnn_map-generation = map-generation;
+   ctdb-vnn_map-size   = map-size;
+   ctdb-vnn_map-map = talloc_array(ctdb-vnn_map, uint32_t, map-size);
+   CTDB_NO_MEMORY(ctdb, ctdb-vnn_map-map);
+
+   memcpy(ctdb-vnn_map-map, map-map, sizeof(uint32_t)*map-size);
 
return 0;
 }



Rev 268: separate the wire format and internal format for the vnn_map in http://samba.org/~tridge/ctdb

2007-05-09 Thread tridge

revno: 268
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell [EMAIL PROTECTED]
branch nick: tridge
timestamp: Thu 2007-05-10 08:13:19 +1000
message:
  separate the wire format and internal format for the vnn_map
modified:
  common/ctdb.c  ctdb.c-20061127094323-t50f58d65iaao5of-2
  common/ctdb_client.c   ctdb_client.c-20070411010216-3kd8v37k61steeya-1
  common/ctdb_recover.c  
ctdb_recover.c-20070503002147-admmfgt1oj6gexfo-1
  include/ctdb_private.h 
ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
  tests/ctdbd.sh ctdbd.sh-20070411085038-phusiewluwzyqjpc-2
=== modified file 'common/ctdb.c'
--- a/common/ctdb.c 2007-05-09 21:55:46 +
+++ b/common/ctdb.c 2007-05-09 22:13:19 +
@@ -161,15 +161,16 @@
 XXX generation==0 (==invalid) and let the recovery tool populate this 
 XXX table for the daemons. 
 */
-   ctdb-vnn_map = talloc_zero_size(ctdb, offsetof(struct ctdb_vnn_map, 
map) + 4*ctdb-num_nodes);
-   if (ctdb-vnn_map == NULL) {
-   DEBUG(0,(__location__  Unable to allocate vnn_map 
structure\n));
-   exit(1);
-   }
+   ctdb-vnn_map = talloc(ctdb, struct ctdb_vnn_map);
+   CTDB_NO_MEMORY(ctdb, ctdb-vnn_map);
+
ctdb-vnn_map-generation = 1;
ctdb-vnn_map-size = ctdb-num_nodes;
-   for(i=0;ictdb-vnn_map-size;i++){
-   ctdb-vnn_map-map[i] = i%ctdb-num_nodes;
+   ctdb-vnn_map-map = talloc_array(ctdb-vnn_map, uint32_t, 
ctdb-vnn_map-size);
+   CTDB_NO_MEMORY(ctdb, ctdb-vnn_map-map);
+
+   for(i=0;ictdb-vnn_map-size;i++) {
+   ctdb-vnn_map-map[i] = i;
}

talloc_free(lines);

=== modified file 'common/ctdb_client.c'
--- a/common/ctdb_client.c  2007-05-06 21:54:17 +
+++ b/common/ctdb_client.c  2007-05-09 22:13:19 +
@@ -808,6 +808,7 @@
int ret;
TDB_DATA data, outdata;
int32_t res;
+   struct ctdb_vnn_map_wire *map;
 
ZERO_STRUCT(data);
ret = ctdb_control(ctdb, destnode, 0, 
@@ -817,8 +818,22 @@
DEBUG(0,(__location__  ctdb_control for getvnnmap failed\n));
return -1;
}
-
-   *vnnmap = (struct ctdb_vnn_map *)talloc_memdup(mem_ctx, outdata.dptr, 
outdata.dsize);
+   
+   map = (struct ctdb_vnn_map_wire *)outdata.dptr;
+   if (outdata.dsize  offsetof(struct ctdb_vnn_map_wire, map) ||
+   outdata.dsize != map-size*sizeof(uint32_t) + offsetof(struct 
ctdb_vnn_map_wire, map)) {
+   DEBUG(0,(Bad vnn map size received in ctdb_ctrl_getvnnmap\n));
+   return -1;
+   }
+
+   (*vnnmap) = talloc(mem_ctx, struct ctdb_vnn_map);
+   CTDB_NO_MEMORY(ctdb, *vnnmap);
+   (*vnnmap)-generation = map-generation;
+   (*vnnmap)-size   = map-size;
+   (*vnnmap)-map= talloc_array(*vnnmap, uint32_t, map-size);
+
+   CTDB_NO_MEMORY(ctdb, (*vnnmap)-map);
+   memcpy((*vnnmap)-map, map-map, sizeof(uint32_t)*map-size);

return 0;
 }

=== modified file 'common/ctdb_recover.c'
--- a/common/ctdb_recover.c 2007-05-03 06:18:03 +
+++ b/common/ctdb_recover.c 2007-05-09 22:13:19 +
@@ -32,9 +32,19 @@
 ctdb_control_getvnnmap(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA 
indata, TDB_DATA *outdata)
 {
CHECK_CONTROL_DATA_SIZE(0);
-
-   outdata-dsize = offsetof(struct ctdb_vnn_map, map) + 
4*ctdb-vnn_map-size;
-   outdata-dptr  = (unsigned char *)ctdb-vnn_map;
+   struct ctdb_vnn_map_wire *map;
+   size_t len;
+
+   len = offsetof(struct ctdb_vnn_map_wire, map) + 
sizeof(uint32_t)*ctdb-vnn_map-size;
+   map = talloc_size(outdata, len);
+   CTDB_NO_MEMORY_VOID(ctdb, map);
+
+   map-generation = ctdb-vnn_map-generation;
+   map-size = ctdb-vnn_map-size;
+   memcpy(map-map, ctdb-vnn_map-map, sizeof(uint32_t)*map-size);
+
+   outdata-dsize = len;
+   outdata-dptr  = (uint8_t *)map;
 
return 0;
 }

=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h2007-05-08 11:16:29 +
+++ b/include/ctdb_private.h2007-05-09 22:13:19 +
@@ -192,6 +192,15 @@
 struct ctdb_vnn_map {
uint32_t generation;
uint32_t size;
+   uint32_t *map;
+};
+
+/* 
+   a wire representation of the vnn map
+ */
+struct ctdb_vnn_map_wire {
+   uint32_t generation;
+   uint32_t size;
uint32_t map[1];
 };
 

=== modified file 'tests/ctdbd.sh'
--- a/tests/ctdbd.sh2007-05-04 02:18:39 +
+++ b/tests/ctdbd.sh2007-05-09 22:13:19 +
@@ -31,4 +31,6 @@
 echo Testing getdbmap
 $VALGRIND bin/ctdb_control getdbmap 0 || exit 1
 
+echo All done
+
 killall -q ctdbd



Build status as of Thu May 10 00:00:02 2007

2007-05-09 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-05-09 
00:01:12.0 +
+++ /home/build/master/cache/broken_results.txt 2007-05-10 00:00:21.0 
+
@@ -1,24 +1,24 @@
-Build status as of Wed May  9 00:00:02 2007
+Build status as of Thu May 10 00:00:02 2007
 
 Build counts:
 Tree Total  Broken Panic 
 SOC  0  0  0 
 build_farm   0  0  0 
-ccache   35 6  0 
+ccache   34 6  0 
 ctdb 0  0  0 
 distcc   3  0  0 
 ldb  34 6  0 
 libreplace   33 10 0 
 lorikeet-heimdal 29 14 0 
-pidl 18 5  0 
-ppp  14 0  0 
+pidl 17 4  0 
+ppp  13 0  0 
 python   0  0  0 
-rsync35 18 0 
+rsync35 17 0 
 samba0  0  0 
 samba-docs   0  0  0 
 samba-gtk4  3  0 
-samba4   36 30 0 
-samba_3_040 26 0 
+samba4   36 32 1 
+samba_3_039 23 0 
 smb-build31 30 0 
 talloc   35 1  0 
 tdb  34 3  0 


svn commit: samba r22772 - in branches/SAMBA_3_0/source: . lib/replace

2007-05-09 Thread derrell
Author: derrell
Date: 2007-05-10 01:27:18 + (Thu, 10 May 2007)
New Revision: 22772

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

Log:

- Still working on the fact that readahead() is not declared (on at least one
  OS) but is available for linking.  Instead of running configure tests with
  -Werror-implicit-function-declaration in developer mode (which may lead to
  different library functions being used in developer mode than when not in
  developer mode), add tests for whether readahead is declared.  If not,
  provide a replacement declaration in lib/replace.

Modified:
   branches/SAMBA_3_0/source/configure.in
   branches/SAMBA_3_0/source/lib/replace/README
   branches/SAMBA_3_0/source/lib/replace/libreplace.m4
   branches/SAMBA_3_0/source/lib/replace/replace.h


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===
--- branches/SAMBA_3_0/source/configure.in  2007-05-09 21:38:41 UTC (rev 
22771)
+++ branches/SAMBA_3_0/source/configure.in  2007-05-10 01:27:18 UTC (rev 
22772)
@@ -1337,19 +1337,6 @@
 # implicit declaration warnings without failing the test (in developer mode)
 ac_no_error_on_warning_CFLAGS=${CFLAGS}
 
-# Since --enable-developer causes warnings to be treated as errors during
-# compilation, we should avoid using features that will fail to compile.
-#
-# We don't want to enable this earlier because the built-in functions such as
-# memset fail to configure properly.
-
-if test x$samba_cv_HAVE_Werror_implicit_function_declaration = xyes -a \
-x$developer = xyes; then
-  CFLAGS=${CFLAGS} -Werror-implicit-function-declaration
-  ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext 5'
-  ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS 
conftest.$ac_ext $LIBS 5'
-fi
-
 echo -n checking for GPFS GPL libs... 
 save_LIBS=$LIBS
 LIBS=$LIBS -lgpfs_gpl

Modified: branches/SAMBA_3_0/source/lib/replace/README
===
--- branches/SAMBA_3_0/source/lib/replace/README2007-05-09 21:38:41 UTC 
(rev 22771)
+++ branches/SAMBA_3_0/source/lib/replace/README2007-05-10 01:27:18 UTC 
(rev 22772)
@@ -55,6 +55,11 @@
 socketpair
 strptime
 
+These external declarations are provided for those systems which lack the
+declaration but provide the function:
+
+readahead
+
 Types:
 bool
 socklen_t

Modified: branches/SAMBA_3_0/source/lib/replace/libreplace.m4
===
--- branches/SAMBA_3_0/source/lib/replace/libreplace.m4 2007-05-09 21:38:41 UTC 
(rev 22771)
+++ branches/SAMBA_3_0/source/lib/replace/libreplace.m4 2007-05-10 01:27:18 UTC 
(rev 22772)
@@ -155,6 +155,7 @@
 AC_HAVE_DECL(setresuid, [#include unistd.h])
 AC_HAVE_DECL(setresgid, [#include unistd.h])
 AC_HAVE_DECL(errno, [#include errno.h])
+AC_HAVE_DECL(readahead, [#include fcntl.h])
 
 AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
 AC_TRY_RUN([#include stdlib.h

Modified: branches/SAMBA_3_0/source/lib/replace/replace.h
===
--- branches/SAMBA_3_0/source/lib/replace/replace.h 2007-05-09 21:38:41 UTC 
(rev 22771)
+++ branches/SAMBA_3_0/source/lib/replace/replace.h 2007-05-10 01:27:18 UTC 
(rev 22772)
@@ -111,6 +111,11 @@
 extern int errno;
 #endif
 
+#if defined(HAVE_LINUX_READAHEAD)  ! defined(HAVE_READAHEAD_DECL)
+ssize_t readahead(int fd, off64_t offset, size_t count);
+#endif
+
+
 #ifndef HAVE_STRDUP
 #define strdup rep_strdup
 char *rep_strdup(const char *s);



svn commit: samba r22773 - in branches/SAMBA_3_0/source: .

2007-05-09 Thread derrell
Author: derrell
Date: 2007-05-10 02:48:22 + (Thu, 10 May 2007)
New Revision: 22773

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

Log:

- Clean up the the rest of the cruft from my earlier work on the readahead()
  missing declaration problem.

Modified:
   branches/SAMBA_3_0/source/configure.in


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===
--- branches/SAMBA_3_0/source/configure.in  2007-05-10 01:27:18 UTC (rev 
22772)
+++ branches/SAMBA_3_0/source/configure.in  2007-05-10 02:48:22 UTC (rev 
22773)
@@ -1333,10 +1333,6 @@
 AC_CHECK_FUNCS(backtrace_symbols)
 AC_CHECK_LIB(exc, trace_back_stack)
 
-# Save the original CFLAGS for a few tests that we want to allow
-# implicit declaration warnings without failing the test (in developer mode)
-ac_no_error_on_warning_CFLAGS=${CFLAGS}
-
 echo -n checking for GPFS GPL libs... 
 save_LIBS=$LIBS
 LIBS=$LIBS -lgpfs_gpl
@@ -4728,8 +4724,6 @@
 AC_CACHE_CHECK([whether the sys_quota interface 
works],samba_cv_SYSQUOTA_WORKS,[
 SAVE_CPPFLAGS=$CPPFLAGS
 CPPFLAGS=$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}
-SAVE_CFLAGS=$CFLAGS
-CFLAGS=${ac_no_error_on_warning_CFLAGS}
 AC_TRY_COMPILE([
 #include confdefs.h
 #define NO_PROTO_H 1
@@ -4739,7 +4733,6 @@
 #include ${srcdir-.}/lib/sysquotas.c
 ],[],samba_cv_SYSQUOTA_WORKS=yes,samba_cv_SYSQUOTA_WORKS=no)
 CPPFLAGS=$SAVE_CPPFLAGS
-CFLAGS=$SAVE_CFLAGS
 ])
 if test x$samba_cv_SYSQUOTA_WORKS = xyes; then
 AC_MSG_CHECKING(whether to use the new lib/sysquotas.c interface)
@@ -4778,8 +4771,6 @@
 AC_CACHE_CHECK([whether the old quota support works],samba_cv_QUOTA_WORKS,[
 SAVE_CPPFLAGS=$CPPFLAGS
 CPPFLAGS=$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}
-SAVE_CFLAGS=$CFLAGS
-CFLAGS=${ac_no_error_on_warning_CFLAGS}
 AC_TRY_COMPILE([
 #include confdefs.h
 #define NO_PROTO_H 1
@@ -4787,7 +4778,6 @@
 #include ${srcdir-.}/smbd/quotas.c
 ],[],samba_cv_QUOTA_WORKS=yes,samba_cv_QUOTA_WORKS=no)
 CPPFLAGS=$SAVE_CPPFLAGS
-CFLAGS=$SAVE_CFLAGS
 ])
 if test x$samba_cv_QUOTA_WORKS = xyes; then
 AC_MSG_CHECKING(whether to use the old quota support)
@@ -6377,7 +6367,7 @@
 
 dnl Merge in developer cflags from now on
 if test x$developer = xyes; then
-CFLAGS=${ac_no_error_on_warning_CFLAGS} ${DEVELOPER_CFLAGS}
+CFLAGS=${CFLAGS} ${DEVELOPER_CFLAGS}
 fi
 
 builddir=`pwd`