RE: [Samba] Domain Join( Security = DOMAIN) not working on Longhorn in 3.0.25b
Hi Hi We have been trying with Samba 3.0.25b to join longhorn server (latest version - June CTP longhorn version). We have configured Smb.conf with security = DOMAIN and we couldnt able to join longhorn. Known issue. Will be fixed n 3.2.0. Can I know when 3.2.0 will be released approximately? Waiting for your reply eagerly. Thanks and Regards Gomathi -Original Message- From: Gerald (Jerry) Carter [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 21, 2007 12:43 AM To: Gomathi Palanimuthu (WT01 - Embedded Product Engineering) Cc: samba@lists.samba.org Subject: Re: [Samba] Domain Join( Security = DOMAIN) not working on Longhorn in 3.0.25b -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: Hi We have been trying with Samba 3.0.25b to join longhorn server (latest version - June CTP longhorn version). We have configured Smb.conf with security = DOMAIN and we couldnt able to join longhorn. Known issue. Will be fixed n 3.2.0. cheers, jerry -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGyeeyIR7qMdg1EfYRAlL6AKC+Zt8+3ee0AsyRNQPi6xyrWEoXmwCfSZkP 85MwqxTCKIG4XaYJ705mO/8= =naWV -END PGP SIGNATURE- The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] cannot create users on the fly
Hi all, I am going nuts with this problem. I upgraded from 3 to 3.0.25b and can no longer add users or machines to my linux box on the fly. It used to work perfectly. My linux machine is a domain member, working as a file server, I am using ADS as security and nss backend for the idmap and winbind. While new users are authenticated OK off the domain server and winbind can see them there, samba doesn't call the create new users (or the create machine accounts, either) on the linux box so does not create their home directories. I have trawled through all the faq's, howtos, and lists on the net that I can find and have found nothing that resolves the problem. What is the purpose of the create new users script if it NEVER gets called? Or can anyone please tell me under what conditions it DOES get called, because I cannot create them. Cheers, John -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] doc files with attribut r for user
John Drescher a écrit : On 9/17/07, Patrick DUBAU [EMAIL PROTECTED] wrote: Hi, i upgraded from Debian sarge to etch, so from samba 3.0.14a-3 to 3.0.24 When someone creates/modify a file the user attribut is set to r (instead of rwx) so the next time a user opens the file is's on read only. What can i do so that the file keeps the attribut rwx for the owner ? Another question : the file has the rigthts : -r--rwx--- but although the user is member of the group the file opens only in read mode, strange no ? My share : [de1-mei] comment = fichiers service de1-mei path = /samba/admin/services/de1-mei writeable = yes directory mask = 2770 create mask = 0770 valid users = @DE1-MEI inherit acls = yes browseable = no N.B : i noticed that problem for now only with .doc files only (MsOfffice 97) I had this a few months back. The problem is that when MS office writes to an existing file it first creates a new file then deletes the old then renames the new to the old. On windows the OS detects this and sets the permissions for the new file to the permissions of the recently deleted file. Linux has no such weird behavior so this operation fails. A workaround to use create mode to make the default permissions for new files to be rw. Here is an 6 year old link to a discussion of this: http://acl.bestbits.at/pipermail/acl-devel/2001-November/000807.html John Thanks John for your answer. But everything worked fine before upgrade OS and samba, so there must be another trick What makes the problem more difficult is that this happens only for a few files... -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] access to share is not working using smb://
Hi, it's not possible for users running linux on the private laptop to get direct access to their own shares (Home-drives). So if a user is running linux on his private laptop, open konqueror, enter smb://FILESERVER/USERNAME an error occurs, share does not exist. Clicking on a visible share forces the authorization dialog to appear. Then everything is working. But how can it force it ? smb://[EMAIL PROTECTED]/USERNAME is also not working The client computer are not members in the domain and all user have local accounts. Samba 3.025 Any idea ? -- Bye, Peer _ Max-Planck-Institut fuer Biogeochemie Dr. Peer-Joachim Koch Hans-Knöll Str.10Telefon: ++49 3641 57-6705 D-07745 Jena Telefax: ++49 3641 57-7705 smime.p7s Description: S/MIME Cryptographic Signature -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] doc files with attribut r for user
Le lundi 17 septembre 2007, Patrick DUBAU a écrit : Hi, [...] Another question : the file has the rigthts : -r--rwx--- but although the user is member of the group the file opens only in read mode, strange no ? No, that is perfectly normal if the user used to open the file is the owner of the file. -- Francis Galiegue, One2team - [EMAIL PROTECTED] [ATTENTION : CHANGEMENT DE COORDONNÉES !] +33178945570, +33683877875, http://www.one2team.com 40 avenue Raymond Poincaré - 75116 PARIS -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] smbstatus issue with multiple smbd
did you also separate lock/ private dir, etc.? micha Valerio Daelli wrote: Hi we use samba 3.0.25a on FreeBSD 6.2. We use a 'multiple' approach on our server: we have a smbd daemon for the Users section (with its configuration file) and a smbd daemon for the Groups section (with another configuration file). We would like to discriminate the locks and the other details for these two daemons: we would like to have a report for smbd-users and a report for smbd-groups. However if we use smbstatus -s /usr/local/samba/lib/smb.conf.users and the other with smb.conf.groups, we get a full report which just list all the locks for the users and groups lists altogheter. We would like to have two distinct reports. Is there any ease way to get this or must we perl-script something? Hope it is clear. Thanks Valerio Daelli -- Michael Gasch Max Planck Institute for Evolutionary Anthropology Department of Human Evolution (IT Staff) Deutscher Platz 6 D-04103 Leipzig Germany Phone: 49 (0)341 - 3550 137 49 (0)341 - 3550 374 Fax: 49 (0)341 - 3550 399 -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
RE: [Samba] samba3+openldap:Problem during the LDAP search
But now another problem happened: when I tried to join a Winxp to the domain, after I enter the root account and password, a popup said logon failure:unknown user name or bad password. I can see root account using slapcat. Why are you using slapcat to see if there is a root account in the Dit? This seems like an alarm-bell that you need to slow down and learn a little bit more about LDAP and the LDAP tools before proceeding. I used smbldap-passwd to change the root's password. If I change the passdb backend to tdbsam, I can join the domain. Any idea? Everything with the tdbsam is pretty much automated for you; to work with an LDAP SAM you need more glue and to get that to work you need a working understanding of the different layers. Do you have an add user script setup? -- Adam Tauno Williams, Network Systems Administrator Consultant - http://www.whitemiceconsulting.com Developer - http://www.opengroupware.org -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] Vista client error 1058
Hello List, Still trying to get Samba to see our schools new Windows Vista clients profiles. I have updated my Samba server to FC5 Samba 3.0.23 but still will not show the Samba share/ H: drive home folder on Windows Vista clients only. For Windows 2000 XP the home folders shows up fine. On the Vista clients i am receiving error Event ID #1058 The processing of Group Policy failed,,,yada,,yada,, . I am wondering if I need to actual rebuild our default AD group policy settings? I can do a \\server in Nautilus and can see MY/USER home folder fine. It simply does not show up automagically at logon:( Does anyone have an actual smb.conf that they could post that is working with Windows Vista clients? We are using version Business of Vista if that makes any difference. BTW On my home FC5 / Samba server which is runinng as PDC I have no probs seeing Samba share/ H: drive when logging in. Thanks, Barry -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] LMPassword and NTPassword
Hallo, ich meinte am 16.09.07: I have to transfer samba passwords from an LDAP installation to a non-LDAP installation, passwddb is smbpasswd. LDAP shows sambaLMPassword and sambaNTPassword; smbpasswd needs 2 password entries. Can I copy the above LDAP passwords? If yes: what is what? The order in /etc/samba/private/smbpasswd seems to be sambaLMPassword sambaNTPassword The LMPasswds have often the same tail. Viele Gruesse! Helmut -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] ADS join / Name vs. IP
Hi I have a little problem to get Samba 3.0.26a to work with a w2k3 ad. If I try to connect to it I get an Failed to join domain: Operations error. With debug I can see that samba tries to connect to the ldap server. But instead using the IP address it's using the name. Could not open LDAP connection to win1.test.ads.local:389: Connection refused In my enviroment, this couldn't be resolved to an IP and so the whole domain join failed. I changed the one line in source/libads/ldap.c to use the IP and everything worked. --- ldap.c.orig 2007-09-18 14:39:26.0 +0200 +++ ldap.c 2007-09-18 14:39:29.0 +0200 @@ -427,7 +427,7 @@ /* Otherwise setup the TCP LDAP session */ - if ( (ads-ld = ldap_open_with_timeout(ads-config.ldap_server_name, + if ( (ads-ld = ldap_open_with_timeout(inet_ntoa(ads-ldap_ip), LDAP_PORT, lp_ldap_timeout())) == NULL ) { return ADS_ERROR(LDAP_OPERATIONS_ERROR); At least in 3.0.22 there was something similar. Is there a reason why the name is used? Regards, Christof Musik -- * bitbone AG Tel: +49(0)931-250993-0 * Martin-Luther-Strasse 5 a Fax: +49(0)931-250993-99 * D-97072 Würzburg/Germanyhttp://www.bitbone.de *** Systems 2007, 23. bis 26. Oktober 2007 in München Open Source Themenpark, Halle B2, Stand 110-33 Geschäftsbereich 8Soft: Kaspersky Partnerstand, IT-Security Halle B3, Stand 501 Informationen: http://www.bitbone.de/bitbone/events *** Sitz der Gesellschaft: Würzburg Handelsregister: Amtsgericht Würzburg HRB-7457 Aufsichtsratsvorsitzender: RA Axel Conzelmann Vorstand: Wolfgang Schuster, Sebastian Scheuring Thomas Sprickmann Kerkerinck Ust-IdNr. DE216268143 signature.asc Description: Digital signature -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] Network browsing
Hello all, I've been able to successfully set up a small network, using Samba as a PDC. I'm currently using the latest updated version of Fedora 7, and the latest version of Samba. I'm really new to DNS and WINS, so please excuse my ignorance if I've completely overlooked something. Perhaps you could point me in the right direction... My Samba server is set up as a domain controller, master browser, and I have it set to act as a WINS server. Everything on the client side seems to work wonderfully, except browsing. It is incredibly slow. I've set the client TCP/IP-Advanced-WINS settings to point to directly to the Samba server. All of the client machines pick up a IP and DNS server through a DSL cable modem, and not through the server (right now, I hope to change this as I go). The client is also set to use NetBIOS over TCP/IP. Now, if I manually enter a setting in the client hosts file, browsing is almost instantaneous. Without an entry in the hosts file, though, browsing slows to a crawl. I've certainly got a DNS issue going on here. To work around this, I had to put a entry in the hosts file on every single client in the network. I'm suspecting that I shouldn't have to do this, and DNS will handle IP address resolution for the server. All of our client machines are win2k at the moment. My question is, is setting the server to act as a WINS server (with clients WINS server pointing to the server) enough, or do I need to enable DNS on top of that, and point clients to the server for DNS? Or, more generally, how have you folks set up your server/client networks to use your server as a WINS server... and have any of you experienced very slow network browsing and how have you resolved it? Thank you all, JP -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] doc files with attribut r for user
Thanks John for your answer. But everything worked fine before upgrade OS and samba, so there must be another trick What makes the problem more difficult is that this happens only for a few files... I had the same experience as it worked with previous versions of samba. Here is what fixed the problem for me: [Users] comment = User Directories path = /home writable = yes create mask = 2777 directory mask = 2777 inherit acls = yes inherit permissions = yes John -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Network browsing
Hi Steven, That's what I was suspecting, I'm sending a DNS query to the outside world, and after some hunting around through various DNS servers, it gives up and comes back empty, so then the clients have to resort to broadcast. So just having Samba act as a WINS server with the 'wins support = yes' option set isn't enough, even if the clients are specifically told that the Samba server is also a WINS server... So... I should learn a little about setting up a DNS server. Cool. Thanks again. JP On Sep 18, 2007, at 10:40 AM, Steven Whaley wrote: I think you're correct that your problem is DNS related. From the sound of it you don't really have a DNS server running. Your clients have external DNS via the cable providers DNS servers, but that's no help for resolving internal network names. So every time you try to browse to a client ARP has to run to get an IP for the network name. If you set up your PDC, or another machine, to do DNS things will go much quicker, as you've seen when you set up the host files. James Perry wrote: Hello all, I've been able to successfully set up a small network, using Samba as a PDC. I'm currently using the latest updated version of Fedora 7, and the latest version of Samba. I'm really new to DNS and WINS, so please excuse my ignorance if I've completely overlooked something. Perhaps you could point me in the right direction... My Samba server is set up as a domain controller, master browser, and I have it set to act as a WINS server. Everything on the client side seems to work wonderfully, except browsing. It is incredibly slow. I've set the client TCP/IP-Advanced-WINS settings to point to directly to the Samba server. All of the client machines pick up a IP and DNS server through a DSL cable modem, and not through the server (right now, I hope to change this as I go). The client is also set to use NetBIOS over TCP/IP. Now, if I manually enter a setting in the client hosts file, browsing is almost instantaneous. Without an entry in the hosts file, though, browsing slows to a crawl. I've certainly got a DNS issue going on here. To work around this, I had to put a entry in the hosts file on every single client in the network. I'm suspecting that I shouldn't have to do this, and DNS will handle IP address resolution for the server. All of our client machines are win2k at the moment. My question is, is setting the server to act as a WINS server (with clients WINS server pointing to the server) enough, or do I need to enable DNS on top of that, and point clients to the server for DNS? Or, more generally, how have you folks set up your server/client networks to use your server as a WINS server... and have any of you experienced very slow network browsing and how have you resolved it? Thank you all, JP -- Puryear Information Technology, LLC Baton Rouge, LA * 225-706-8414 http://www.puryear-it.com Visit http://www.puryear-it.com/pubs/ebooks/ to download your free copies of: Best Practices for Managing Linux and UNIX Servers Spam Fighting and Email Security in the 21st Century -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Network browsing
Hi Ed, No - no local DNS server. I'll try what you suggested and see if I can run bind on the server machine. I kind of blindly assumed that setting 'wins support = yes' would magically do what I needed... Thanks, JP On Sep 18, 2007, at 10:45 AM, Ed Kasky wrote: At 07:30 AM Tuesday, 9/18/2007, James Perry wrote -= My question is, is setting the server to act as a WINS server (with clients WINS server pointing to the server) enough, or do I need to enable DNS on top of that, and point clients to the server for DNS? Or, more generally, how have you folks set up your server/client networks to use your server as a WINS server... and have any of you experienced very slow network browsing and how have you resolved it? Do you have local DNS on your network? If not, you might look into running a bind on the same machine. I have a small internal network with almost the same setup and I run bind for DNS. Works just fine. You may already have it installed - try #rpm -qa | grep bind and see what's installed. You should have a number of rpms's installed already. If so, then you need to configure your zones, etc. and start the daemon. Of course, that is no small job if you haven't done it before but here are lots of How To's available... HTH Ed . . . . . . . . . . . . . . . . . . Randomly Generated Quote (230 of 1270): When we got into office, the thing that surprised me the most was that things were as bad as we'd been saying they were. --John F. Kennedy -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Network browsing
I think you're correct that your problem is DNS related. From the sound of it you don't really have a DNS server running. Your clients have external DNS via the cable providers DNS servers, but that's no help for resolving internal network names. So every time you try to browse to a client ARP has to run to get an IP for the network name. If you set up your PDC, or another machine, to do DNS things will go much quicker, as you've seen when you set up the host files. James Perry wrote: Hello all, I've been able to successfully set up a small network, using Samba as a PDC. I'm currently using the latest updated version of Fedora 7, and the latest version of Samba. I'm really new to DNS and WINS, so please excuse my ignorance if I've completely overlooked something. Perhaps you could point me in the right direction... My Samba server is set up as a domain controller, master browser, and I have it set to act as a WINS server. Everything on the client side seems to work wonderfully, except browsing. It is incredibly slow. I've set the client TCP/IP-Advanced-WINS settings to point to directly to the Samba server. All of the client machines pick up a IP and DNS server through a DSL cable modem, and not through the server (right now, I hope to change this as I go). The client is also set to use NetBIOS over TCP/IP. Now, if I manually enter a setting in the client hosts file, browsing is almost instantaneous. Without an entry in the hosts file, though, browsing slows to a crawl. I've certainly got a DNS issue going on here. To work around this, I had to put a entry in the hosts file on every single client in the network. I'm suspecting that I shouldn't have to do this, and DNS will handle IP address resolution for the server. All of our client machines are win2k at the moment. My question is, is setting the server to act as a WINS server (with clients WINS server pointing to the server) enough, or do I need to enable DNS on top of that, and point clients to the server for DNS? Or, more generally, how have you folks set up your server/client networks to use your server as a WINS server... and have any of you experienced very slow network browsing and how have you resolved it? Thank you all, JP -- Puryear Information Technology, LLC Baton Rouge, LA * 225-706-8414 http://www.puryear-it.com Visit http://www.puryear-it.com/pubs/ebooks/ to download your free copies of: Best Practices for Managing Linux and UNIX Servers Spam Fighting and Email Security in the 21st Century -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] Disable share mapping without joining domain
Hello everyone! In a normal BDC with shared directories, a user can map a drive even if its client machine hasn't joined the Domain. For that, the user just need to have an account/password in the domain for doing that, and the Windows (or Linux) will ask for the user/pass for that share. But I don't want that to be done, I would like to allow only users that have actually JOINED the domain to map drives, and consequently disable any attempt to map drives from users that are not in the domain (even if this user has an account in my domain controller). Is there a way/possibility for doing that access control in Samba? Thanks in advance for any help/idea! Best, Steve -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] Using Samba: Third Edition
Hello When will this book arrive online? http://us1.samba.org/samba/docs/using_samba/toc.htmlUsing Samba, 2ed, O'Reilly Associates (Feb. 2003). (Jan 2007: The 3rd edition has been released and will be available online soon). kind regards werner Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Network browsing
At 07:30 AM Tuesday, 9/18/2007, James Perry wrote -= My question is, is setting the server to act as a WINS server (with clients WINS server pointing to the server) enough, or do I need to enable DNS on top of that, and point clients to the server for DNS? Or, more generally, how have you folks set up your server/client networks to use your server as a WINS server... and have any of you experienced very slow network browsing and how have you resolved it? Do you have local DNS on your network? If not, you might look into running a bind on the same machine. I have a small internal network with almost the same setup and I run bind for DNS. Works just fine. You may already have it installed - try #rpm -qa | grep bind and see what's installed. You should have a number of rpms's installed already. If so, then you need to configure your zones, etc. and start the daemon. Of course, that is no small job if you haven't done it before but here are lots of How To's available... HTH Ed . . . . . . . . . . . . . . . . . . Randomly Generated Quote (230 of 1270): When we got into office, the thing that surprised me the most was that things were as bad as we'd been saying they were. --John F. Kennedy -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] net join, client tls bug?
QUESTION: Does samba have client side TLS capabilities? BACKGROUND Samba ADS compliant distributions tried: RHEL samba 3.0.10 Blastware samba 3.0.22 (for Solaris 8 and above) Solaris 9 compilations 3.0.24, 25b, 25c, 26a My ADS is running in native 2003 mode. The only access I have to it is to set up Machine accounts. SMB.CONF For all versions I used the same smb.conf (see end of document) NET JOIN USED ./net ads join -S werebear.myrl.ds.home.org -Urw.hornbaker.ad -d10 ALL VERSION PRIOR TO 3.0.25 after acquiring a kerberos ticket via libsmb/clikrb5.c (see net dump below) net join RETURNS ads_connect: Strong(er) authentication required CHANGED ADS ADMIN PASSWD As suggested by a number of entries in the samba mailing lists, I changed the password for my administrative account rw.hornbaker.ad on the ADS The net ads join (above) returned the same Strong(er) authentication required error message. A search of all source code going into samba (kerberos, cyrus-sasl, openssl, openldap, and samba cannot find this error message. Searching MS knowledgebase returns only Article ID: 823659, August 14, 2007 For setting: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\ Parameters\LDAPServerIntegrity values can be: None Require signing -- Data signing required unless TLS/SSL is used. Not defined Compatiblility Problems: Simple binds fail with Ldap_simple_bind_s() failed: Strong Authentication Required From this I conclude my ADS is set to Require signing. Turning on TLS feature in smb.conf via ldap ssl = start tls Causes the net ads join to crash with: Failed to issue the StartTLS instruction: Connect error Samba documentation indicates this setting is to setup samba as a server that will be serving certificates and not having created a cert or configured ldap there is no way this setting could work. But all I want is for my samba machine to be an AD member NOT act as a server. So back to my question: 1. Is it the TLS capabilities or the lack there of that is causing the Strong(er) authentication required errors? 2. Does samba have client side TLS capabilities that work? 3. And if so how do we get them to work? Samba 3.0.25 and above it appears we can't even get a kerberos ticket 3.0.25b, 25c, and 26a yields (full net join dump further on): ... [2007/09/12 15:30:52, 3] libsmb/clikrb5.c:ads_krb5_mk_req(593) ads_krb5_mk_req: krb5_cc_get_principal failed (No credentials cache found) [2007/09/12 15:30:52, 10] libads/sasl.c:ads_sasl_spnego_bind(262) ads_sasl_spnego_krb5_bind failed with: No credentials cache found, calling kinit[2007/09/12 15:30:52, 10] libads/kerberos.c:kerberos_kinit_password_ext(91) kerberos_kinit_password: using [MEMORY:net_ads] as ccache and config [/var/samba/lock/smb_krb5/krb5.conf.MYRL] [2007/09/12 15:30:52, 0] libads/kerberos.c:ads_kinit_password(228) kerberos_kinit_password [EMAIL PROTECTED] failed: Preauthentication failed [2007/09/12 15:30:52, 1] utils/net_ads.c:net_ads_join(1470) error on ads_startup: Preauthentication failed +++ Samba 3.0.24, compiled on Solaris 9 net ads join FULL error dump ( RHEL Samba 3.0.10, Blastware 3.0.22 net join dumps are the same except for the time stamps and in 3.0.24(26a) Sol9 compilations of cyrus-sasl was compiled with ./configure --enable-gssapi --enable-login Also compile the same source code without --enabl-gssapi. net join still died with the Strong(er) authentication required error ) [2007/09/13 07:16:42, 5] lib/debug.c:debug_dump_status(391) INFO: Current debug levels: all: True/10 tdb: False/0 printdrivers: False/0 lanman: False/0 smb: False/0 rpc_parse: False/0 rpc_srv: False/0 rpc_cli: False/0 passdb: False/0 sam: False/0 auth: False/0 winbind: False/0 vfs: False/0 idmap: False/0 quota: False/0 acls: False/0 locking: False/0 msdfs: False/0 dmapi: False/0 [2007/09/13 07:16:42, 3] param/loadparm.c:lp_load(4945) lp_load: refreshing parameters [2007/09/13 07:16:42, 3] param/loadparm.c:init_globals(1410) Initialising global parameters [2007/09/13 07:16:43, 3] param/params.c:pm_process(572) params.c:pm_process() - Processing configuration file /etc/samba/smb.conf [2007/09/13 07:16:43, 3] param/loadparm.c:do_section(3687) Processing section [global] doing parameter workgroup = MYRL doing parameter realm = MYRL.DS.HOME.ORG doing parameter server string = Samba %v doing parameter security = ADS doing parameter client schannel = No doing parameter password server = 192.168.255.2 doing parameter username map = /etc/samba/private/username.map doing parameter restrict anonymous = 2 doing parameter client lanman auth = No doing parameter client plaintext auth = No doing parameter log level = 3 doing parameter syslog = 0 doing parameter log file = /var/samba/log.%m doing
Re: [Samba] SWAT smbpasswd authentication
On Monday 17 September 2007 20:44:23 Antoine Jacoutot wrote: Stupid question but is it possible to make SWAT use the smbpasswd file to authenticate users instead of the system passwd file? Hey guys. I'd just like to know if it's possible, please. Thanks. -- Antoine -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Network browsing
On Tuesday 18 September 2007, James Perry wrote: I'm sending a DNS query to the outside world, and after some hunting around through various DNS servers, it gives up and comes back empty, so then the clients have to resort to broadcast. They shouldn't resort to broadcast unless WINS for some reason isn't working. Check the wins.dat file on the server and see if it is properly propagated with the clients information. So just having Samba act as a WINS server with the 'wins support = yes' option set isn't enough, even if the clients are specifically told that the Samba server is also a WINS server... Make sure the clients also have NetBIOS over TCP/IP enabled. Do a testparm and make sure that smb ports has 139 enabled (445 is optional, the default is both which is just fine). Also verify that nmbd is running. It's good to have a local DNS server and cache but it shouldn't be necessary for doing NetBIOS browsing as long WINS, or its static counterpart, lmhosts files, which you can try in place of hosts file entries - and like hosts files they need to be replicated on every system, is working properly. Clearly a combination of WINS and DNS are to be preferred over their respective lmhosts and hosts files. For NetBIOS browsing WINS and lmhosts are to be given preference, especially with older clients. One problem with many DSL/Cable routers is that there is no way to reserve IP address assignments and therefore your systems might different IP addresses from time to time, especially after power outages. WINS, being dynamic can handle this, whereas lmhosts (and hosts) have to be edited. Best to also run a proper DHCP server as well or statically assign addresses, unless you set your DNS server to do dynamic updates as well. Bottom line is that I think your WINS server, and or clients are not working properly. -- Chris -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Network browsing
Hi Chris, Thanks for the info! I'll sprinkle comments below... On Sep 18, 2007, at 12:33 PM, Chris Smith wrote: On Tuesday 18 September 2007, James Perry wrote: I'm sending a DNS query to the outside world, and after some hunting around through various DNS servers, it gives up and comes back empty, so then the clients have to resort to broadcast. They shouldn't resort to broadcast unless WINS for some reason isn't working. Check the wins.dat file on the server and see if it is properly propagated with the clients information. I'll check and see if there are any entries in the wins.dat file. So just having Samba act as a WINS server with the 'wins support = yes' option set isn't enough, even if the clients are specifically told that the Samba server is also a WINS server... Make sure the clients also have NetBIOS over TCP/IP enabled. Do a testparm and make sure that smb ports has 139 enabled (445 is optional, the default is both which is just fine). Also verify that nmbd is running. I have the clients set to do NetBIOS over TCP/IP. I'll double check the smb ports. nmbd is running. It's good to have a local DNS server and cache but it shouldn't be necessary for doing NetBIOS browsing as long WINS, or its static counterpart, lmhosts files, which you can try in place of hosts file entries - and like hosts files they need to be replicated on every system, is working properly. That was my hope, that the WINS server alone would handle the queries. I was trying to avoid having to set either the hosts/lmhosts on the clients manually. Clearly a combination of WINS and DNS are to be preferred over their respective lmhosts and hosts files. For NetBIOS browsing WINS and lmhosts are to be given preference, especially with older clients. One problem with many DSL/Cable routers is that there is no way to reserve IP address assignments and therefore your systems might different IP addresses from time to time, especially after power outages. WINS, being dynamic can handle this, whereas lmhosts (and hosts) have to be edited. Best to also run a proper DHCP server as well or statically assign addresses, unless you set your DNS server to do dynamic updates as well. I've assigned a static IP address for the Samba server. I set the WINS server on the clients to point directly to the Samba server machine. Bottom line is that I think your WINS server, and or clients are not working properly. -- Chris -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] Questions about using Winbind to auth linux users
Hi there, I have some questions about authenticating linux users against Active Directory 2003 using winbind. My server is a member of an AD 2003 domain. It is running Samba Version 3.0.23c-2.el5.2.0.2 on a RHEL5. First of all, authentication is working. But I have some smaller issues : * wbinfo -u is very, very slow when dumping AD users. About 30 seconds. Whereas wbinfo -g is instantaneous. How can I make it go faster ? I'm interested in this answer as I suspect it to be the root of all problems... * Using finger to have more infos about an AD user is also very slow. Probably a nss problem but... Almost sure it is related to the first question. * Using 'ls -al' on an AD user's home directory is very slow and gives unix permissions as follows : [EMAIL PROTECTED] CRBN]# ll total 4 drwx-- 4 CRBN\elesouef CRBN\ssiom 4096 sep 18 15:15 elesouef Is it possible to strip the domain part of these permissions ? * And finally, is it possible to restrict authentications to this AD Samba domain member to a particular OU, such as : OU=myOU,DC=crbn,DC=intra Thanks for your help. -- Emmanuel Lesouef CRBN | DSI t : 0231069671 e : [EMAIL PROTECTED] -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] SWAT smbpasswd authentication
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Antoine Jacoutot wrote: On Monday 17 September 2007 20:44:23 Antoine Jacoutot wrote: Stupid question but is it possible to make SWAT use the smbpasswd file to authenticate users instead of the system passwd file? Hey guys. I'd just like to know if it's possible, please. Thanks. I don't know -- did you read SWAT's manual? For the record, I do believe that I had SWAT authenticating off of SMB. Did I do it without PAM like you are trying to do? Don't recall. - -- _ _ _ _ ___ _ _ _ |Y#| | | |\/| | \ |\ | | |Ryan Novosielski - Systems Programmer II |$| |__| | | |__/ | \| _| |[EMAIL PROTECTED] - 973/972.0922 (2-0922) \__/ Univ. of Med. and Dent.|IST/AST - NJMS Medical Science Bldg - C630 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG8A2Bmb+gadEcsb4RAjCWAJ9GgloTiLbvgYilAj+DWnhw8RcXbQCg3oRg +OBe1iefiP2Pbzeni0tD+4M= =9Xqe -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] SWAT smbpasswd authentication
On Tue, 18 Sep 2007, Ryan Novosielski wrote: I don't know -- did you read SWAT's manual? For the record, I do believe I did read SWAT man page of course. It's not really precise on the subject. that I had SWAT authenticating off of SMB. Did I do it without PAM like you are trying to do? Don't recall. Well thanks for the feedback anyway. -- Antoine -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] samba 3.0.26a - gentoo
I have just upgraded to samba 3.0.26a on my Gentoo Linux system using the same old configuration so that I can integrate with my windows 2003 AD domain (worked fine in previous versions). Something might be broken because it reports that 'realm' is an unknown parameter in smb.conf and it won't join my domain anymore. Guillermo Gutierrez Network Administrator Market Scan Information Systems, Inc. (818) 575-2017 (818) 324-0871 [EMAIL PROTECTED] -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Using Samba: Third Edition
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 werner maes wrote: Hello When will this book arrive online? http://us1.samba.org/samba/docs/using_samba/toc.htmlUsing Samba, 2ed, O'Reilly Associates (Feb. 2003). (Jan 2007: The 3rd edition has been released and will be available online soon). I have the XML files and as soon I can get the build process working to generate the HTML, I'll include it in the 3.2.0 docs. 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.2.2 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG8BorIR7qMdg1EfYRAo/QAKCCbXy5UZ/1pkD03JUDt/4jOqGW7QCfb3CX yPI6SPTZ97ivowXzOlC6ON0= =xpyt -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] Windows Vista Logging into SAMBA PDC
Hey guys i have a Samba PDC setup with LDAP and i've got windows XP clients logging into it fine. I originally had version 3.0.24etch for debian installed but i upgraded my samba version to 3.0.26 to see if it'd iron out but that didn't work. I can JOIN the samba domain but i can't LOGIN to the domain with a user. I get an RPC failure on the login screen for vista I login fine from windows xp clients. Any suggestions for me? Thanks in advance -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] group mapping on a member server - winbindd and solaris 10
From what I can tell it does look as if I have to run winbindd on member servers, even if NIS is used, to get SID's mapping consistently across the domain. The PDC is Samba 3.025a on Solaris 10. Two member servers are Samba 3.025a on solaris 9. If i start winbindd on a memv, the wbinfo -u and wbinfo -g commands show my users and groups. However, the winbindd.log shows [2007/09/18 17:36:39, 3] rpc_client/cli_pipe.c:rpc_pipe_bind(2081) rpc_pipe_bind: Remote machine MYPDC pipe \lsarpc fnum 0x74c1 bind request returned ok. [2007/09/18 17:36:39, 3] rpc_client/cli_pipe.c:rpc_pipe_bind(2081) rpc_pipe_bind: Remote machine MYPDC pipe \lsarpc fnum 0x74c2 bind request returned ok. [2007/09/18 17:36:39, 3] rpc_parse/parse_lsa.c:lsa_io_sec_qos(224) lsa_io_sec_qos: length c does not match size 8 [2007/09/18 17:36:39, 1] rpc_client/cli_pipe.c:cli_pipe_validate_current_pdu(625) cli_pipe_validate_current_pdu: RPC fault code DCERPC_FAULT_OP_RNG_ERROR received from remote machine MYPDC pipe \lsarpc fnum 0x74c2! [2007/09/18 17:36:39, 3] rpc_parse/parse_lsa.c:lsa_io_sec_qos(224) lsa_io_sec_qos: length c does not match size 8 I also have a member server running Samba 3.024 on Fedora Core 6. Winbind does not generate this error. I also don't get this error if I run winbindd on the PDC (although I don't have any need to, since group mapping is working fine on that machine.) I have not setup winbind entries in nsswitch.conf on any server. (Not sure if I need to and whether it will cause issues with unix level logins.) Thanks From: Gaiseric Vandal [EMAIL PROTECTED] To: samba samba@lists.samba.org Subject:[Samba] group mapping on a member server Date: Mon, 17 Sep 2007 17:18:00 -0400 I have installed a Samba 3.025a PDC and 2 member servers. All on solaris. (The Samba PDC replaced a NT4 PDC. Account data was migrated with the net vampire command.) All solaris machines use NIS. On the PDC i created group mappings between the NIS groups and the Windows groups. I can access file shares on all machines from Win XP or Win 2000 clients. On the security properties of a directory on the PDC , I can view and set user and group permissions. The users and groups show the correct doman. For example, assuming the domain is ACME, johnsmith (ACME\johnsmith) sales (ACME\sales) On the member server shares, I can attempt to add users and groups from the ACME domain, but they don't stick. Permissions set on the unix level show up as johnsmith (unix user\johnsmith) sales (unix group\sales) This is the sunfreeware build of samba, with acl support enabled by default. Solaris supports acl's so I can add multiple groups or users on the solaris level. And I do seem to have the proper access. Logs on the member servers show [2007/09/17 16:02:17, 0] smbd/posix_acls.c:create_canon_ace_lists(1423) create_canon_ace_lists: unable to map SID S-xyzxyz--xyzxyz-xyzxyz to uid or gid. ) When I created the group mappings, I explicitly set RID's. (Domain Admins = 512, sales=10001 etc) I am not running Winbind on any machine since I am not attempting to do unix level authentication against the samba accounts. Advice is appreciated Thanks -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
RE: [Samba] samba3+openldap:Problem during the LDAP search
Hi, I'm sorry that I'm new to LDAP. We used to use tdbsam as the passdb backend. I wish I had time to learn more about LDAP but I need to finish this in these few days. I just followed the steps from Samba guide chapter 5 and got stucked at the point of joining domain. I also use ldapsearch -x uid=root and see the root account's information. If this is not the right way, would you tell me how to check it and correct it? I swear I will study LDAP in depth after I get through this. And I can use the root account/password to access the share folders of the server without joining the domain. Thanks. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adam Tauno Williams Sent: Tuesday, September 18, 2007 7:22 AM To: samba@lists.samba.org Subject: RE: [Samba] samba3+openldap:Problem during the LDAP search But now another problem happened: when I tried to join a Winxp to the domain, after I enter the root account and password, a popup said logon failure:unknown user name or bad password. I can see root account using slapcat. Why are you using slapcat to see if there is a root account in the Dit? This seems like an alarm-bell that you need to slow down and learn a little bit more about LDAP and the LDAP tools before proceeding. I used smbldap-passwd to change the root's password. If I change the passdb backend to tdbsam, I can join the domain. Any idea? Everything with the tdbsam is pretty much automated for you; to work with an LDAP SAM you need more glue and to get that to work you need a working understanding of the different layers. Do you have an add user script setup? -- Adam Tauno Williams, Network Systems Administrator Consultant - http://www.whitemiceconsulting.com Developer - http://www.opengroupware.org -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] Authentication problems using libsmbclient to traverse DFS links
Hi, I'm trying to create a map of DFS links to actual server/share's. I know that you can get this information by logging on to the DFS root server, but I'm trying to use the libsmbclient API to get this information. I have created a fairly simple DFS structure on 2003 servers with everything on the same domain. //MyDomain/DFSRoot /Link1 - //Fileserv-1/FileShare1 /Link2 - //Fileserv-2/FileShare2 On the command line I can traverse the DFS tree without any problems, so using smbclient I can perform the following steps: # smbclient //10.4.1.107/DFSRoot -A ./credfile Domain=[ENG-DEV] OS=[Windows Server 2003 3790] Server=[Windows Server 2003 5.2] smb: \ ls . D0 Thu Mar 29 12:52:35 2007 .. D0 Thu Mar 29 12:52:35 2007 Link1 D0 Thu Mar 29 12:46:43 2007 Link2 D0 Thu Mar 29 12:52:35 2007 65389 blocks of size 65536. 36670 blocks available smb: \ showconnect //Fileserv-1/DFSRoot smb: \ cd Link1 smb: \Link1\ ls . D0 Thu Mar 29 12:43:19 2007 .. D0 Thu Mar 29 12:43:19 2007 List.xls A25088 Sat Jan 7 23:03:18 2006 . . . smb: \Link1\ showconnect //Fileserv-1/FileShare1 smb: \Link1\ cd ../Link2 smb: \Link2\ ls . D0 Thu Mar 29 12:40:14 2007 .. D0 Thu Mar 29 12:40:14 2007 abs-guide.pdf A 2069818 Thu Mar 29 12:39:04 2007 . . . sag.pdfA 869300 Thu Mar 29 12:40:14 2007 65389 blocks of size 65536. 36659 blocks available smb: \Link2\ showconnect //Fileserv-2/FileShare2 smb: \Link2\ However, problems ensue when I try to connect using the smbc_open and smbc_opendir functions. Tracing execution under gdb I see that my authentication callback function is being called every time I use the smbc_opendir function (that's good). I can authenticate without any problems to the DFS root,but the problem occurs when Samba tries to traverse the DFS tree. In this case the original server/share (i.e. of the DFS root) is not the server/share of the DFS link. When the code follows the path of the link, all the original authentication information is lost. My username, password, and workgroup are all changed to my Unix username and the workgroup that I've defined in smb.conf. I'm prompted for a password from the do_connect function and authentication to the server/share fails. Using a simple program to perform a recursive list of the contents under my DFS root with the libsmbclient interface here's my output: $ ./smblister smb://10.4.1.107/DFSRoot Opening (smb://10.4.1.107/DFSRoot)... Authentication function: Connection opened with smbc_opendir(). Opening (smb://10.4.1.107/DFSRoot/Link1 )... Authentication function: Password: tree connect failed: NT_STATUS_ACCESS_DENIED Unable to follow dfs referral [//Fileserv-1/FileShare1] Could not resolve \Link1\* Could not open [ smb://10.4.1.107/DFSRoot/Link1] (2:No such file or directory) Opening (smb://10.4.1.107/DFSRoot/Link2)... Authentication function: tree connect failed: NT_STATUS_ACCESS_DENIED Unable to follow dfs referral [//Fileserv-2/FileShare2] Could not resolve \Link2\* Could not open [smb://10.4.1.107/DFSRoot/Link2] (0:Success) * One difference between the two scenarios is that in the first case the cli_cm_set_credentials function is being called in the second case it's not. I'm not sure, but should the authentication callback function be used when resolving a DFS path? I'm still looking into where the defaults are set and if it's possible to get authentication info that's not statically defined. I also saw that I can define the /etc/samba/smbusers to map a Unix user name to a Windows login and tried this, but my default username is still the Unix one. I also uncommented the username map line in smb.conf. Thanks for looking at this... Regards, Avinash -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
svn commit: samba r25204 - in branches/SAMBA_4_0: source/lib/ldb/ldb_tdb testprogs/ejs
Author: abartlet Date: 2007-09-18 06:36:07 + (Tue, 18 Sep 2007) New Revision: 25204 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25204 Log: Patch by Andrew Kroeger [EMAIL PROTECTED] fixing bug #4958 - rename of ldb entries for a case change (only). I've modified the testsuite to verify this. Andrew Bartlett Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c branches/SAMBA_4_0/testprogs/ejs/ldb.js Changeset: Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c === --- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2007-09-18 02:43:56 UTC (rev 25203) +++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2007-09-18 06:36:07 UTC (rev 25204) @@ -856,16 +856,38 @@ goto done; } - ret = ltdb_add_internal(module, msg); - if (ret != LDB_SUCCESS) { - goto done; - } + if (ldb_dn_compare(req-op.rename.olddn, req-op.rename.newdn) == 0) { + /* The rename operation is apparently only changing case - + the DNs are the same. Delete the old DN before adding + the new one to avoid a TDB_ERR_EXISTS error. - tret = ltdb_delete_internal(module, req-op.rename.olddn); - if (tret != LDB_SUCCESS) { - ltdb_delete_internal(module, req-op.rename.newdn); - ret = LDB_ERR_OPERATIONS_ERROR; - goto done; + The only drawback to this is that if the delete + succeeds but the add fails, we rely on the + transaction to roll this all back. */ + ret = ltdb_delete_internal(module, req-op.rename.olddn); + if (ret != LDB_SUCCESS) { + goto done; + } + + ret = ltdb_add_internal(module, msg); + if (ret != LDB_SUCCESS) { + goto done; + } + } else { + /* The rename operation is changing DNs. Try to add the new + DN first to avoid clobbering another DN not related to + this rename operation. */ + ret = ltdb_add_internal(module, msg); + if (ret != LDB_SUCCESS) { + goto done; + } + + tret = ltdb_delete_internal(module, req-op.rename.olddn); + if (tret != LDB_SUCCESS) { + ltdb_delete_internal(module, req-op.rename.newdn); + ret = LDB_ERR_OPERATIONS_ERROR; + goto done; + } } if (ltdb_ac-callback) { Modified: branches/SAMBA_4_0/testprogs/ejs/ldb.js === --- branches/SAMBA_4_0/testprogs/ejs/ldb.js 2007-09-18 02:43:56 UTC (rev 25203) +++ branches/SAMBA_4_0/testprogs/ejs/ldb.js 2007-09-18 06:36:07 UTC (rev 25204) @@ -60,6 +60,11 @@ res = ldb.search(x=4, NULL, ldb.SCOPE_DEFAULT, attrs); assert(res.msgs[0].dn == cn=x3,cn=test); + ok = ldb.rename(cn=x3,cn=test, cn=X3,cn=test); + assert(ok.error == 0); + res = ldb.search(x=4, NULL, ldb.SCOPE_DEFAULT, attrs); + assert(res.msgs[0].dn == cn=X3,cn=test); + ok = ldb.modify( dn: cn=x3,cn=test changetype: modify
svn commit: samba r25209 - in branches/SAMBA_4_0/source/lib/talloc: .
Author: metze Date: 2007-09-18 11:56:24 + (Tue, 18 Sep 2007) New Revision: 25209 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25209 Log: unify logic of talloc_vasprintf_append() and talloc_vasprintf_append_buffer() metze Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c Changeset: Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c === --- branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 11:54:10 UTC (rev 25208) +++ branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 11:56:24 UTC (rev 25209) @@ -1313,30 +1313,18 @@ return ret; } - -/** - * Realloc @p s to append the formatted result of @p fmt and @p ap, - * and return @p s, which may have moved. Good for gradually - * accumulating output into a string buffer. Appends at the end - * of the string. - **/ -char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap) +static inline char *__talloc_vaslenprintf_append(char *s, size_t slen, +const char *fmt, va_list ap) { - int len, s_len; + ssize_t alen; va_list ap2; char c; - if (s == NULL) { - return talloc_vasprintf(NULL, fmt, ap); - } - - s_len = strlen(s); - va_copy(ap2, ap); - len = vsnprintf(c, 1, fmt, ap2); + alen = vsnprintf(c, 1, fmt, ap2); va_end(ap2); - if (len = 0) { + if (alen = 0) { /* Either the vsnprintf failed or the format resulted in * no characters being formatted. In the former case, we * ought to return NULL, in the latter we ought to return @@ -1346,60 +1334,51 @@ return s; } - s = talloc_realloc(NULL, s, char, s_len + len+1); + s = talloc_realloc(NULL, s, char, slen + alen + 1); if (!s) return NULL; va_copy(ap2, ap); - vsnprintf(s+s_len, len+1, fmt, ap2); + vsnprintf(s + slen, alen + 1, fmt, ap2); va_end(ap2); - _talloc_set_name_const(s, s); + _talloc_set_name_const(s, s); return s; } /** * Realloc @p s to append the formatted result of @p fmt and @p ap, + * and return @p s, which may have moved. Good for gradually + * accumulating output into a string buffer. Appends at the end + * of the string. + **/ +char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap) +{ + if (unlikely(!s)) { + return talloc_vasprintf(NULL, fmt, ap); + } + + return __talloc_vaslenprintf_append(s, strlen(s), fmt, ap); +} + +/** + * Realloc @p s to append the formatted result of @p fmt and @p ap, * and return @p s, which may have moved. Always appends at the * end of the talloc'ed buffer, not the end of the string. **/ char *talloc_vasprintf_append_buffer(char *s, const char *fmt, va_list ap) { - struct talloc_chunk *tc; - int len, s_len; - va_list ap2; - char c; + size_t slen; - if (s == NULL) { + if (unlikely(!s)) { return talloc_vasprintf(NULL, fmt, ap); } - tc = talloc_chunk_from_ptr(s); - - s_len = tc-size - 1; - - va_copy(ap2, ap); - len = vsnprintf(c, 1, fmt, ap2); - va_end(ap2); - - if (len = 0) { - /* Either the vsnprintf failed or the format resulted in -* no characters being formatted. In the former case, we -* ought to return NULL, in the latter we ought to return -* the original string. Most current callers of this -* function expect it to never return NULL. -*/ - return s; + slen = talloc_get_size(s); + if (likely(slen 0)) { + slen--; } - s = talloc_realloc(NULL, s, char, s_len + len+1); - if (!s) return NULL; - - va_copy(ap2, ap); - vsnprintf(s+s_len, len+1, fmt, ap2); - va_end(ap2); - _talloc_set_name_const(s, s); - - return s; + return __talloc_vaslenprintf_append(s, slen, fmt, ap); } /*
svn commit: samba r25205 - in branches/SAMBA_4_0/source/lib/talloc: .
Author: metze Date: 2007-09-18 11:50:39 + (Tue, 18 Sep 2007) New Revision: 25205 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25205 Log: $(srcdir) isn't expanded here... metze Modified: branches/SAMBA_4_0/source/lib/talloc/config.mk Changeset: Modified: branches/SAMBA_4_0/source/lib/talloc/config.mk === --- branches/SAMBA_4_0/source/lib/talloc/config.mk 2007-09-18 06:36:07 UTC (rev 25204) +++ branches/SAMBA_4_0/source/lib/talloc/config.mk 2007-09-18 11:50:39 UTC (rev 25205) @@ -5,7 +5,7 @@ SO_VERSION = 0 OBJ_FILES = talloc.o MANPAGE = talloc.3 -CFLAGS = -I$(srcdir)/lib/talloc +CFLAGS = -Ilib/talloc PUBLIC_HEADERS = talloc.h DESCRIPTION = A hierarchical pool based memory system with destructors #
svn commit: samba r25206 - in branches/SAMBA_4_0/source/lib/talloc: .
Author: metze Date: 2007-09-18 11:51:41 + (Tue, 18 Sep 2007) New Revision: 25206 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25206 Log: unify logic of talloc_strdup() and talloc_strndup(), only strlen() vs. strnlen() is the difference now. metze Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c Changeset: Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c === --- branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 11:50:39 UTC (rev 25205) +++ branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 11:51:41 UTC (rev 25206) @@ -1109,20 +1109,27 @@ return newp; } +static inline char *__talloc_strlendup(const void *t, const char *p, size_t len) +{ + char *ret; + + ret = (char *)__talloc(t, len + 1); + if (unlikely(!ret)) return NULL; + + memcpy(ret, p, len); + ret[len] = 0; + + _talloc_set_name_const(ret, ret); + return ret; +} + /* - strdup with a talloc + strdup with a talloc */ char *talloc_strdup(const void *t, const char *p) { - char *ret; - if (!p) { - return NULL; - } - ret = (char *)talloc_memdup(t, p, strlen(p) + 1); - if (likely(ret)) { - _talloc_set_name_const(ret, ret); - } - return ret; + if (unlikely(!p)) return NULL; + return __talloc_strlendup(t, p, strlen(p)); } /* @@ -1152,21 +1159,12 @@ } /* - strndup with a talloc + strndup with a talloc */ char *talloc_strndup(const void *t, const char *p, size_t n) { - size_t len; - char *ret; - - for (len=0; lenn p[len]; len++) ; - - ret = (char *)__talloc(t, len + 1); - if (!ret) { return NULL; } - memcpy(ret, p, len); - ret[len] = 0; - _talloc_set_name_const(ret, ret); - return ret; + if (unlikely(!p)) return NULL; + return __talloc_strlendup(t, p, strnlen(p, n)); } #ifndef HAVE_VA_COPY
svn commit: samba r25207 - in branches/SAMBA_4_0/source/lib/talloc: .
Author: metze Date: 2007-09-18 11:52:35 + (Tue, 18 Sep 2007) New Revision: 25207 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25207 Log: remove one nesting level and use unlikely() metze Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c Changeset: Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c === --- branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 11:51:41 UTC (rev 25206) +++ branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 11:52:35 UTC (rev 25207) @@ -1186,18 +1186,18 @@ va_copy(ap2, ap); len = vsnprintf(c, 1, fmt, ap2); va_end(ap2); - if (len 0) { + if (unlikely(len 0)) { return NULL; } ret = (char *)__talloc(t, len+1); - if (ret) { - va_copy(ap2, ap); - vsnprintf(ret, len+1, fmt, ap2); - va_end(ap2); - _talloc_set_name_const(ret, ret); - } + if (unlikely(!ret)) return NULL; + va_copy(ap2, ap); + vsnprintf(ret, len+1, fmt, ap2); + va_end(ap2); + + _talloc_set_name_const(ret, ret); return ret; }
svn commit: samba r25208 - in branches/SAMBA_4_0/source/lib/talloc: .
Author: metze Date: 2007-09-18 11:54:10 + (Tue, 18 Sep 2007) New Revision: 25208 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25208 Log: add talloc_str[n]dup_append[_buffer]() functions metze Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c branches/SAMBA_4_0/source/lib/talloc/talloc.h Changeset: Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c === --- branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 11:52:35 UTC (rev 25207) +++ branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 11:54:10 UTC (rev 25208) @@ -1167,6 +1167,102 @@ return __talloc_strlendup(t, p, strnlen(p, n)); } +static inline char *__talloc_strlendup_append(char *s, size_t slen, + const char *a, size_t alen) +{ + char *ret; + + ret = talloc_realloc(NULL, s, char, slen + alen + 1); + if (unlikely(!ret)) return NULL; + + /* append the string and the trailing \0 */ + memcpy(ret[slen], a, alen); + ret[slen+alen] = 0; + + _talloc_set_name_const(ret, ret); + return ret; +} + +/* + * Appends at the end of the string. + */ +char *talloc_strdup_append(char *s, const char *a) +{ + if (unlikely(!s)) { + return talloc_strdup(NULL, a); + } + + if (unlikely(!a)) { + return s; + } + + return __talloc_strlendup_append(s, strlen(s), a, strlen(a)); +} + +/* + * Appends at the end of the talloc'ed buffer, + * not the end of the string. + */ +char *talloc_strdup_append_buffer(char *s, const char *a) +{ + size_t slen; + + if (unlikely(!s)) { + return talloc_strdup(NULL, a); + } + + if (unlikely(!a)) { + return s; + } + + slen = talloc_get_size(s); + if (likely(slen 0)) { + slen--; + } + + return __talloc_strlendup_append(s, slen, a, strlen(a)); +} + +/* + * Appends at the end of the string. + */ +char *talloc_strndup_append(char *s, const char *a, size_t n) +{ + if (unlikely(!s)) { + return talloc_strdup(NULL, a); + } + + if (unlikely(!a)) { + return s; + } + + return __talloc_strlendup_append(s, strlen(s), a, strnlen(a, n)); +} + +/* + * Appends at the end of the talloc'ed buffer, + * not the end of the string. + */ +char *talloc_strndup_append_buffer(char *s, const char *a, size_t n) +{ + size_t slen; + + if (unlikely(!s)) { + return talloc_strdup(NULL, a); + } + + if (unlikely(!a)) { + return s; + } + + slen = talloc_get_size(s); + if (likely(slen 0)) { + slen--; + } + + return __talloc_strlendup_append(s, slen, a, strnlen(a, n)); +} + #ifndef HAVE_VA_COPY #ifdef HAVE___VA_COPY #define va_copy(dest, src) __va_copy(dest, src) Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.h === --- branches/SAMBA_4_0/source/lib/talloc/talloc.h 2007-09-18 11:52:35 UTC (rev 25207) +++ branches/SAMBA_4_0/source/lib/talloc/talloc.h 2007-09-18 11:54:10 UTC (rev 25208) @@ -152,15 +152,6 @@ void talloc_enable_leak_report_full(void); void *_talloc_zero(const void *ctx, size_t size, const char *name); void *_talloc_memdup(const void *t, const void *p, size_t size, const char *name); -char *talloc_strdup(const void *t, const char *p); -char *talloc_strndup(const void *t, const char *p, size_t n); -char *talloc_append_string(const void *t, char *orig, const char *append); -char *talloc_vasprintf(const void *t, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0); -char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0); -char *talloc_vasprintf_append_buffer(char *s, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0); -char *talloc_asprintf(const void *t, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); -char *talloc_asprintf_append(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); -char *talloc_asprintf_append_buffer(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); void *_talloc_array(const void *ctx, size_t el_size, unsigned count, const char *name); void *_talloc_zero_array(const void *ctx, size_t el_size, unsigned count, const char *name); void *_talloc_realloc_array(const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name); @@ -171,4 +162,22 @@ void talloc_show_parents(const void *context, FILE *file); int talloc_is_parent(const void *context, const void *ptr); +char *talloc_strdup(const void *t, const char *p); +char *talloc_strdup_append(char *s, const char *a); +char *talloc_strdup_append_buffer(char *s, const char *a); + +char *talloc_strndup(const void *t, const char *p, size_t n); +char *talloc_strndup_append(char *s, const char *a, size_t n); +char
svn commit: samba r25210 - in branches/SAMBA_4_0/source/lib/replace: .
Author: metze Date: 2007-09-18 12:00:29 + (Tue, 18 Sep 2007) New Revision: 25210 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25210 Log: fix typo metze Modified: branches/SAMBA_4_0/source/lib/replace/replace.h Changeset: Modified: branches/SAMBA_4_0/source/lib/replace/replace.h === --- branches/SAMBA_4_0/source/lib/replace/replace.h 2007-09-18 11:56:24 UTC (rev 25209) +++ branches/SAMBA_4_0/source/lib/replace/replace.h 2007-09-18 12:00:29 UTC (rev 25210) @@ -474,7 +474,7 @@ #define __STRING(x)#x #endif -#ifndef _STRINGSTRING +#ifndef __STRINGSTRING #define __STRINGSTRING(x) __STRING(x) #endif
svn commit: samba r25211 - in branches/SAMBA_4_0/source/lib/talloc: .
Author: metze Date: 2007-09-18 13:25:48 + (Tue, 18 Sep 2007) New Revision: 25211 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25211 Log: fix compiler warning metze Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c Changeset: Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c === --- branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 12:00:29 UTC (rev 25210) +++ branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 13:25:48 UTC (rev 25211) @@ -1315,6 +1315,10 @@ static inline char *__talloc_vaslenprintf_append(char *s, size_t slen, const char *fmt, va_list ap) +PRINTF_ATTRIBUTE(3,0); + +static inline char *__talloc_vaslenprintf_append(char *s, size_t slen, +const char *fmt, va_list ap) { ssize_t alen; va_list ap2;
svn commit: samba r25217 - in branches/SAMBA_4_0/source/client: .
Author: metze Date: 2007-09-18 13:47:10 + (Tue, 18 Sep 2007) New Revision: 25217 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25217 Log: #define TALLOC_DEPRECATED 1 to get talloc_append_string() macro I'm not updating any code here, as in a few places the existing code seems totaly broken to me... metze Modified: branches/SAMBA_4_0/source/client/client.c Changeset: Modified: branches/SAMBA_4_0/source/client/client.c === --- branches/SAMBA_4_0/source/client/client.c 2007-09-18 13:45:43 UTC (rev 25216) +++ branches/SAMBA_4_0/source/client/client.c 2007-09-18 13:47:10 UTC (rev 25217) @@ -20,6 +20,15 @@ along with this program. If not, see http://www.gnu.org/licenses/. */ +/* + * TODO: remove this ... and don't use talloc_append_string() + * + * NOTE: I'm not changing the code yet, because I assume there're + * some bugs in the existing code and I'm not sure how to fix + * them correctly. + */ +#define TALLOC_DEPRECATED 1 + #include includes.h #include version.h #include libcli/libcli.h
svn commit: samba r25212 - in branches/SAMBA_4_0/source/libcli/util: .
Author: metze Date: 2007-09-18 13:31:05 + (Tue, 18 Sep 2007) New Revision: 25212 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25212 Log: merge some stuff from samba3 metze Modified: branches/SAMBA_4_0/source/libcli/util/asn1.c Changeset: Modified: branches/SAMBA_4_0/source/libcli/util/asn1.c === --- branches/SAMBA_4_0/source/libcli/util/asn1.c2007-09-18 13:25:48 UTC (rev 25211) +++ branches/SAMBA_4_0/source/libcli/util/asn1.c2007-09-18 13:31:05 UTC (rev 25212) @@ -360,6 +360,9 @@ /* Peek into an ASN1 buffer, not advancing the pointer */ BOOL asn1_peek(struct asn1_data *data, void *p, int len) { + if (data-has_error) + return False; + if (len 0 || data-ofs + len data-ofs || data-ofs + len len) return False; @@ -405,7 +408,7 @@ return False; } - if (!asn1_peek(data, b, sizeof(b))) + if (!asn1_peek_uint8(data, b)) return False; return (b == tag);
svn commit: samba r25213 - in branches/SAMBA_4_0/source/utils: .
Author: metze Date: 2007-09-18 13:31:55 + (Tue, 18 Sep 2007) New Revision: 25213 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25213 Log: use talloc_strdup_append_buffer() instead of talloc_append_string() metze Modified: branches/SAMBA_4_0/source/utils/ntlm_auth.c Changeset: Modified: branches/SAMBA_4_0/source/utils/ntlm_auth.c === --- branches/SAMBA_4_0/source/utils/ntlm_auth.c 2007-09-18 13:31:05 UTC (rev 25212) +++ branches/SAMBA_4_0/source/utils/ntlm_auth.c 2007-09-18 13:31:55 UTC (rev 25213) @@ -902,8 +902,7 @@ static void *normal_private; void **private; - buf = talloc(NULL, char); - buf[0] = '\0'; + buf = talloc_strdup(NULL, ); if (buf == NULL) { DEBUG(0, (Failed to allocate memory for reading the input @@ -926,7 +925,7 @@ exit(0); } - buf = talloc_append_string(buf, buf, tmp); + buf = talloc_strdup_append_buffer(buf, tmp); buf_size += INITIAL_BUFFER_SIZE; if (buf_size MAX_BUFFER_SIZE) {
svn commit: samba r25214 - in branches/SAMBA_4_0/source/scripting/ejs: .
Author: metze Date: 2007-09-18 13:33:44 + (Tue, 18 Sep 2007) New Revision: 25214 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25214 Log: use talloc_strndup_append() instead of talloc_append_string() and ugly hacks to handle the string termination. metze Modified: branches/SAMBA_4_0/source/scripting/ejs/literal.c Changeset: Modified: branches/SAMBA_4_0/source/scripting/ejs/literal.c === --- branches/SAMBA_4_0/source/scripting/ejs/literal.c 2007-09-18 13:31:55 UTC (rev 25213) +++ branches/SAMBA_4_0/source/scripting/ejs/literal.c 2007-09-18 13:33:44 UTC (rev 25214) @@ -132,27 +132,11 @@ char *append, int size) { -char c; -char *end_p = append + size; -void *ret; + if (!orig) { + return talloc_strndup(ctx, append, size); + } -/* - * We need to null terminate the string to be copied. Save character at - * the size limit of the source string. - */ -c = *end_p; - -/* Temporarily null-terminate it */ -*end_p = '\0'; - -/* Append the requested data */ -ret = talloc_append_string(ctx, orig, append); - -/* Restore the original character in place of our temporary null byte */ -*end_p = c; - -/* Give 'em what they came for */ -return ret; + return talloc_strndup_append(orig, append, size); }
svn commit: samba r25215 - in branches/SAMBA_4_0/source/lib/ldb: common ldb_tdb
Author: metze Date: 2007-09-18 13:41:50 + (Tue, 18 Sep 2007) New Revision: 25215 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25215 Log: replace talloc_append_string() with talloc_strdup_append_buffer() metze Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c Changeset: Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c === --- branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c 2007-09-18 13:33:44 UTC (rev 25214) +++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_dn.c 2007-09-18 13:41:50 UTC (rev 25215) @@ -1279,6 +1279,7 @@ int i; TALLOC_CTX *tmpctx; char *cracked = NULL; + const char *format = (ex_format ? \n : / ); if ( ! ldb_dn_validate(dn)) { return NULL; @@ -1305,32 +1306,23 @@ /* Only domain components? Finish here */ if (i 0) { - if (ex_format) { - cracked = talloc_append_string(tmpctx, cracked, \n); - } else { - cracked = talloc_append_string(tmpctx, cracked, /); - } + cracked = talloc_strdup_append_buffer(cracked, format); talloc_steal(mem_ctx, cracked); goto done; } /* Now walk backwards appending remaining components */ for (; i 0; i--) { - cracked = talloc_asprintf_append(cracked, /%s, - ldb_dn_escape_value(tmpctx, dn-components[i].value)); + cracked = talloc_asprintf_append_buffer(cracked, /%s, + ldb_dn_escape_value(tmpctx, dn-components[i].value)); if (!cracked) { goto done; } } /* Last one, possibly a newline for the 'ex' format */ - if (ex_format) { - cracked = talloc_asprintf_append(cracked, \n%s, - ldb_dn_escape_value(tmpctx, dn-components[i].value)); - } else { - cracked = talloc_asprintf_append(cracked, /%s, - ldb_dn_escape_value(tmpctx, dn-components[i].value)); - } + cracked = talloc_asprintf_append_buffer(cracked, %s%s, format, + ldb_dn_escape_value(tmpctx, dn-components[i].value)); talloc_steal(mem_ctx, cracked); done: Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c === --- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2007-09-18 13:33:44 UTC (rev 25214) +++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2007-09-18 13:41:50 UTC (rev 25215) @@ -145,7 +145,7 @@ goto failed; } - key_str = talloc_append_string(ldb, key_str, dn_folded); + key_str = talloc_strdup_append_buffer(key_str, dn_folded); if (!key_str) { goto failed; }
svn commit: samba r25216 - in branches/SAMBA_4_0/source/lib/talloc: .
Author: metze Date: 2007-09-18 13:45:43 + (Tue, 18 Sep 2007) New Revision: 25216 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25216 Log: make talloc_append_string() a deprecated macro instead of having it as a real function. metze Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c branches/SAMBA_4_0/source/lib/talloc/talloc.h Changeset: Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c === --- branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 13:41:50 UTC (rev 25215) +++ branches/SAMBA_4_0/source/lib/talloc/talloc.c 2007-09-18 13:45:43 UTC (rev 25216) @@ -1133,32 +1133,6 @@ } /* - append to a talloced string -*/ -char *talloc_append_string(const void *t, char *orig, const char *append) -{ - char *ret; - size_t olen = strlen(orig); - size_t alenz; - - if (!append) - return orig; - - alenz = strlen(append) + 1; - - ret = talloc_realloc(t, orig, char, olen + alenz); - if (!ret) - return NULL; - - /* append the string with the trailing \0 */ - memcpy(ret[olen], append, alenz); - - _talloc_set_name_const(ret, ret); - - return ret; -} - -/* strndup with a talloc */ char *talloc_strndup(const void *t, const char *p, size_t n) Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.h === --- branches/SAMBA_4_0/source/lib/talloc/talloc.h 2007-09-18 13:41:50 UTC (rev 25215) +++ branches/SAMBA_4_0/source/lib/talloc/talloc.h 2007-09-18 13:45:43 UTC (rev 25216) @@ -111,6 +111,7 @@ #define talloc_array_p(ctx, type, count) talloc_array(ctx, type, count) #define talloc_realloc_p(ctx, p, type, count) talloc_realloc(ctx, p, type, count) #define talloc_destroy(ctx) talloc_free(ctx) +#define talloc_append_string(c, s, a) (s?talloc_strdup_append(s,a):talloc_strdup(c, a)) #endif /* The following definitions come from talloc.c */ @@ -178,6 +179,4 @@ char *talloc_asprintf_append(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); char *talloc_asprintf_append_buffer(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); -char *talloc_append_string(const void *t, char *orig, const char *append); - #endif
svn commit: samba r25218 - in branches/SAMBA_4_0: source/lib/ldb/common source/lib/ldb/ldb_tdb source/lib/ldb/tests source/lib/ldb/tests/schema-tests testprogs/ejs
Author: abartlet Date: 2007-09-18 22:43:06 + (Tue, 18 Sep 2007) New Revision: 25218 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25218 Log: After discussion with Simo, remove the subclass support from LDB. Subclass support was designed to avoid needing to spell out the full list of objectClasses that an entry was in. However, Samba4 now enforces this restriction in the objectClass module, and the way subclass matching was handled was complex and counter-intuitive in my opinion (and did not match LDAP). Andrew Bartlett Modified: branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c branches/SAMBA_4_0/source/lib/ldb/common/ldb_attributes.c branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_cache.c branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_index.c branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.h branches/SAMBA_4_0/source/lib/ldb/tests/schema-tests/schema.ldif branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb-features.sh branches/SAMBA_4_0/testprogs/ejs/ldb.js Changeset: Modified: branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c === --- branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c 2007-09-18 13:47:10 UTC (rev 25217) +++ branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c 2007-09-18 22:43:06 UTC (rev 25218) @@ -278,33 +278,6 @@ } /* - compare two objectclasses, looking at subclasses -*/ -int ldb_comparison_objectclass(struct ldb_context *ldb, void *mem_ctx, - const struct ldb_val *v1, const struct ldb_val *v2) -{ - int ret, i; - const char **subclasses; - ret = ldb_comparison_fold(ldb, mem_ctx, v1, v2); - if (ret == 0) { - return 0; - } - subclasses = ldb_subclass_list(ldb, (char *)v1-data); - if (subclasses == NULL) { - return ret; - } - for (i=0;subclasses[i];i++) { - struct ldb_val vs; - vs.data = discard_const(subclasses[i]); - vs.length = strlen(subclasses[i]); - if (ldb_comparison_objectclass(ldb, mem_ctx, vs, v2) == 0) { - return 0; - } - } - return ret; -} - -/* compare two utc time values. 1 second resolution */ int ldb_comparison_utctime(struct ldb_context *ldb, void *mem_ctx, @@ -368,7 +341,7 @@ .ldif_read_fn= ldb_handler_copy, .ldif_write_fn = ldb_handler_copy, .canonicalise_fn = ldb_handler_fold, - .comparison_fn = ldb_comparison_objectclass + .comparison_fn = ldb_comparison_fold }, { .name= LDB_SYNTAX_UTC_TIME, Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_attributes.c === --- branches/SAMBA_4_0/source/lib/ldb/common/ldb_attributes.c 2007-09-18 13:47:10 UTC (rev 25217) +++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_attributes.c 2007-09-18 22:43:06 UTC (rev 25218) @@ -204,114 +204,3 @@ return LDB_SUCCESS; } -/* - return the list of subclasses for a class -*/ -const char **ldb_subclass_list(struct ldb_context *ldb, const char *classname) -{ - int i; - for (i=0;ildb-schema.num_classes;i++) { - if (ldb_attr_cmp(classname, ldb-schema.classes[i].name) == 0) { - return (const char **)ldb-schema.classes[i].subclasses; - } - } - return NULL; -} - - -/* - add a new subclass -*/ -static int ldb_subclass_new(struct ldb_context *ldb, const char *classname, const char *subclass) -{ - struct ldb_subclass *s, *c; - s = talloc_realloc(ldb, ldb-schema.classes, struct ldb_subclass, ldb-schema.num_classes+1); - if (s == NULL) goto failed; - - ldb-schema.classes = s; - c = s[ldb-schema.num_classes]; - c-name = talloc_strdup(s, classname); - if (c-name == NULL) goto failed; - - c-subclasses = talloc_array(s, char *, 2); - if (c-subclasses == NULL) goto failed; - - c-subclasses[0] = talloc_strdup(c-subclasses, subclass); - if (c-subclasses[0] == NULL) goto failed; - c-subclasses[1] = NULL; - - ldb-schema.num_classes++; - - return 0; -failed: - ldb_oom(ldb); - return -1; -} - -/* - add a subclass -*/ -int ldb_subclass_add(struct ldb_context *ldb, const char *classname, const char *subclass) -{ - int i, n; - struct ldb_subclass *c; - char **s; - - for (i=0;ildb-schema.num_classes;i++) { - if (ldb_attr_cmp(classname, ldb-schema.classes[i].name) == 0) { - break; - } - } - if (i == ldb-schema.num_classes) { - return ldb_subclass_new(ldb, classname, subclass); - } - c = ldb-schema.classes[i]; - - for
Build status as of Wed Sep 19 00:00:02 2007
URL: http://build.samba.org/ --- /home/build/master/cache/broken_results.txt.old 2007-09-18 00:01:20.0 + +++ /home/build/master/cache/broken_results.txt 2007-09-19 00:01:32.0 + @@ -1,4 +1,4 @@ -Build status as of Tue Sep 18 00:00:03 2007 +Build status as of Wed Sep 19 00:00:02 2007 Build counts: Tree Total Broken Panic @@ -9,16 +9,16 @@ distcc 2 0 0 ldb 31 5 0 libreplace 30 8 0 -lorikeet-heimdal 25 15 0 +lorikeet-heimdal 26 16 0 pidl 18 4 0 ppp 11 8 0 python 0 0 0 -rsync31 12 0 +rsync31 16 0 samba-docs 0 0 0 samba-gtk3 3 0 -samba4 28 17 2 -samba_3_232 30 0 +samba4 28 18 2 +samba_3_232 31 0 smb-build29 29 0 talloc 31 1 0 -tdb 31 3 0 +tdb 30 3 0
svn commit: samba r25220 - in branches/SAMBA_4_0/source/lib/ldb/swig: .
Author: tpot Date: 2007-09-19 01:57:26 + (Wed, 19 Sep 2007) New Revision: 25220 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25220 Log: Comment out obsolete functions. Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i Changeset: Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i === --- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2007-09-18 23:19:04 UTC (rev 25219) +++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2007-09-19 01:57:26 UTC (rev 25220) @@ -234,6 +234,6 @@ /* DN operations */ -struct ldb_dn *ldb_dn_explode(void *mem_ctx, const char *dn); +/* struct ldb_dn *ldb_dn_explode(void *mem_ctx, const char *dn); */ -char *ldb_dn_linearize(void *mem_ctx, const struct ldb_dn *dn); +/* char *ldb_dn_linearize(void *mem_ctx, const struct ldb_dn *dn); */
svn commit: samba r25221 - in branches/SAMBA_4_0/source/libcli/swig: .
Author: tpot Date: 2007-09-19 01:59:06 + (Wed, 19 Sep 2007) New Revision: 25221 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=25221 Log: Experiment with Jelmer's new generic loadparm code. Modified: branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i Changeset: Modified: branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i === --- branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i 2007-09-19 01:57:26 UTC (rev 25220) +++ branches/SAMBA_4_0/source/libcli/swig/libcli_nbt.i 2007-09-19 01:59:06 UTC (rev 25221) @@ -31,11 +31,16 @@ #include lib/talloc/talloc.h #include lib/events/events.h #include libcli/nbt/libnbt.h +#include param/param.h /* Undo strcpy safety macro as it's used by swig )-: */ #undef strcpy +/* Loadparm parameters */ + +static struct loadparm_context lp_ctx; + %} %apply bool { BOOL }; @@ -132,4 +137,6 @@ NTSTATUS nbt_name_query(struct nbt_name_socket *nbtsock, TALLOC_CTX *mem_ctx, struct nbt_name_query *io); -void lp_load(void); +%init %{ + loadparm_init(lp_ctx); +%}
Rev 621: this is a temporary db. We should mark it clear-if-first in http://samba.org/~tridge/3_0-ctdb
revno: 621 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: s3-ctdb-tridge timestamp: Wed 2007-09-19 13:09:40 +1000 message: this is a temporary db. We should mark it clear-if-first modified: source/utils/status.c status.c-20070210173807-1wjifrbwaz6xnmgl-1163 === modified file 'source/utils/status.c' --- a/source/utils/status.c 2007-06-17 21:00:00 + +++ b/source/utils/status.c 2007-09-19 03:09:40 + @@ -346,7 +346,7 @@ if ( show_processes ) { struct db_context *db; db = db_open(NULL, lock_path(sessionid.tdb), 0, -TDB_DEFAULT, O_RDWR, 0644); +TDB_CLEAR_IF_FIRST, O_RDWR, 0644); if (!db) { d_printf(sessionid.tdb not initialised\n); } else {
Rev 632: make sure we set close on exec on any possibly inherited fds in http://samba.org/~tridge/ctdb
revno: 632 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Wed 2007-09-19 11:46:37 +1000 message: make sure we set close on exec on any possibly inherited fds modified: lib/events/events_epoll.c events_epoll.c-20070501213746-4fxluwiq4rcxib8p-2 lib/tdb/common/open.c open.c-20070220022425-m1wibgjq7n5hahs6-8 server/ctdb_recover.c ctdb_recover.c-20070503002147-admmfgt1oj6gexfo-1 === modified file 'lib/events/events_epoll.c' --- a/lib/events/events_epoll.c 2007-07-10 05:34:00 + +++ b/lib/events/events_epoll.c 2007-09-19 01:46:37 + @@ -90,7 +90,14 @@ */ static void epoll_init_ctx(struct epoll_event_context *epoll_ev) { + unsigned v; + epoll_ev-epoll_fd = epoll_create(64); + + /* on exec, don't inherit the fd */ + v = fcntl(epoll_ev-epoll_fd, F_GETFD, 0); +fcntl(epoll_ev-epoll_fd, F_SETFD, v | FD_CLOEXEC); + epoll_ev-pid = getpid(); talloc_set_destructor(epoll_ev, epoll_ctx_destructor); } @@ -105,6 +112,7 @@ static void epoll_check_reopen(struct epoll_event_context *epoll_ev) { struct fd_event *fde; + unsigned v; if (epoll_ev-pid == getpid()) { return; @@ -116,6 +124,11 @@ DEBUG(0,(Failed to recreate epoll handle after fork\n)); return; } + + /* on exec, don't inherit the fd */ + v = fcntl(epoll_ev-epoll_fd, F_GETFD, 0); +fcntl(epoll_ev-epoll_fd, F_SETFD, v | FD_CLOEXEC); + epoll_ev-pid = getpid(); for (fde=epoll_ev-fd_events;fde;fde=fde-next) { epoll_add_event(epoll_ev, fde); === modified file 'lib/tdb/common/open.c' --- a/lib/tdb/common/open.c 2007-07-10 05:32:27 + +++ b/lib/tdb/common/open.c 2007-09-19 01:46:37 + @@ -138,6 +138,7 @@ int rev = 0, locked = 0; unsigned char *vp; u32 vertest; + unsigned v; if (!(tdb = (struct tdb_context *)calloc(1, sizeof *tdb))) { /* Can't log this */ @@ -197,6 +198,10 @@ goto fail; /* errno set by open(2) */ } + /* on exec, don't inherit the fd */ + v = fcntl(tdb-fd, F_GETFD, 0); +fcntl(tdb-fd, F_SETFD, v | FD_CLOEXEC); + /* ensure there is only one process initialising at once */ if (tdb-methods-tdb_brlock(tdb, GLOBAL_LOCK, F_WRLCK, F_SETLKW, 0, 1) == -1) { TDB_LOG((tdb, TDB_DEBUG_ERROR, tdb_open_ex: failed to get global lock on %s: %s\n, === modified file 'server/ctdb_recover.c' --- a/server/ctdb_recover.c 2007-09-04 00:06:36 + +++ b/server/ctdb_recover.c 2007-09-19 01:46:37 + @@ -661,6 +661,8 @@ return false; } + set_close_on_exec(ctdb-recovery_lock_fd); + lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; lock.l_start = 0;
Rev 631: separate out the various fs display ops in http://samba.org/~tridge/ctdb
revno: 631 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Wed 2007-09-19 11:46:11 +1000 message: separate out the various fs display ops modified: tools/ctdb_diagnostics ctdb_diagnostics-20070905041904-9d9r1qnt1j9qiwiz-1 === modified file 'tools/ctdb_diagnostics' --- a/tools/ctdb_diagnostics2007-09-17 05:31:33 + +++ b/tools/ctdb_diagnostics2007-09-19 01:46:11 + @@ -113,7 +113,9 @@ Showing system and process status EOF -show_all df; df -i; mount +show_all df +show_all df -i +show_all mount show_all w show_all ps axfw show_all dmesg
Rev 620: a bit more information on this failure to try to track down the problem chris cowan is seeing in http://samba.org/~tridge/3_0-ctdb
revno: 620 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: s3-ctdb-tridge timestamp: Wed 2007-09-19 13:05:17 +1000 message: a bit more information on this failure to try to track down the problem chris cowan is seeing modified: source/lib/messages.c messages.c-20070210173807-1wjifrbwaz6xnmgl-491 === modified file 'source/lib/messages.c' --- a/source/lib/messages.c 2007-09-14 09:29:17 + +++ b/source/lib/messages.c 2007-09-19 03:05:17 + @@ -1317,6 +1317,8 @@ } if (!(ctx-inbuf = TALLOC_ARRAY(ctx, uint8, ctx-msglen))) { + DEBUG(0,(Failed to allocate inbuf of size %u\n, +(unsigned)ctx-msglen)); cluster_fatal(talloc failed\n); } ctx-inbuflen = sizeof(uint32);