From 032e57f68287d68e41f1eb4accbe3efb7bf4c38a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 12 Oct 2005 17:18:01 +0000 Subject: [PATCH] r10929: tagging release --- release-3-0-20b/WHATSNEW.txt | 5207 +++++++++++++++++++++++ release-3-0-20b/source/Makefile.in | 1600 +++++++ release-3-0-20b/source/VERSION | 93 + release-3-0-20b/source/configure.in | 5042 ++++++++++++++++++++++ release-3-0-20b/source/include/smb.h | 1766 ++++++++ release-3-0-20b/source/nmbd/nmbd.c | 825 ++++ release-3-0-20b/source/nsswitch/winbindd_misc.c | 508 +++ release-3-0-20b/source/script/installman.sh | 75 + release-3-0-20b/source/smbd/open.c | 2129 +++++++++ release-3-0-20b/source/smbd/posix_acls.c | 4174 ++++++++++++++++++ release-3-0-20b/source/smbd/quotas.c | 1488 +++++++ release-3-0-20b/source/smbd/server.c | 981 +++++ release-3-0-20b/source/smbd/trans2.c | 5163 ++++++++++++++++++++++ release-3-0-20b/source/wrepld/server.c | 670 +++ 14 files changed, 29721 insertions(+) create mode 100644 release-3-0-20b/WHATSNEW.txt create mode 100644 release-3-0-20b/source/Makefile.in create mode 100644 release-3-0-20b/source/VERSION create mode 100644 release-3-0-20b/source/configure.in create mode 100644 release-3-0-20b/source/include/smb.h create mode 100644 release-3-0-20b/source/nmbd/nmbd.c create mode 100644 release-3-0-20b/source/nsswitch/winbindd_misc.c create mode 100755 release-3-0-20b/source/script/installman.sh create mode 100644 release-3-0-20b/source/smbd/open.c create mode 100644 release-3-0-20b/source/smbd/posix_acls.c create mode 100644 release-3-0-20b/source/smbd/quotas.c create mode 100644 release-3-0-20b/source/smbd/server.c create mode 100644 release-3-0-20b/source/smbd/trans2.c create mode 100644 release-3-0-20b/source/wrepld/server.c diff --git a/release-3-0-20b/WHATSNEW.txt b/release-3-0-20b/WHATSNEW.txt new file mode 100644 index 00000000000..4495786eb15 --- /dev/null +++ b/release-3-0-20b/WHATSNEW.txt @@ -0,0 +1,5207 @@ + =============================== + Release Notes for Samba 3.0.20b + Oct 12, 2005 + =============================== + +This is the latest stable release of Samba. This is the version +that production Samba servers should be running for all current +bug-fixes. Please read the following important changes in this +release. + +Common bugs fixed in 3.0.20b include: + + o A crash bug in winbindd + o Reporting files as read-only instead of returning the + correct error code of "access denied" + o File system quota support defects + + +###################################################################### +Changes +####### + + +Changes since 3.0.20a +--------------------- + +commits +------- + +o Jeremy Allison + * BUG 3088: Fix error condition for files on a read-write share + which cannot be read due to permissions. + + +o Gerald (Jerry) Carter + * BUG 3070: Fix crash bug in qfsinfo when retrieving fs quota + details. + * BUG 1473, 3090: Quota detection and compilation problems on + Solaris. + + +o Marc Balmer + * Build fixes when builddir != srcdir + + +o Alex Deiter + * BUG 3145: Fix build issue regarding quota support on Solaris. + + +o Volker Lendecke + * BUG 3068: Fix for winbindd crashed by empty DC alternative + name. + + +Release Notes for older release follow: + + -------------------------------------------------- + =============================== + Release Notes for Samba 3.0.20a + Sept 30, 2005 + =============================== + +Common bugs fixed in 3.0.20a include: + + o Stability problems with winbindd. + o Crash bugs caused by incompatibilities on 64-bit systems. + o Missing files from directory listings on AIX servers + o User Manager interoperability problems. + o Minor build difficulties on various platforms such as + Solaris and OpenBSD, + + +Winbind, security = domain, and Active Directory +================================================ + +Recent security updates for Windows 2000 and Windows 2003 have +changed the fashion in which user and group lists can be obtained +from domain controllers. In short, the RPC mechanisms used by +"security = domain" to retrieve users and groups is not compatible +with these changes. The "security = ads" configuration is not +affected by the Windows protocol changes. + +Samba developers are actively working to correct this problem in +the 3.0.21 release. In the meantime, Administrators who are unable +to migrate to "security = ads" and must continue using "security = +domain", can define credentials to be used by winbindd for account +enumeration by executing the following command as root. + + wbinfo --set-auth-user='DOMAIN\username%password' + + + +###################################################################### +Changes +####### + + +Changes since 3.0.20 +-------------------- + +commits +------- + +o Jeremy Allison + * BUG 3065: Fix for legacy clients retrieving a listing of + an empty directory. + * Added external library for accessing Samba's share mode + database. + * Fix winbindd credentials chain which caused logon failures + after attempting to authenticate an unknown user. + * Fix recursive looping bug in winbindd. + * Fix build errors on 64-bit systems. + * Posix ACL memory leak and crash bug fixes. + * BUG 3044: Ensure OPEN-EXEC is honored as read-only. + * BUG 3060: Ensure SMBcreate truncates the file if it exists. + * Hide dot files and directory logic fixes. + * Correct display of open file modes by smbstatus. + * BUG 3010: Fix missing files bug on AIX systems. + + +o Gerald (Jerry) Carter + * Allow the root user to automatically pass se_access_checks() + in the registry and service control server code. + * Ensure that winbindd uses the correct name in the net_auth2() + request when running on a Samba PDC. + * Fix linking problem with tdb utilities. + * BUG 3080: Fix regression in 'net rpc shutdown' command. + * Fix segv in 'net rpc' when the pipe open fails. + * Fix upload bug when installing 64-bit Windows printer drivers. + * Fix regression in the smburi syntax used by smbspool. + * Fix sorting of subkey hash records in registry files. + * Correct REG_CREATE_KEY_EX parsing error. + * Interoperability issues with usrmgr.exe and Samba groups. + * Use the display names and not the Unix names when enumerating + groups in the ldapsam passdb backend. + * Ensure that Windows domain user names are converted to lower case. + + +o Guenther Deschner + * Prevent BUILTIN sids returned in the user's token from + a Windows DC from being applied to any local group mappings + on the Samba host. + * Plug memory leaks in the kerberos keytab code. + * Ensure BUILTIN groups are returned from winbindd's idmap_rid + backend when 'winbind nested groups' is enabled. + * Fix crash bug in winbindd caused by 64-bit build issues. + * Improve debug messages in smbspool. + * Give better error-message when "NDS Universal Password" change fails. + * Fix password history error in the eDirectory schema file. + * Ensure that Windows domain group names are converted to lower case. + + +o Steve French + * Allow disabling mandatory byte range lock mount flag, and fix + corresponding entry in mtab. + + +o Volker Lendecke + * Fix race condition in the NTcreate&X open code when the + disposition is NTCREATEX_DISP_CREATE. + * Correct logic error when checking the pid for pending print + change notify messages. + * Ensure that winbindd child process complete startup even when + the parent is receiving authentication requests. + * Return the full NTSTATUS code to ntlm_auth and pam_winbindd + when authentication fails. + + +o Jason Mader + * Compile warning fixes. + + +o Uli Meis + * Patches for pdb_*sql.c + + +o Luke Mewburn + * Autoconf syntax fixes. + + +o James Peach + * Correct problem with creating a core file in Linux. + + +o Stefan Metzmacher + * Quota fixes in smbd. + + +o Peter Rindfuss + * Patches for pdb_*sql.c + + +o Jiri Sasek + * Solaris toolchain patches for autoconf scripts. + + +o Andrew Tridgell + * Fix for tdb clear-if-first race condition. + + +o Leo Weppelman + * BUG 3104: Don't allow time updates to files on read-only shares. + + +o Steve Williams + * BUG 3052: Fix compile issues on OpenBSD. + + + -------------------------------------------------- + ============================== + Release Notes for Samba 3.0.20 + Aug 19, 2005 + ============================== + +Additional features introduced in Samba 3.0.20 include: + + o Support for several new Win32 rpc pipes. + o Improved support for OS/2 clients. + o New 'net rpc service' tool for managing Win32 services. + o Capability to set the owner on new files and directory + based on the parent's ownership. + o Experimental, asynchronous IO file serving support. + o Completed Support for Microsoft Print Migrator. + o New Winbind IDmap plugin (ad) for retrieving uid and gid + from AD servers which maintain the SFU user and group + attributes. + o Rewritten support for POSIX pathnames when utilizing + the Linux CIFS fs client. + o New asynchronous winbindd. + o Support for Microsoft Print Migrator. + o New Windows NT registry file I/O library. + o New user right (SeTakeOwnershipPrivilege) added. + o New "net share migrate" options. + + +What happened to 3.0.15 - 3.0.19? +================================== + +After some discussion it was deemed that the amount of changes +going into the next Samba 3.0 release needed something to catch +people's attention. Skipping several releases was chosen as +the best solution with the least overhead. There will be no +3.0.15 - 3.0.19 ever released. The next production release +following 3.0.20 should be 3.0.21. + +The original announcement about the version number change can +be found in the samba mailing list archives: + +http://marc.theaimsgroup.com/?l=samba&m=111721010206997&w=2 + + +Asynchronous Winbind Implementation +=================================== + +Winbindd has been completely rewritten in this release to support +an almost completely non-blocking, asynchronous request/reply +model. This means that winbindd will scale much better in +large domain environments and on high latency networks. Neither +the client interface nor the command line tools (i.e. wbinfo) have +changed in their calling conventions or syntax. However, due to +internal structure changes, it is required (more so than normal) +that you install the nss_winbind.so library included in this release. + + +Support for Microsoft Print Migrator +==================================== + +Samba 3.0.20 includes full support for migrating printers from +Windows servers or other Samba servers via the Microsoft Print +Migrator tool. Restoring printers requires a working "add printer +command" defined in smb.conf. Current support also allows +administrators to create a master list of printer drivers which +can be restored in bulk on new (or existing) Samba installations. + + +Asynchronous IO Support +======================= + +Experimental support for async IO has been added to smbd for +certain platforms. To enable this new feature, Samba must be +compiled to include the --with-aio-support configure option. +In addition, the "aio read size" and "aio write size" to non-zero +values. See the smb.conf(5) man page for more details on these +settings. + + +###################################################################### +Changes +####### + +smb.conf changes +---------------- + + Parameter Name Action + -------------- ------ + acl check permissions New + acl group control New + acl map full control New + aio read size New + aio write size New + enable asu support New + inherit owner New + ldap filter Removed + map to guest Modified (new value added) + max stat cache size New + min password length Removed + printer admin Deprecated + username map script New + winbind enable local accounts Removed + winbindd nss info New + + +Changes since 3.0.14a +--------------------- + + +commits +------- + +o Jeremy Allison + * BUG 2533: Fix incorrect directory listings for OS/2 clients. + * Ensure the old SMB search calls always ask mask_match() to + translate patterns like ????????.???. + * Split out the check_path_syntax() into a findfirst, findnext, + & wildcard versions. + * Fix checks for matching groups in an file ACL against the + user's primary and supplementary group list. + * BUG 2541: Ensure we recognize LANMAN2.1 as OS/2 and select + LANMAN2 protocol, ensure the EA size is always correctly + set on a query for a file with no EA's. + * BUG 2551: Look at the incoming flags2 flag + FLAGS2_LONG_PATH_COMPONENTS determines if a reply is + uppercased on a SMBsearch request, not the protocol level. + * Added "volume" command to smbclient that prints out the + volume name and serial number. + * Added "fix for broken SMB_INFO_VOLUME level used by OS/2. + * Add support for OS/2 Extended Attributes. + * Correctly check OpenX open modes. + * Ensure allocation size is correctly returned for OpenX. + * Only set allocation on create/truncate for nttrans. + * Fix oplock bug in trans2open() code. + * Remove unix_ERR_XXX global nastiness. + * Only do the strange DOS error for openX, not trans2open. + * Ensure SMBopen replies includes the share modes as well as + open modes. + * BUG 2581: Add size limit (in kb) to stat cache. + * Fix bug in the trans2 secondary processing. + * BUG 2601: Enforce DOS_OPEN_EXEC to mean read-only. + * Add an SMB counter per connection struct for gathering + profiling data. + * BUG 2605: Ensure smbclient doesn't perform commands if + the "chdir" fails in a scripted set. + * Ensure a 'forced group' is added to the list of effective + gids when processing ACLs. + * Refactor rpc_bind structures for better future work. + * BUG 2942: Add missing value in debug message. + * BUG 2946: Fix regressions in str[n]cmp_w) functions found + by 'mangling method = hash'. + * Fix memory leaks in the msdfs trans2 server code. + * Convert msdfs server to be talloc'd based. + * Fix up stackable vfs interface. + * Fix rpc fault when encountering an unknown rpc_bind auth + type. + * BUG 2954: More AIX 5.1 AIO compile fixes. + * Fix valgrind bug in interaction with new aio buffer (found + by Volker). + * BUG 2878: Fix Norton commander not running on OS/2 clients. + * Cleanup SAMR user info structure naming. + * BUG 2889: Fix directly listings from OS/2 clients. + * Added "acl group control" parameter. + * Add debug warning if AddPrinterEx() is called without having + an 'add printer command' defined. + * Add better log messages when modifying ldap entries. + * BUG 2829: Fix strXX_w() functions on non-x86 platforms when + when string is unaligned. + * BUG 2918: Fix SMB chaining by ensuring that deferred open + message buffer is nor reused. + * Add support for client setting capabilities to select posix + pathnames on the wire. + * Stop using C++ reserved words so that Samba can be compiled + using g++. Also allows VFS modules in C++. + * More fixes to allow better large directory scaling. + * BUG 2827: Ensure we call the vfs connection hook before + doing a vfs stat. Allows database vfs backends to initialize + with a working connection. + * BUG 2826: Ensure the correct return value for symlink and + readlink in the VFS. + * Merge handling of ASN.1 objects bigger than 64k from Samba 4. + * Added AIO support to smbd. + * Add "acl map full control", true by default, to allow people + to change mapping of rwx to full control or not. + * Transition smbd to use NTcreate&X for internal file opens. + * Add checks against the current effective group id (e.g. force + user) when testing write permissions one ACLs. + * Fix FindFirst/FindNext server code when parsing directories + on old IRIX XFS file systems (thanks to Cale Fairchild + for the debugging help). + * BUG 2644: Test for special files to be ignored was reversed. + * Ensure yield_connection() is called on all appropriate error + conditions. + * Fix EDEADLCK problem with deferred open calls. + * BUG 2622: Remove DPTR_MASK as it makes no sense. + * Fix the write cache based on some VERY good detective work + from Ingo Kilian. + * BUG 2346: Fix read-only excel file bugs. + * Don't wrap the setfsinfo call in HAVE_QUOTA as they'll just + return ENOSYS if not implemented. + * Add new CAP for POSIX pathnames. + * BUG 2703: Add NULL guard for disp_fields[0]. + * BUG 2681: With "strict allocate = yes" we now zero fill when + a file is extended. Should catch disk full errors on write + from MS-Office. + * Add "acl check permissions" to turn on/off the new + behavior of checking for write access in a directory + before delete. + * Refactor printing interface to take offset into job. + * Allow mapping of POSIX ACLs to NT perms to differentiate + between directories and files. + * Added encrypt/decrypt function for LSA secrets and trusted + domain passwords on the wire. + * BUG 2729: Resume keys are *mandatory* for a search when + listing a W2K and above server from a FATxx filesystem only. + * BUG 2735: Ensure that smbd mangles control characters in file + and directory names. + * Refactor small pieces of socket handling code (in conjunction + with Derrell). + * BUG 2698: Fix infinite listing loop in smbclient caused by + an invalid character set conversion. + * Add client code that will abort a directory listing if we + see the same name twice between packets. + * Performance improvements in trans2 qfilepathinfo code by + removing unnecessary memset() calls. + * Rewrite the RPC bind parsing functions to follow the + spec; fixes bug with 64-bit Windows XP and OS X 10.4. + * BUG 2774: Set sparse flag if needed when returning + file attributes. + * Fix errors listing directories from Windows NT clients + which caused "." and ".." to show up in explorer.exe. + * Merge of error code fixes from SAMBA_4_0 branch. + * BUG 2801: Fix regression in the "delete veto files" option. + * Fix based on work from Shlomi Yaakobovich to catch loops + in corrupted tdb files. + * Allow someone with SeTakeOwnershipPrivilege to chown the + user of a file to herself. + * Fix minor compiler warnings in printing/printing.c. + * Merge new DOS error code from SAMBA_4. + * Fix issue when non-English characters in filenames and + directories. + * Fix bogus error message in smbstatus about unknown share modes. + + +o Andrew Bartlett + * Support raw NTLMSSP authentication for Windows Vista + clients. + * Fix parallel NTLMSSP processing by removing global state. + * BUG 2684: Add per service hosts allow/deny checks for + printers when connecting via MS-RPC. + * BUG 2391: Fix segv caused by free a static pointer returned + from getpwnam(). + * Support kerberos authentication in smbd when using a keytab + and participating in a non-Microsoft Kerberos realm. + + +o Timur Bakeyev + * BUG 2546: Add support for FreeBSD EA API + * Fix detection of FreeBSD 7.x platforms in autoconf checks. + * BUG 2908: Fix string length logic error in msdfs code. + * BUG 2909: Fix typo that caused smbd to call the wrong + aio_fsync function. + + +o Ed Boraas . + * Added Linux per-socket TCP settings. + + +o Gerald (Jerry) Carter + * Added support for \svcctl pipe rpcs. + * Added 'net rpc service' subcommand for managing Win32 + services. + * Refactoring work on the rpc [un]marshalling layer and + structures. + * Verify privilege name in 'net rpc rights privileges' in + order to provide better error messages. + * Cleanup rpc structures in rpc_spoolss.h. + * Cleanups and fixes for the \winreg server code. + * Cleanup of rpc structures used by LsaEnumerateTrustedDomains. + * Fix bugs in client spoolss code after refactoring work. + * Fix Valgrind warnings of invalid reads in the spoolss + server code. + * Fixed a segv when enumerating services on a Samba host. + * Fix segv in the service control server code. + * Fix crashes in client spoolss calls caused by not checking + for a valid pointer from the caller. + * Fix regression in DeleteDriver() server routines. + * Fix dup_a_regval() when size is 0. + * Fix usrmgr.exe crash when viewing user properties at + debuglevel 10. + * Do not enumerate any privileges when 'enable privileges = no' + and log a message if a client tries. + * BUG 2872: Fix cut-n-paste error when checking pointer value + in ntlmssp_set_workstation(). + * Fix upgrade path from earlier nt*tdb files. + * Removed print handle object cache. + * BUG 2853: Don't strip out characters like '$' from printer + names when substituting for the lpq command. + * BUG 2557: Gracefully fail on unsupported SetPrinter() levels. + * Fix build issues on x86_64-linux systems caused by valgrind + headers. Thanks to Bent Vangli to the suggestions. + * Refactor spoolss client calls. + * Adding 'username map script'. + * Disable schannel on the LSA and SAMR pipes in winbindd client + code to deal with Windows 2003 SP1 and Windows 2000 SP4 SR1. + * Cleanup of winreg API functions. + * Add server stubs for RegSetKeySec() and RegGetKeySec(). + * Map generic bits to specific bits in reg_open_entry() + requests. + * Add write support to registry tdb and printing backends. + * Use tdb lookups rather than hard-coding certain registry + value names and data. + * BUG 2808: don't try to install man pages if they are not + present. + * Fix initialized variables reported by valgrind. + * Normalize key lookups in ntprinters.tdb. + * Mark "enumports command" as deprecated. + * Add missing class file for python share command example. + * Fix smbclient build issue on Solaris. + * BUG 2626: ensure that the calling_name is set to something + after parsing smb.conf (if not set via -n). + * Use "add machine script" when creating a user (ACB_NORMAL) + who has a name ending in '$' (e.g. usrmgr.exe creating + domain trust accounts). + * Add 'rid' synonym for idmap_rid IDMap module. + * Ensure that we set full access on the handle returned + from _samr_create_dom_{alias,group}() so that future + set_{alias,group}() commands succeed. + * Fix bug when looking for internal domains in winbindd + (caused winbindd_getgrgid() for local groups to fail). + * Fix query and set alias info calls (level 1 from the MMC + manage computer plug-in. + * Remove bogus log messages about unknown specversions. + * BUG 2680: copy files from an MS-DFS win2k root share + * BUG 2688: re-implement support for the -P (--port) option + * Support connecting to an 'msdfs proxy' share on a Samba + server. + * Strip the directory path from cups command line printing + defaults. + * Fix bug that prevented smbclient from creating directories + on non-dfs paths. + * Deprecate the "printer admin" parameter in favor of the + SePrintOperatorPrivilege. + * Add the capability to read and write WinNT regf registry + files. + * Implement access checks for RegOpenXXX() server calls. + * Extend registry client rpc calls. + * Add "net rpc registry" set of commands. + * Remove testprns tool. + * Ensure that printer ACLs use the specific bits as well as + the generic bits. Upgrade existing ntprinters.tdb SECDESC + records. + * Add server support for RegSaveKey() for dumping registry + trees to a regf file. + * Add "enable asu support" smb.conf parameter. + * Merge various small file changes from trunk. + * Remove "winbind enable local accounts" support. + * Remove "ldap filter" smb.conf option. + * Remove editreg utility (needs to be rewritten using regfio.c). + * Fix build failure when running 'make torture' without first + running 'make all' first. + * BUG 1261: Remove unusable libbiconv from iconv detection + in configure. + * Add new option for "map to guest". "Bad Uid" re-enables the + Samba 2.2 behavior of mapping authenticated users to the + guest account if there does not exist a valid Unix account + for the Windows domain user (based on patch from + aruna.prabakar@hp.com). + * Fix a couple of regressions after introduction of new winbindd. + * Fix smbpasswd user password change (still worked by bad error + messages) due to trying to strdup a NULL pointer. + * Implement default security descriptors for the + OpenService[Manager]() calls and check requested access mask + at connect time. + * Include access checks on handle mask for \svcctl operations + such as ControlService() and StartService(). + * Implement simulated start and stop service control for + the spooler service as a per smbd service state value. + * Add interface structure for controlling service via rc.init + scripts (incomplete). + * Convert move_driver_to_download_area() to use copy_file() + rather than moving the files. + * Add version number to registry.tdb file since it can be + modified now. + * Remove over-paranoid assert() call when checking spoolss + buffer pointers + * Fix error in EnumPrinterData() reported by valgrind. + * Fix broken help links in SWAT editor caused by new doc layout. + * Ensure that a domain structure in winbind is initialized prior + to assigning the methods for communicating to a DC. + * BUG 3000: Remove background updates of winbind cache and allow + child processes to immediately update and expired cache entry. + + +o David.Collier-Brown + * Added panic action script for Solaris. + + +o Jeremy Cooper + * Added support for several new \winreg client rpcs. + + +o + * BUG 2792: Ensure the shadow copy module hooks seekdir, + telldir, rewinddir to match updated large directory code. + + +o Guenther Deschner + * Close handles on group creation in rpcclient to better + support mass group account creation. + * Fix account policy key lookup for minimum and maximum + password lengths. + * Fix some compiler warnings and add missing exclude-block + in 'net rpc share migrate'. + * Allow use of a non-default smb.conf by rpcclient. + * Fix querydispinfo search semantics in rpcclient test code. + * Fix querydispinfo server semantics to allow to list more + then 511 users. + * Fix server crash bug in ancient OpenPrinter() call. + * Fix a crash bug when enumerating privileges via the LSA + calls. + * Fix crash in EnumPrinterKey() client calls caused by previous + refactoring work. + * Various compiler warning fixes. + * Fix segfault in the client AddPrinterEx-call of 'net + rpc printer'. + * Fix build issues when --with-aio-support is enabled. + * BUG 2502: Removed the deprecated 'min passwd length parameter'. + * Honour the CC environment variable in python build. + * Fix searches in pdb_ldap for inter-domain trust accounts. + * Don't expand the %L in %LOGONSERVER% from user attributes. + * Fix bug in 'net rpc vampire' that caused accounts to be created + with no assigned ACB flags. + * Fix enumeration of builtin-aliases. + * Avoid unset rids for builtin-aliases. + * Add 'recycle:touch_mtime = true' vfs option for the recycle bin. + * More "net rpc share migrate" fixes. + * Merge PADL's idmap_ad plugin (taken from the latest + xad_oss_plugins-tarball). + * Add support for "idmap backend = ad" when "security = ads". + * Add home directory and shell support from AD via "winbindd nss + support = sfu" and "security = ads". + * Provide better feedback when we fail share-manipulation + due to missing scripts. + * Correctly substitute "\" as default winbind separator in + generate_parm_table.py example share command script. + * Document pam_winbind.c to clarify the working status of + require-membership-of option. + * Added client-support for various lsa_query_trust_dom_info() + calls and a rpcclient-tester for some info-levels. + * Add "net rpc trustdom vampire" tool (in conjunction with + Lars Mueller). + * Add missing cli_srvsvc_net_share_set_info-function and + rpcclient-testers (in preparation for net share acl migration). + * Print trusted domain passwords returned via rpcclient in + display charset. + * Error code fixes when attempting to manipulating + non-existent shares. + * Cleanup "net share migrate" code. + * Allow to touch mtime in vfs-recycle with "recycle:touch_mtime + = true". + * Allow admins to uncheck the "User must change Password at + next Logon" checkbox in User manager (merge from trunk). + + +o Renaud Duhaut + * BUG 1040: Add directory_mode parameter when creating recycle + directories. + + +o Steven Edwards . + * Use chsize() if we don't have ftruncate(). + + +o Rodrigo Fernandez-Vizarra + * BUG 1780: Add kerberos (file based ticket cache) support + to smbspool. + + +o Steve French + * Update list of mount options for mount.cifs. + * Add more defines for POSIX extensions to match the newly + added client implementation. + * Add initial support for cifs umount utility. + * Fix cifs mounts to handle commas embedded in prompted + password, and password and credential files. + * Fix cifs mounts to handle domain name and user name in + username field (in form domain\user). + * Add missing error code mappings when a client unsuccessfully + tries to create a hard-link. + * Add support so umount.cifs can update mtab. + * Add two newer mount options to syntax help for mount.cifs. + * Add missing remount flag handling. + * Allow domain= to be specified in credentials file. + * Fix umount.cifs help, allow root to unmount someone else's + mount. + * Lock mtab when updating it during umount.cifs, also delete + only one matching entry at a time. + * Fix minor compiler warnings in the mount.cifs helper. + + +o Deryck Hodge + * BUG 2137: Encode quotes for display in HTML (original patch + from Jay Fenlason). + + +o Olaf Imig + * BUG 1998: Correct byte ordering bug when storing 16-bit RAP + print job ids. + * BUG 2653: Fix segv in rpcclient OpenPrinterEx() call. + + +o Björn Jacke + * Added ioctl constants reported by msbackup.exe and filemon.exe. + + +o Kevin Jamieson + * BUG 2819: Fix typo when checking for ".." in smbd's statcache. + + +o John Janosik + * BUG 2077: Correctly fill in the correct server name when + processing trusted domain logins. + * BUG 2976: Mark logons for unknown domains with a + non-authoritative response. + + +o William Jojo + * AIX AIO fixes. + + +o Guenter Kukkukk + * BUG 2541: Fix copying of file(s) from samba share to an OS/2 + local drive. + + +o Tom Lackemann + * BUG 2242: Patch to ensure that we only set the security + descriptor on an NTtransact create if we created the file. + + +o Volker Lendecke + * Port some of the non-critical changes from HEAD to 3_0. + The main one is the change in pdb_enum_alias_memberships + to match samr.idl a bit closer. + * Close handles on user creation in rpcclient to better + support mass user account creation. + * Implement client RAP calls for enumusers/enumgroups level 0. + * Implement a new caching API for enumerating the pdb elements. + * Convert the RAP user and group enumeration functions to the + utilized the pdb_search API. + * BUG 2438: Partial fix for 'net rpc trustdom establish' in + RestrictAnonymous environments. + * Internal passdb API changes for better search capabilities + (based on original work by Guenther Deschner). + * Fix various compiler warnings. + * Add chain length statistics to tdbtool. + * Fix set afs ACL calls on files and directories in the root of + a share. + * Refactoring work on internal open code + * Correctly initialize the version in a new set of nt*tdb files. + * Remove smb_run_idle_events() from main process loop in smbd + and instead rely upon the timeout processing to handle + dropping idle LDAP connections. + * Fix the bug where users show up as trusting domains. + * Fix an assertion failure in winbindd. + * Fix a memleak in vfs_afsacl. + * Various compiler warning fixes. + * Fix compile when --enable-socket-wrapper is defined. + * Fixes for top level acls in vfs_acl.c. + * Refactor passdb interface functions. + * Compile fixes when '#define PARANOID_MALLOC_CHECKER 1'. + * Correct 2 segv's in "net rpc printer migrate". + * Return correct group type from smbd for BUILTIN groups. + * Backport the talloc() layer from Samba 4. + * BUG 2701: Fix segv in ldap reconnection code. + * BUG 2705: Fix segv when connecting from usrmgr.exe. + * Use the SID in the user token for the %s expansion in 'afs + username map'. + * Memory leak fixes in passdb code. + * BUG 2720: Fixes for "net usersidlist". + * BUG 2725: Fix segv in "net ads user". + * Only allow schannel connections if a successful Auth2 + has been previously performed. + * Don't look at gencache.tdb for the trusted domains if + winbind is present. + * Rewrite winbindd using an asynchronous process model. + + +o Herb Lewis + * Compiler warning cleanups. + * smbwrapper Makefile and compile time check cleanups. + * Adding robustness checks for tdbdump and tdbtool. + * Extend tdb command line parsing to arbitrary hex characters. + * Add LOCKING debug class. + * Fix more compiler warnings. + + +o Derrell Lipman + * add support for opening a file for write with O_APPEND + in libsmbclient. + * Added smbsh/smbwrapper for Linux to example/libsmbclient + tree. + * Fix smbc_stat() from returning incorrect timestamps IFF + it used cli_qpathinfo2() to retrieve the timestamps (Win2k) + and not if it used cli-getatr() to retrieve the timestamps + (Win98). + * Fix handful of compiler warnings. + * BUG 2498, 2484: smbc_getxattr() fixes. + * BUG 1133: Added provision for overloading some global + configuration options via the new, per-user file + ~/.smb/smb.conf.append. + * BUG 2543: Properly cache anonymous username when reverting + to anonymous login, in libsmbclient. + * BUG 2505: Fix large file support in libsmbclient. + * BUG 2564: Ensure correct errno when smbc_opendir() was called + with a file rather than a directory. + * Correct deprecated lvalue casts in testsuite/libsmbclient. + * BUG 2663. cli_getattrE() and cli_setattrE() were not + formatting or parsing the timestamp values correctly. + * Correctly detect AF_LOCAL support in configure. + * Fix problem updating file times on Windows 98 hosts using + libsmbclient. + * Fix compile breakage on Solaris by eliminating the use of + ctime_r() in libsmbclient DEBUG statement. + + +o Jason Mader + * BUG 2483, 2468. 2469, 2478, 2093: Compiler warning fixes. + * Various compiler warning fixes about mistyped variables. + * BUG 2882, 2885, 2890, 2891, 2900: Various compiler warning fixes + and code cleanups. + * BUG 2527, 2538: Removed unused variables. + + +o Marcel + * Fix regression in OS/2 trans2 open code. + + +o Jim McDonough + * Fixes for samr_lookup_rids() when using ldapsam:trusted=yes + (in conjunction with Volker). + * BUG 2953: Prevent the credentials chain on DC gets out + of sync with client when NT_STATUS_NO_USER is returned. + * Added subcommands to "net rpc vampire" (mostly done by Don + Watson ) to allow data to be put into an + ldif file instead of actually writing to the passdb. + * BUG 2736: Add retries to workaround winbind race condition + with detecting idle clients. + * BUG 2953: Additional fixes for domain trusts. Also clears + up the "bad stub" error when attempting to logon to a Samba + domain with a bad username. + + +o Luke Mewburn + * Compiler warning fixes. + + +o Kalim Moghul + * Removed unused printmode command from smbclient. + + +o Lars Müller + * Re-enable the VERSION_REVISION option in case of another + letter release. + * Fix spoolss python bindings after C++ compiler changes and + other python fixes. + * BUG 2659: Don't trump on memory in smbtorture. + * BUG 2060: Add -fPIC which is the case for all other Samba + shared libs. + * Fix argv parsing in "net rpc". + * Add support to create position independent executable (PIE) + code if the compiler supports it. + * BUG 2767: Add new options to testparm (--show-all-parameters, + --parameter-name, and --section-name). + * Fix net share migrate files to also migrate the ACLs of + the top level dir of a share. + + +o Marcel Muller + * Patch to fix the OS/2 EA_FROM_LIST info level call. + * Mangled names fix for OS/2 clients. + * Ensure we correctly set the return packet size to include the + pad bytes in reply_readbmpx(). + * Fix for bug in SMBwriteBraw that incorrectly returned the + number of bytes written. + + +o Ricky Nance + * Implemented mklogon script generator for domain logon scripts. + + +o James Peach + * BUG 1843: Fix quotas (with no soft limits) on IRIX. + * BUG 2285: Patch for hires timestamps and efficient notify code. + * MS-DFS tidyup patches. + * Build fixes on IRIX. + * IRIX compiler warning fixes. + * BUG 2596: Fix become_root link issues and one IRIX stack + backtrace bug. + * Fix for null pointer ACL free. + * BUG 2314: Fix const compiler warnings in the quota code. + + +o Ed Plese + * Fix faulty logic which caused winbindd to return failure + when a user possessed no supplementary groups. + + +o Marcin Porwit + * Initial support for the \eventlog pipe. + * Fix a memleak in the eventlog code. + * Miscellaneous fixes for Samba's experimental event log support. + * Add ServiceQueryConfig2() and ServiceQueryStatusEx() server + calls. + + +o Tim Potter + * BUG 2940, 2943: Fixed various compiler warnings regarding + mismatched types and unused variables. + * BUG 1888, 1894: Fix warnings when time_t is an unsigned type. + * BUG 2733: Fix incorrect SHLIBEXT is set when running + configure script on HPUX IA. + * Remove unused autoconf #define's. + * BUG 2893: Fix inverted assignment in 'net rpc printer' code. + * Removed unused function declarations in tdb.h. + * BUG 2895: Don't wrap non-existent functions in the python + tdb bindings. + * BUG 2623, 2630: $< and $* are not valid in explicit rules + according to POSIX. + * BUG 2560: Fix compile error lurking where PATH_MAX is not + defined. + * BUG 2625: Remove configure check for FTRUNCATE_NEEDS_ROOT. + * BUG 2611: Add fflush(stdout) after displaying username prompt + in smbsh if username not specified on command line. + * BUG 2699: Fix for segfault in samba.winbind.auth_crap module + * BUG 2808: Update install swat message to reflect the fact + that swat/README no longer exists. + + +o Denis Sbragion + * BUG 2196: Allow absolute path (system wide) recycle bin. + + +o Fernando Schapachnik + * Add logon hours support for the Postgres backend. + + +o Richard Sharpe + * Fix bug in profiles tool caused by use of MAP_PRIVATE. + +o Joerg Sonnenberger + * BUG 2362: Quota support fix for DragonFly. + * Fix dragonfly detection in configure. + + +o Simo Sorce + * Allow Domain Admins to force user sessions to close via the + Windows Server Manager. + * Add support to 'net rpc right privileges ' to enumerate + accounts which possess a specific privilege. + * Fix memory issues issues in vfstest (reported by Rainer Link). + * Randomize reloading as to not overload cupsd. + + +o Smitty + * Compile fixes for smbget when using --enable-developer. + * Include LUID values to match Windows privileges since + apparently this matters to printmig.exe + + +o John Terpstra + * Solaris packaging fixes. + * Clean up usage help text in "net rpc user" + + +o Andrew Tridgell + * Merge socket wrapper library fixes from Samba 4. + + +o Brett Trotter + * Fix definition of global_sid_* in vfs_acl.c. + + +o Mark Weaver + * Patch to fix sys_select so it can't drop signals if another + fd is ready to read. + + +o Jelmer Vernooij + * Remove --with-manpage-languages configure option. + * Merge socket wrapper fixes for IRIX systems from the + Samba 4 branch. + * Add socket_wrapper library to 3.0. Can be enabled by passing + --enable-socket-wrapper to configure. + * Fix build of the various sql pdb backends after new talloc. + + +o Qiao Yang + * Use our own DC when getting the SID for a domain. + + + +Release Notes for older release follow: + + -------------------------------------------------- + =============================== + Release Notes for Samba 3.0.14a + Apr 14, 2005 + =============================== + +Common bugs fixed in 3.0.14a include: + + o Compatibility issues between Winbind and Windows 2003 SP1 + domain controllers (*2k3sp1*). + o MS-DFS errors with Windows XP SP2 clients. + o High CPU loads caused by infinite loops in the FindNext() + server code. + o Invalid SMB_ASSERT() which caused smbd to panic on ACL'd + files. + + +###################################################################### +Changes +####### + +Changes since 3.0.14 +-------------------- + +commits +------- +o Jeremy Allison + * Fixed invalid SMB_ASSERT() triggered by checking access on + ACL'd files. + + +Changes since 3.0.13 +-------------------- + +smb.conf changes +---------------- + + Parameter Name Action + -------------- ------ + dos filetimes Enabled by default + + +commits +------- +o Jeremy Allison + * Prevent nt_status code support when negotiating protocols + earlier than NT1. + * BUG 2533: Remove the UNICODE flags2 bit from SMBsearch calls + as this SMB is DOS codepage only. + * BUG 2585: Fix printf() issues in smbpasswd which caused + seg faults. + * BUG 2563: Fix infinite loop on non-existent file with + FindNext(). + * BUG 2581 (partial): Ensure if realloc fails on an internal + tdb we fail gracefully. + * Ensure that 'dos filetimes' works with ACLs. + * Set 'dos filetimes = yes' as the default for smb.conf. + + +o Gerald (Jerry) Carter + * Workaround autoconf issue to prevent debug symbols from + being included in the default build. + * Disable schannel on the \lsarpc pipe in order to successfully + enumerate users and groups (*2k3sp1*) + * Fix parsing error in rpc binds which broke NTLMSSP + authentication. And as a result broke CTL+ALT+DEL password + changes from a Windows 2003 SP1 member of a Samba domain + (*2k3sp1*). + * Revert change to FindFirst() server code that broke WinXP + SP2 clients from launching *.exe files from a dfs target + share. + * BUG 2588: Force smbclient to send netbios messages to port + 139 unless otherwise instructed (based on patch from Thomas + Bork). + + +o Volker Lendecke + * Fix build on FreeBSD 4 where Winbind is not supported. + * Fix 'wbinfo --user-sids' when using domain local groups. + * Restrict domain local groups reported by 'wbinfo -r' to + the Samba server domain and not the users domain. + + +o Lin Li + * Ensure that winbind initializes internal trusted domain + structures when enumerating users and groups. + + +o Tim Potter + * BUG 2565: Fix crash bug and compiler warnings in strchr_m() + test. + * Fix compiler warnings. + + +o + * Fix for possible root squash NFS bugs. + + +o Simo Sorce + * Debian packaging fixes. + + + -------------------------------------------------- + ============================== + Release Notes for Samba 3.0.13 + Mar 24, 2005 + ============================== + +Common bugs fixed in 3.0.13 include: + + o Infinite FindNext() loop from Windows 9x client when + copying or deleting files on a Samba file share using + explorer.exe. + o Numerous smbclient bugs when listing directories. + o Failures in smbclient when connecting to a Windows 9x + file server. + + +###################################################################### +Changes +####### + +Changes since 3.0.12 +-------------------- + +o Jeremy Allison + * Fix typo bug in smbclient where flags overwrote info level + in the cli_list_new(). + * Fix old smbclient bug where ff_searchcount was being compared + to -1 resulting in processing a filename twice. + * Fix segv in smbclient caused by overwriting the last 2 bytes + in cli_list_new(). + * BUG 2530: Fix potential segv in smbclient when talking to a + Windows 9x file server. + * Fix last entry offset in cli_list_new() when using a + FindFirst/FindNext info level of 0x104. + * BUG 2501: Stop Win98 from looping doing FindNext on a + singleton directory. + * BUG 2521: Fix error in access checks when user group ACLs. + + +o Gerald (Jerry) Carter + * BUG 2497: Fix bug in rpcclient's deletedriverex when asking + to delete all versions of a driver. + * BUG 2517: use the realm from smb.conf for 'net ads info' when + 'disable netbios = yes'. + * BUG 2530: Ensure that smbclient correctly detects MS-DFS root + shares. + * Update RedHat packaging files to require cups support. Also + remove requirement for 'idmap {uid,gid}' settings in smb.conf + from winbindd init script. + * BUG 2516: fix compile issue on True64. + + + +o Guenther Deschner + * Check for the correct cli-struct when copying files in 'net + rpc printer' routines. + + +o Herb Lewis + * Fix incorrect test in 'net rpc user' when the user is not + a member of any groups. + + +o Jim McDonough + * Make sure that enum_group_members() searches the correct suffix. + + + -------------------------------------------------- + ============================== + Release Notes for Samba 3.0.12 + Mar 18, 2005 + ============================== + +Common bugs fixed in 3.0.12 include: + + o Winbind failures when using 'disable netbios = yes' + o Failure to establish a trust relationship via 'net rpc trust + establish' + o Various portability & compiler issues. + o Read only file deletion failure caused by new delete semantics + in Windows XP SP2 and the MS 04-044 security hotfix. + o Error messages from shared Excel workbooks residing on Samba + file shares. + o Missing files in the output of smbclient -c 'dir' when run + against Windows file servers. + o Inability for Print Administrators to pause/resume/purge print + queues. + +Additional features introduced in Samba 3.0.12: + + o Performance enhancements when serving directories containing + large number of files. + o MS-DFS support added to smbclient. + o More performance improvements when using Samba/OpenLDAP based + DC's via the 'ldapsam:trusted=yes' option. + o Support for the Novell NDS universal password when using the + ldapsam passdb backend. + o New 'net rpc trustdom {add,del}' functionality to eventually + replace 'smbpasswd {-a,-x} -i'. + o New libsmbclient functionality. + + + +======================= +Large Directory Support +======================= + +Samba 3.0.12pre1 introduces a specific mechanism for dealing +with file services that frequently contain a large number of files +per directory. Historically Samba's performance has suffered +in such environments due to the translation from case +insensitive lookups by Windows client to the case sensitive +storage mechanisms used by UNIX filesystems. + +Configuration details along with a short HOWTO can be found at: + +http://www.samba.org/samba/ftp/HOWTO/Samba-LargeDirectory-HOWTO + + +================================== +libsmbclient Binary Compatibility +================================== + +Please note that a change has been made to the _SMBCCTX structure +in source/include/libsmbclient.h. This change is not backwards +compatible with applications linked against the libsmbclient.so +library from Samba 3.0.11. However, it is compatible with all +other Samba 3.0.x releases. This means that it will be most likely +be necessary to recompile any applications linked against the +3.0.11 version of the library. + + +###################################################################### +Changes +####### + +smb.conf changes +---------------- + + Parameter Name Action + -------------- ------ + allocation roundup size New + log nt token command New + write cache Deprecated + + + +Changes since 3.0.11 +-------------------- + +commits +------- +o Jeremy Allison + * BUG 2146: Return correct allocation sizes so as not to crash + the VC++ compiler. + * BUG 962: Ensure that parsing of service names in smb.conf is + multibyte safe. + * BUG 2201, 2227: Support new delete semantics used by MS04-044 + and XP SP2. + * BUG 1525: Correctly timestamps interpreted on 64-bit time_t + values (patch submitted by Jay Fenlason ). + * Add special hooks when serving directories containing large + numbers of files. + * Ensure that WINS negative name query responses and WACK + packets use the correct RR type of 0xA instead of reflecting + back what the query RR type was (0x20). + * BUG 2310: Only do 16-bit normalization on small dfree request. + * BUG 2323: Correct authentication failure when using plaintext + passwords from Windows XP clients. + * BUG 2146: Add new smb.conf option 'allocation roundup size' to + work around issues building MS Visual Studio 6.0 project + on a Samba file share while restoring the pre-3.0.21pre1 + behavior by default. + * BUG 2399 (partial): Ensure we use SMB_VFS_STAT instead of + stat when checking for existence of a pathname. + * Check the sticky bit on the parent directory for supporting + the new WinXP SP2 file deletion semantics. + * Various oplock, share mode, and byte range locking fixes + found by Connectathon tests. + * BUG 2271: Fix resume key issues in trans2FindFirst() client + code (inspired by patch from Satwik Hebbar). + * BUG 2382, 2045: More pending modtime and delayed write fixes + for MS Excel (incorporates partial patches from + ke_miyata@itg.hitachi.co.jp). + * Debug log message cleanups. + * Add case insensitive search for a principal match on logon + verification in the system keytab (based on patch by + Michael Brown ). + * Revert the previous SMB signing change from Nalin Dahyabhai + when using DES keys. + * Add missing RESOLVE_DFSPATH() calls for older SMB commands. + * Fix FindFirst() server code to deal with resume names of ".." + and "." (found by Jim McDonough). + * BUG 2451: Fix missing functions in full audit VFS module. + * Ensure that smbd logs failures reported by DISK_FREE() + (reported by Ying Li ). + * Ensure that smbclient obeys the max protocol argument again. + * BUG 2335: Return correct error code for OS/2 clients (based on + negotiated protocol level). + * BUG 2460, 2464: remove dead code and unused variables + (reported by Jason Mader). + + +o Andrew Bartlett + * Avoid length-limited intermediate copy of NT and LM responses + in NETLOGON client. + * Debug message cleanups in the NTLMSSP implementation. + + +o Manuel Baena + * Print actual error message in smbmnt.c:fullpath(). + + +o Vince Brimhall + * Add support for Novell NDS universal password. + * BUG 2424: Ensure that uidNumber and gidNumber use match + the RFC2307 schema. + * BUG 2453: Change the way pdb_nds.c handles users with no + Universal or Simple Password. + * NDS schema file corrections. + + +o Gerald (Jerry) Carter + * Add trans2 client call for checking dfs referrals + * Convert smbclient to use TRANS_QPATHINFO(SMB_QUERY_FILE_BASIC_INFO) + when checking directories on modern CIFS servers. + * Add MS-DFS support to smbclient. + * Code cleanup of adt_tree.[ch]. + * Add missing checks to allow root to manage user rights. + * Allow domain admins to manage rights assignments on domain members + servers. + * BUG 2333: Use the lpq command to pass in the correct printer name + for cups_queue_get(). CUPS backend now sets 'lpq command= %p' as + the default. + * BUG 1439: make sure to initialize pointer to prevent invalid + free()'s on exit. + * BUG 2329: fix to re-enable winbindd to locate DC's when 'disable + netbios = yes'. + * Add cups-devel to BuidlRequires directive in Fedora spec file. + * BUG 858: Fix order of popt args evaluation so we don't crash + when given no command line args. + * Remove dependency on bash for source/autogen.sh. + * Fix clitar.c compile issues caused by broken MIT 1.4 headers. + * Implement MS-DFS for recursive directory listings in smbclient. + * BUG 2394: Fix nmbd linking issue on IRIX. + * Only display the publish check box in the client's printer + properties dialog if we are a member of an AD domain. + * BUG 2363: allow 'in use' driver to be removed as long as + one 'Windows NT x86' driver remains. + * BUG 1881: Allow PRINT_SPOOL_PREFIX to be set in local.h for + porting purposes. + * Enforce better printer.tdb cache consistency when removing + jobs from a print queue via SMB. + * Ensure that pause/resume/purge print queue commands are run + with the appropriate level of privilege necessary to actually + work. + * BUG 2355: Use bsd style commands (lpq, lpr, etc...) for default + for 'printing = cups' installations that do not actually have + libcups. + * BUG 2425: Remove incorrect checks for Win98 DFS clients. + * BUG 2215: Rewrite questionable code that was causing gcc to + choke. + * Add server support for LsaLookupPrivValue(). + * Various small compile fixes and cleanup warnings. + * BUG 2456: Fix compile failure on non-gcc platforms due to + non-standard pragma. + + +o Kevin Dalley + * BUG 2398: Don't force smbclient to assume a dry run if the + target tarfile is /dev/null. + + +o Guenther Deschner + * Fix crash bug in the client-spoolss enumdataex-call. + * Expand the valid-workstation-scheme by expanding names + beginning with a plus (+) as a unix group. + * Allow own netbios name to be set in smbclient's session setup. + * Better handling of LDAP over IPC connections that have expired + on the LDAP-Server. + * Fix pipe-mismatch for NETDFS in cli_dfs.c. + * Add examples/misc/adssearch.pl. + * BUG 2343: Build fixes. + * Support get_user_info_7 in SAMR server RPC. + * Fix server_role in the samr_query_dom_info calls. + * Add example perl script to check for multiple LDAP entries + after running 'net rpc vampire'. + * Add more output when listing printer forms via rpcclient. + * Debug log message cleanup. + + +o Steve French + * On failed mount (ENXIO) retry share name in uppercase (fix + mount to FastConnect AIX SMB server). + * Add missing FILE_ATTRIBUTE_XXX defines to smb.h. + * Ignore user_xattr mount parm (mount.cifs) so as not to confuse + it with a user name. + * Update for new CIFS POSIX info levels. + * Ignore users mount parm in mount.cifs. + +o SATOH Fumiyasu + * BUG 1549: Don't truncate service names in smbstatus. + + +o William Jojo + * BUG 2445: Patch to avoid default ACLs on AIX. + + +o S Murthy Kambhampaty + * Add idmap_rid module to Fedora and RedHat spec files. + + +o Volker Lendecke + * BUG 2401: Flush internal getpwnam() cache after deleting a + user. + * BUG 1604: Make winbind work with more than 10 trusted domains. + * Cleanup various compiler warnings. + * Fix a memory leaks in privileges code and passdb backends. + * Fixes for samr_lookup_sids() client call. + * Optimize _samr_query_groupmem with LDAP backend for large + domains. + * Support SIDs as %s replacements in the afs username map + parameter. + * Add 'log nt token command' parameter. If set, %s is replaced + with the user sid, and %t takes all the group sids. + * Do not use the "Local Unix Group"-default description for + all kinds of group-mappings. + * Fix uninitialized variable in Linux nss_winbind library. + * Move 'net afskey' into a subcommand of its own, 'net afs key'. + * Implement 'net afs impersonate'. + + +o Herb Lewis + * Fix build problem when HAVE_POSIX_ACL is not defined. + * BUG 2417: Add help lines for net rpc group addmem and + delmem commands. + + +o Derrell Lipman + * Add support to libsmbclient for getting and setting DOS + attributes using EA functions. + * Fix libsmbclient's URL encoding/decoding. + * Replace browse listing URI queries with an internal options + structure (previous method violated the SMB URI syntax). + * Allow tree connects to be multiplexed over a single CIFS server + connection context. + * Ensure that cli_tdis() sets the cnum field to -1 so that callers + can determine a dead tree connection. + * Implement better solution for backwards binary compatibility + in libsmbclient while adding new fields to struct _SMBCCTX. + + +o Mark Loeser + * BUG 2443: Compile fix for gcc4. + + +o Jim McDonough + * BUG 2338: Fix coredump when OS/2 checks for long file name + support (with .+,;=[].) (thanks to Guenter Kukkukk). + + +o Jason Mader + * Compiler warning fixes (BUGS BUG 2132, 2134, 2289, 2327, 2340, + 2341, 2342) + + +o Jim McDonough + * Fixes for server schannel implementation when 'restrict + anonymous = 1' is set in smb.conf. + * Fix bug in server side lookupsids reply that crashed lsass.exe + on Windows clients. + * Fix 'net rpc trustdom establish'. + * BUG 2062: Turn off broadcast for all 390 NICs. + * Fix 'net rpc trustdom add' to correctly add new domain trust + accounts. This will eventually replace 'smbpasswd -a -i'. + * Implement 'net rpc trustdom del', including client side of + samr_remove_sid_from_foreign_domain. + * Bring IBM Directory Server schema up to date with openldap + schema. + * Allow for better protection of sensitive attributes in IBM + Directory Server. + + +o Stefan Metzmacher + * Fix memleaks in the nttrans code. + + +o Mike Nix + * Add SMBsplopen and SMBsplclose client calls. + + +o Justin Ossevoort + * BUG 2316: Fix crashes in pdb_pgsql. + + +o James Peach + * Fixes in string handling code. + * Fix oplock2 test in client smbtorture. + + +o Tim Potter + * Fix up example pdb modules after prototype change for + setsampwent. + * BUG 2058: Fix for shared object creation in examples. + * BUG 2315: Fix segv in LSA privileges server code. + * Build fixes for python wrapper libraries. + + +o Richard Sharpe + * BUG 2044: Fix segv in profiles tool. + * Fix bogus error messages when enumerating user group + membership via 'net rpc'. + + +o Simo Sorce + * Debian packaging fixes. + + +o John Terpstra + * Add the capability to set account description using pdbedit. + + +o Doug VanLeuven + * Add more case/realm/name permutations to the kerberos keytab. + * AIX compile fixes. + + +o Jelmer Vernooij + * BUG 892: Default unknown_6 field to 1260 in mySQL pdb module. + * BUG 1957: Implement minimal update of fields in mySQL pdb + module. + + +o Torsten Werner + * BUG 2405: Define 'lpstat' printcap output on HPUX. + + +o Shlomi Yaakobovich" + * Detect infinite loops when traversing tdbs. + + + -------------------------------------------------- + ============================== + Release Notes for Samba 3.0.11 + Feb 5, 2005 + ============================== + +Common bugs fixed in 3.0.11 include: + + o Crash in smbd when using CUPS printing. + o Parsing error of other SIDs included in the user_info_3 + structure returned from domain controllers. + o Inefficiencies when searching non-AD LDAP directories. + o Failure to expand variables in user domain attributes + in tdbsam and ldapsam. + o Memory leaks. + o Failure to retrieve certain attribute when migrating from + a Windows DC to a Samba DC via 'net rpc vampire'. + o Numerous printing bugs bugs including memory + bloating on large/busy print servers. + o Compatibility issues with Exchange 5.5 SP4. + o sendfile fixes. + +Additional features introduced in Samba 3.0.11: + + o Winbindd performance improvements. + o More 'net rpc vampire' functionality. + o Support for the Windows privilege model to assign rights + to specific SIDs. + o New administrative options to the 'net rpc' command. + + +============ +LDAP Changes +============ + +If "ldap user suffix" or "ldap machine suffix" are defined in +smb.conf, all user-accounts must reside below the user suffix, +and all machine and inter-domain trust-accounts must be located +below the machine suffix. Previous Samba releases would fall +back to searching the 'ldap suffix' in some cases. + + +=============== +Privilege Model +=============== + +Samba 3.0.11 supports the following assignable rights + +SeMachineAccountPrivilege Add machines to domain +SePrintOperatorPrivilege Manage printers +SeAddUsersPrivilege Add users and groups to the domain +SeRemoteShutdownPrivilege Force shutdown from a remote system +SeDiskOperatorPrivilege Manage disk shares + +These rights can be assigned to arbitrary users or groups +via the 'net rpc rights grant/revoke' command. More details +of Samba's privilege implementation can be found in the +Samba-HOWTO-Collection. + + +###################################################################### +Changes +####### + +Changes since 3.0.10 +-------------------- + +smb.conf changes +---------------- + + Parameter Name Action + -------------- ------ + afs token lifetime New + enable privileges New + ldap password sync Alias + min password length Deprecated + winbind enable local accounts Deprecated + + +commits +------- +o Jeremy Allison + * Extend vfs to add seekdir/telldir/rewinddir. + * Fix dirent return. + * Fix bugs when handling secondary trans2 requests. + * Implementation of get posix acls in UNIX extensions. + * Added set posix acl functionality into the UNIX extensions code. + * Updated config.guess/config.sub . + * Fix error reply when 'follow symlinks = no'. + * BUG 1061, 2045: Only set mtime from pending_modtime if it's + not already zero. + * Fixes for LARGE_READX support. + * Fix the problem we get on Linux where sendfile fails, but we've + already sent the header using send(). + * BUG 2081: Ensure SE_DESC_DACL_PROTECTED is set if 'map acl + inherit = no'. + * BUG 2088: Ensure inherit permissions is only applied on a new + file, not an existing one. + * Don't go fishing for the krb5 authorization data unless we know + it's there. + * Fixes for libsmbclient to ensure that interrupted system calls + are restarted minus the already expired portion of the timeout + (based on work by Derrell Lipman). + * More Unicode string parsing fixes. + * Convert the winreg pipe to use WERROR returns. + * Make all LDAP timeouts consistent (input from Joe Meadows + ). + * BUG 2231: Remove double "\\" from client findfirst. + * BUG 2238: Fix memory leak in shadow copy vfs. + * Return correct DOS/NT error code on transact named pipe on + closed pipe handle. + * BUG 2211: Fix security descriptor parsing bug (based on work by + Mrinal Kalakrishnan ). + * BUG 2270: Fix memory leaks in cups printing backend support + (based on work by Lars Mueller). + * BUG 2255: Fix debug level in kerberos error messages. + * BUG 2110: Ensure we convert to ucs2 correctly after the + CAN-2004-0930 patch. + * Make strict locking an enum. Auto means use oplock optimization. + * Fix client & server to allow 127k READX calls. + * More *alloc fixes (includes additional fixes by Albert Chin. + * Catch sendfile errors correctly and return the correct values + we want the caller to return. + * BUG 2092: Prevent auto-anonymous logins via libsmbclient + for better use by desktop environments such as GNOME. + * Ensure we can't remove a level II oplock without having the + shared memory area locked. + + +o Timur Bakeyev + * BUG 2100: change the way we check for errors after a dlopen(). + * BUG 2263: Guard base64_encode_data_blob() against empty blobs. + + +o Andrew Bartlett + * Clarify error message when 'lanman auth = no'. + * Remove the unnecessary UTF-8 conversion calls in the calls to + auth_winbind from smbd. + * Don't store the auth-user credentials with the cli_state* as + this can cause the schannel setup to fail when the auth-user + domain is not our primary domain. + + +o Grigory Batalov + * Fix encoding while receiving of a message which was actually + sent using STR_ASCII. + + +o Daniel Beschorner + * BUG 603: Correct access mask check for _samr_lookup_domain() + to work with Windows RAS server + + +o Jerome Borsboom + * Fix missing printer_tdb reference decrement. + + +o Gerald (Jerry) Carter + * BUG 2073: fall back to smb_name if current_user_info is not + available in lp_file_list_changed(). + * Fixes the spurious 'register_message_flags: tdb fetch failed' + errors. + * Don't run the background LPQ daemon when we are running in + interactive mode. + * prevent the background LPQ daemon from updating the print queue + cache just because multiple smbd processes sent a message that + it was out of date. + * consolidate printer searches to use find_service rather than + for(...) loops. + * BUG 2091: don't remove statically defined printers in + remove_stale_printers(). + * Fix logic error in add_a_form() that only compared N characters + instead of the entire form name. + * BUG 2107: fix memory bloating caused by large numbers of + print_queue_updates() requests sent via messages.tdb. + * Check the setprinter(3) based on the access permissions on + the handle and avoid the call to print_access_check(). + * Re-instantiate previous semantics for calling init_unistr2() + with a NULL source buffer. + * Support Windows privilege model for assigning rights + to specific SIDs. Based on work by Simo Sorce in the trunk + svn branch. This feature is controlled by the 'enable + privileges = [yes|no]' smb.conf(5) option. + * Add some smb.conf scripts for add/delete/change shares and + deleting cups printers. + * Expand variables in the profile path, logon home and logon script + values when using either tdbsam or ldapsam. + * Add Domain Admins (Full Control) to the default printer security + descriptor if we are a DC. + * RedHat and Fedora Packaging fixes for perl dependencies. + * Remove unused schema items from OpenLDAP schema file. + * Remove duplicate enumeration of "Windows x86" architecture + when listing printer drivers via rpcclient. + * Fail set_privileges() if 'enable privileges = no' to prevent + confused admins. + * Fix segfault in cups_queue_get(). + * Tighten restrictions on changing user passwords when + the connected user possesses the SeMachineAccountPrivilege. + * Ensure we set NETBIOSNAME.domainname for the long machine name + when publishing printers in AD (based on input from Rob Foehl). + * Mark 'winbind enable local accounts' as deprecated. + * Mark testprns tool as deprecated. + * Allow root to grant/revoke privilege assignments. + * Correct interaction between user rights and se_access_check() on + SAMR objects. + * BUG 2286: Fix typo OpenLDAP schema file for sambaConfig object + class. + * BUG 2262: Add support in configure.in for *freebsd6*. + * BUG 2266: Portability fixes for quota code on FreeBSD4. + * BUG 2264: Remove shutdown and abortshutdown commands from + rpcclient in favor of using the same functions in 'net'. + * BUG 2295: Prevent smbd from returning an empty server name + in certain lanman api calls. + * BUG 2290: Fix autogen.sh script in examples (based on original + patch from Lars Mueller). + * Fix bug enumerating domain trusts in security = ads. + * Fix segv in rpcclient's dsenumdomtrusts. + * Fix bug in expansion of %U and %G in included filenames. + * BUG 2291: Restrict creation of server trust and domain trust + accounts to members of the "Domain Admins" group. + +o Nadav Danieli + * Short circuit some is_locked() tests if we are oplocked. + + +o Guenther Deschner + * Allow 'localhost' as a valid server name in the smbd for the + spoolss calls. + * Fix KRB5_SETPW-defines, no change in behavior (Thanks to Luke + Mewburn for the input). + * BUG 2059: Add additional checks needed after logic change to the + HAVE_WRFILE_KEYTAB detection test. + * BUG 1076: Fix interaction with Exchange 5.5. SP4 and a + Samba DC. Allow us to lookup at least our own SID. + * More fixes to have proper German in swat (Thanks to Reiner + Klaproth and Björn Jacke. + * BUG 404, 2076: Allow to set OWNER- and GROUP-entries while + setting security descriptors with smbcacls and using with + the -S or -M switch. + * Include the munged_dial, bad_password_count, logon_count, and + logon_hours attributes when running 'net rpc vampire'. + * Fix segfault in idmap_rid. + * When winbindd is operating in the multi-mapping mode of + idmap_rid, allow BUILTIN domain-mapping. + * Display infolevel 12 in query_dom_info in rpcclient. + * Fix bug in winbindd's lowercasing of usernames. + * Allow -v or -l for displaying verbose groupmap-listing + as well as "verbose". + * Backport Samba4 SAM_DELTA_DOMAIN_INFO for use in 'net rpc + vampire'. + * Close LDAP-Connection before retrying to open a new connection + in the retry-loop. + * Marking "min password length" as depreciated. + * Implement SAMR query_dom_info-call info-level 8 server- and + client-side, based on samba4-idl. + * Allow rpcclient to define a port to use when connecting + to a remote server. + * Allow Account Lockout with Lockout Duration "forever" (until + admin unlocks) to be set and displayed in User Manager. + * Allow to set acb_mask in rpcclient's enumdomusers. + * Add more generic rootDSE inspection function to check + for given controls or extensions and remember these on a + per server basis. + * Improve LDAP search efficiency by passing the acb_mask to + pdb_setsampwent(). + * Fixes for ldapsam_enum_group_memberships(). + * Add createdomgroup to rpcclient. + * Add "net rpc user RENAME"-command. + * Display sam_user_info_7 in rpcclient. + * Make multi-domain-mode in idmap_rid accessible from outside + (can be compiled with -DIDMAP_RID_SUPPORT_TRUSTED_DOMAINS). + * When vampiring account policy AP_LOCK_ACCOUNT_DURATION honor + "Lockout Duration: Forever". + * Fix configure.in tests using KRB5_CONFIG variable and krb5- + config utility. + * Require assignment of Administrator SID in the passdb + backend. Fall back to the default name of 'Administrator' if + the lookup fails rather than using the first name in the + default 'admin users' list. + * Enhance LDAP failure debug messages. + * BUG 2291: Call the 'add machine script' for server trust and + domain trust accounts as well as workstation accounts. + + +o Levente Farkas + * BUG 2299: Better logrotate scripts for RedHat and Fedora + packages. + + +o Jay Fenlason + * Fix crash in 'net join' due to calling free on + static buffers. + * Several patches from RedHat's Fedora Core RPMS. + + +o Rob Foehl . + * Compiler warnings. + * Try modifying printer published attributes before adding it a + new entry in AD. + * Solaris packaging fixes. + * Don't force the cups printer-make-and-model tag as the comment + for autoloaded printers. + * Implement caching of names from printcap to support a true + 'printcap cache time'. + + +o Johann Hanne + * BUG 2038: Only fail winbindd_getgroups() if all lookups fail. + + +o Jeff Hardy + * Example script for 'add print command' when using CUPS. + + +o Deryck Hodge + * Add -P (--password-only-menu) to SWAT for displaying only the + password change page to non-root users. + + +o David Hu + * Copy structure from print_queue_update() message rather than + referencing it. Fixes seg fault on HP-UX. + + +o Buck Huppmann + * BUG 2186: Don't free uninitialized credentials. + * BUG 2189: Add the HOST/fqdn servicePrincipalName even when + dnsDomainName != realm. + + +o Björn Jacke + * BUG 2040: Ensure the locale is reset to C to get ASCII- + compatible toupper/lower functions. + + +o William Jojo + * Fix HPUX sendfile and add configure.in tests and code for + sendfile on AIX. + * AIX 5.3 compile fixes. + + +o Volker Lendecke + * Optimize anonymous session setups by workstations in a + Samba domain. + * Reimplment the QueryUserAliases() server RPC reply. + * Re-add the getpwnam-cache for performance. + * Cache the result of a pdb_getsampwnam for later SID lookup + queries. + * Unify the means of localtaing a user's global groups on a + Samba DC. + * Fix bug when serving the 'Start Menu' in a roaming user profile.. + * Map more pre-defined NT security descriptors to AFS acls. + * Add timeout to AD search requests. + * If a connection to a DC is requested (in winbindd), open + connections simultaneously to all DCs found. + * Memleak fixes. + * Fix logic error in handling of 'printcap name' parameter. + * Prevent winbindd from SPAM'ing the log files with 'user root + does not exist'. + * Backport samr_DomInfo2 IDL specification from Samba 4. + * Implement smbstatus -n, don't lookup users and groups. + * Implement simple mapping that maps the space to another character + defined by afsacl:space. + * Add support for 'net idmap delete '. + * Add new parameter 'afs token lifetime' tells the AFS client + when to throw away a token (patch from kllin@it.su.se). + * Initial work to allow support for multiple pipe opens on a + single cli_state*. + * Ensure that we still retrieve the netbios name of any DC + listed as a 'password server' to work around cases where the + DC was defined using an IP address or fqdn. + * Fix memleak in winbindd connection code. + * Fix cli_samr_queryuseraliases. + * Allow wbinfo --user-sids to expand expand domain local groups. + * Allow 'rpcclient -c enumtrust' to enumerate more than 10 trusts. + * Fix parsing of other_sids in net_user_info3. + * Correct bad failure logic when user was not a member of any + domain local groups. + + +o Jason Mader + * BUG 2113, 2289: Remove dead code. + + +o Jim McDonough + * BUG 1952: Try INITSHUTDOWN pipe first, used by newer + clients. If it fails, fall back to WINREG. + * BUG 1770: Remove READ_ATTRIBUTES from GENERIC_EXECUTE. + * BUG 2198: Set password last change time when running 'net rpc + vampire'. + * Add "refuse machine password change" policy field. + + +o Luke Mewburn + * BUG 2150: shmget() - Use POSIX definitions instead of non- + standard SHM_. + + +o Stefan Metzmacher + * autogen.sh fixes. + + +o Buchan Milne + * Mandrake packaging fixes. + + +o Lars Mueller + * Fix build of libsmbclient on x86_64. + * BUG 2013: Fix testsuite build issues when libsmbclient.so + is installed in a non-default location. + * BUG 2050: Calculate max_fd for select correctly. + * Fix inverted logic heck for HAVE_WRFILE_KEYTAB in autoconf + script. + + +o Jason Mader + * BUG 2069: Remove unused variables. + * BUG 2075: Remove dead code paths. + * BUG 2083: Fix compiler warnings caused by bad type casts. + + +o James Peach + * Fix rewinddir -> rewind_dir when using VFS macros. + + +o Gavrie Philipson + * BUG 1838: Remove stale printers imeeddiately when + processing a SIGHUP and during smb.conf reload. + + +o Tim Potter + * BUG 2080: Fix duplicate call to pdb_get_acct_desc(). + * BUG 2168: Fix cast in SMB_XMALLOC_ARRAY. + * Change the license for the winbindd external interface + more liberal. + * HP-UX compile fixes. + * Compile fixes after new setsampwent() API. + + +o Richard Renard + * Update Netscape DS 5.2 LDAP schema. + + +o Simo Sorce + * Backport pdbedit changes from trunk. + * Allows the add/change share command to create the shared + directory directory on disk. + * Log a warning in testparm if a print command is defined for + a print service using 'printing = cups'. + +o Jelmer Vernooij + * Bug fixes for pdb_{xml,pqsql,xml} + * Fixes for pdb_mysql. + + +o Andrew Tridgell + * Bring Samba3 into line with the Samba4 password change code. + + +o Shiro Yamada + * BUG 2190: Force SWAT to display parameters in unix charset and + not UTF-8. + + + -------------------------------------------------- + ============================== + Release Notes for Samba 3.0.10 + Dec 16, 2004 + ============================== + +Common bugs fixed in 3.0.10 include: + + o Fix for security issues described in CAN-2004-1154. + + +Changes since 3.0.9 +------------------- + +commits +------- + +o Jeremy Allison + * Added checks surrounding all *alloc() calls to fix + CAN-2004-1154. + * Fix long standing memory size bug in bitmap_allocate(). + * Remove bogus error check in deferred open file serving + code. + + +o Thomas Bork + * Fix autoconf script on platforms using a version of GNU ld + that does not include a date stamp in the output of --version. + + +o Luke Mewburn + * Fix the swat install script to deal with the new image + destination directory used by the docs. + + + + -------------------------------------------------- + + ============================= + Release Notes for Samba 3.0.9 + Nov 15, 2004 + ============================= + +Common bugs fixed in 3.0.9 include: + + o Problem updating roaming user profiles. + o Crash in smbd when printing from a Windows 9x client. + o Unresolved symbols in libsmbclient which caused + applications such as KDE's konqueror to fail when + accessing smb:// URLs. + + +Changes since 3.0.8 +------------------- + + +commits +------- + +o Jeremy Allison + * Correctly detect errno for no acl/ea support. + * BUG 2036: Fix seg fault in 'net ads join'. + + +o Gerald (Jerry) Carter + * Solaris packaging fixes. + * Fix seg fault in lanman printing code. + * BUG 2017: fix testparm reporting for the passwd program + string. + * Fix output of smbstatus to match the man page. + * BUG 2027: fix conflict with declaration MD5_CTX in system + headers. + * 2028: Avoid false error messages when copying a long + printer name to the device mode. + + +o Guenther Deschner + * Allow deldriverex in rpcclient to delete drivers for a + specific architecture and a specific version. + * Fix a couple of rpcclient spoolss commands (setprinter, + setprintername, getdriver) w.r.t to printer-naming scheme. + Allow 'localhost' in the server string for certain server-side + spoolss functions. + * BUG 2015: Do not fail on setting file attributes with + acl support enabled. + + +o Michel Gravey + * Fix build when using gcc 3.0. + + +o Volker Lendecke + * Fix tdb open logic when checking our local_pid after + the fork(). + + +o Jim McDonough + * BUG 1932: Fix crash in 'net getlocalsid' when run as + non-root user. + + +o Luke Mewburn + BUG 1661: Fix KRB5_SETPW-defines + + +o Buchan Milne + * BUG 2023: Mandrake packaging fixes for building 3.0.9. + + +o Lars Mueller + * BUG 2013: Fix unresolved symbols in libsmbclient.so. + + +o Martin Zielinski + * Add DeletePrinterDriverEx() functionality to rpcclient. + + + -------------------------------------------------- + + ============================= + Release Notes for Samba 3.0.8 + Nov 7, 2004 + ============================= + +Common bugs fixed in 3.0.8 include: + + o Compile fixes for HP-UX + o Fixes for the printer publishing code used when joined to + an AD domain. + o Incompatibilities with file system quotas. + o Several bugs in the spoolss printing code and print system + backends. + o Inconsistencies in the username map functionality when + configured on domain member servers. + o Various compile warnings and errors on various platforms. + o Fixes for kerberos interoperability with Windows 200x + domains when using DES keys. + o Fix for CAN-2004-0930 -- smbd remote DoS vulnerability. + o Fix for CAN-2004-0882 -- possible buffer overrun in smbd. + + +New features included in the 3.0.8 release are: + + o New migration functionality added the the net tool + for files/directories, printers, and shares. + o New experimental idmap backend for assigning uids/gids + directly based on the user/group RID when acting as a + member of single domain without any trusts. + o Additional printer migration support for XP/2003 platforms. + + +=========================== +Change in Winbindd Behavior +=========================== + +All usernames returned by winbindd are now converted to lower +case for better consistency. This means any winbind installation +relying on the winbind username will need to rename existing +directories and/or files based on the username (%u and %U) to lower +case (e.g. mv $name `echo $name | tr '[A-Z]' '[a-z]'`). This may +include mail spool files, home directories, valid user lines in +smb.conf, etc.... + + +====================== +Change in Username Map +====================== + +Previous Samba releases would only support reading the fully qualified +username (e.g. DOMAIN\user) from the username map when performing a +kerberos login from a client. However, when looking up a map +entry for a user authenticated by NTLM[SSP], only the login name would be +used for matches. This resulted in inconsistent behavior sometimes +even on the same server. + +Samba 3.0.8 obeys the following rules when applying the username +map functionality: + + * When performing local authentication, the username map is + applied to the login name before attempting to authenticate + the connection. + * When relying upon a external domain controller for validating + authentication requests, smbd will apply the username map + to the fully qualified username (i.e. DOMAIN\user) only + after the user has been successfully authenticated. + + +###################################################################### +Changes +####### + +Changes since 3.0.7 +------------------- + +smb.conf changes +---------------- + Parameter Name Action + -------------- ------ + force printername New + sendfile disabled by default + + +commits +------- + +o Jeremy Allison + * Ensure extended security bit is on only if we negotiated + extended security. + * Simplify statcache to use an in-memory tdb. + * If you're selecting a hash algorithm for tdb, you need + to do it at open time. + * Removed old dir caching code - not being used now we + have the statcache anyway. + * Simplify the mangle hash code to use an in-memory tdb. + * Merge iconv changes from Samba 4 branch. + * Fix parsing of names ending in dot and a few other error + returns. + * BUG 1667: Smbpasswd file could be left locked on some + error exits. + * Fixes for smbclient tar functionality. + * BUG 1743: Fix logic bug the deferred open code. + * Don't try to set security descriptors on shares where + this has been turned off. + * Return correct error codes on old SEARCH call. + * Ensure we set errno = E2BIG when we overflow in the + fast-path character conversion code. + * Fix the roundup problem (returning 1mb roundup) for + non-Windows clients. + * Added 'stat' command to smbclient to exercise the + UNIX_FILE_BASIC info level. + * Fix bug where we could incorrectly set sparse attribute. + * Fix incorrect locks/unlocks in tdb_lockkeys()/tdb_unlockkeys() + (reported by Taj Khattra ). + * Remove locked keys tdb code. + * BUG 1886: Prevent delete on close being set for readonly files + (and return the correct error code). + * Ensure we pass most of the new lock tests except for the cancel + lock which is yet to be added (merged from Samba 4 branch). + * BUG 1947: Fix incorrect use of getpwnam() etc. interface. + * BUG 1956: Ensure errno is saved and restored consistently on a + normal_close. + * BUG 1651: Adapted patch from Nalin Dahyabhai for ensuring + that all of the appropriate service principal names are set + upon joining an AD domain. + * Fix the correct use of resume name in the trans2 code. + * BUG 1717: Adapted patch from Nalin Dahyabhai to detect the + correct salt used when generated the DES key after joining an + AD domain. + * Enhanced krb5 detection routines in the autoconf scripts. + + +o Andrew Bartlett + * Avoid changing the machine account password in the passdb + backend, when it has 'already been changed'. This occurs + in situations where the secure channel between the workstation + and the DC breaks down, such as occurred in the MS04-11 + security patch. + * Fix utility name in error message in ntlm_auth. + * Fix NTLMv2 for use with pam_winbind. + * Remove conversion to and from UTF8 on the winbind pipe. + * Allow 'require_membership_of' and 'require-membership-of'. + * Fix the error code for 'you didn't specify a domain' in + ntlm_auth. + * Use sys_getgroups() rather than scanning all groups + when generating SAMR replies. + + +o Igor Belyi + * Ensure pdb user is deleted first before deleting UNIX + user (LDAP backend needs this ordering). + + +o Cornelio Bondad Jr + * Fix core dump in 'net rpc vampire'. + + +o Vince Brimhall + * Make ldapsam_compat robust against NULL attributes. + + +o Gerald Carter + * Don't limit the number of groups returned by winbindd_getgroups() + by NGROUPS_MAX. + * BUG 1519: Match Windows 2000 behavior when opening a + printer using a servername in the form of an IP address or + DNS name. + * BUG 1907: remove extra slashes from the printer name in + getprinterdriverdir_1(). + * Fix standard_sub_snum() to use the current user's gid. + * Fix background queue update bug (based on Volker's initial work + in 3.1.0). + * Add 'force printername' service parameter for people that want + to enforce printername == sharename for spoolss printing. + * Ensure consistent usage of the username map. Use the fully + qualified DOMAIN\user format for 'security = domain|ads' and + apply after authentication has succeeded. + * Cosmetic fix for getent output -- lowercase the username only + and not the complete domain\username string. + * Packaging fixes for Solaris, Redhat, & Fedora. + + +o Sean Chandler + * Fix memlieak in cliconnect.c. + + +o Darren Chew + * Solaris packaging fixes. + + +o Nalin Dahyabhai + * SMB signing fix for 56-bit DES session keys. + + +o Guenther Deschner + * add IA64 to the architecture table of printer-drivers. + * Add file/share/printer migration functionality to + the net command. + * Show correct help for net groupmap commands. + * Fix deadlock loop in winbind's required_membership_sid + verification. + * Bring the same level of "required_membership"-functionality + that ntlm_auth uses, to pam_winbindd as well. + * Prevent "net lookup kdc" from seg-faulting when + using our own implementation of krb5_lookup_kdc with + heimdal. + * Adding getprinter level 7 to rpcclient. + * Support migrating printers|shares|files from Server A + to Server B while running the net-command on client C. + * Fixed krb5_krbhost_get_addrinfo()-parameters and make + failure of this call non-critical (Thanks to Love @ Heimdal + for the explanation and patch). + * Fix typos in net's usage-output. + * Fix the paranoia-check to ensure the ldap-attribute and the + smb.conf-parameter for samba's "algorithmic rid base" in ldapsam + are identical. + * Fix several bugs in the _samr_query_useraliases() rpc reply. + * Check correct string length when verifying password-policies + and using extended characters (Thanks to Uwe Morgenroth from CC + Compunet and Volker). + * Make 'password history'-behavior in ldapsam more consistent. + * Adding "Windows x64" as architecture string and driverdir "x64" + for the 64bit AMD platform. + * BUG 1343: Readd WKGUID-binding to match the correct default- + locations of new User-, Group- and Machine-Accounts in Active + Directory (this got lost during the last trunk-merge). + * Fix printer-migration w.r.t. to new naming-convention for + policy-handles. + * Allow to migrate win2k3/xp-drivers as well. + * Add client-side support of triggering ads printer publishing + over msrpc setprinter calls inside the net-tool. + * Add the idmap_rid module (written in conjunction with + Sumit Bose ). + * BUG 1661: Fix build with recent heimdal releases. + * Prevent idmap_rid from making unnecessary calls to domain + controllers for trusted domains. + + +o Arthur van Dongen + * Fix typos in pam_winbind log messages and SuSE + packaging files. + + +o Rob Foehl + * Typo fixes for log messages in printer publishing code. + * Fix memory leak in printer publishing code. + * Ensure print_backend_init() only gets called once. + * Have smbd check the published status of all printers + at startup. + * Cleanup up the XXX_a_printer() API for consistency. + * Refactored the printer publishing code and include better + error handling. + + +o Steve French + * Fix IP address override in mount.cifs mount helper and clean + up warning messages from the sparse tool and expand syntax help. + * Strip guest mount option off before sending to kernel mount + routine to avoid logging spurious message. + + +o Satoh Fumiyasu + * BUG 1732: Limit share names returned by RAP based on windows + character width, not unix character width. + * BUG 1498: Ensure that acl entries are stored in the correct + order. + + +o Brett Funderburg + * Pass create options parameter to nt_create_andx() function + from the python bindings. + * BUG 1864: Add sd->type field to security descriptor Python + representation. + * Return an error if a Netapp filer returns NT_STATUS_ACCESS_DENIED + when trying to return the security descriptor for a file. + * BUG 1884: Fixes for the Python bindings to use the value + of the desired_access filed passed into the lsa_open_policy() + routines. + + +o Michael Gravey + * BUG 1776: Fix warnings when building modules caused by + certain versions of GNU ld not using the the default + --allow-shlib-undefined flag. + + +o Chris Hertel + * Fix logic bug in splay tree data structure when finding + a leaf node. + * Fix bug where an invalid MAC address would be printed by + a node status lookup from nmblookup. + + +o Uli Iske + * Update the DNS/eDirectory LDAP schema file. + + +o Björn Jacke + * BUG 1766: Unify charset-handling in Content-Type:-headers to + UTF-8. Reformat msgstr in msg-files to UTF-8. + * Do not use display charset for swat output. + * Convert the share names correctly from unix encoding to web + encoding and vice versa. + * Convert files from status page from unix charset to UTF-8. + + +o Guenter Kukkukk + * BUG 1590: Fix for talking to OS/2 clients (max_mux ignored). + + +o Tom Lackemann + * BUG 1954: Fix memory leak in posix acl code. + + +o Volker Lendecke + * Robustnss fix for winbindd when sending multiple requests + at a high rate for a slow operation. + * Solve the problem of user sids ending up with gid's + and vice versa. + * Use sys_fork instead of fork for the dual daemon so that + we get the correct debug pid in the logfiles. + * Based on patch from jmcd, implement special lists for the LDAP + user attributes to delete. + * Fix creation of aliases via usrmgr. Winbind was too strict + checking the type of sids. + * Lowercase all usernames returned by winbind. + * BUG 1545, 1823: Only issue the ldap extended password change + operation if the ldap server supports it. Also ignore object + class violation errors from the extended operation. + * Optimization for 'idmap backend = ldap': When asking sid2id + for the wrong type, don't ask ldap when we have the opposite mapping + in the local tdb. + * Fix ldapsam_compat homeDrive. + * Add usersidlist and allowedusers subcommands to the net tool + in order to support scanning a file server's share and list + all users who have permission to connect there. + * Allow for multiple DC's to be named as #1c names in lmhosts. + * Memory leak fixes. + * Fix checks for the local pid of an smbd process after + reopening tdbs. + + +o Herb Lewis + * Added tdbtool to be built by default. + + +o Love + * BUG 1955: Inconsistent error return. + + +o Sorin Manolache + * Memory leak fix. + + +o Jim McDonough + * Allow 'net ads lookup' to rely on command line arguments + if contacting an ADS server fails; utilize cldap for lookups. + * Fixup formatting errors in TDB_LOG calls; add printf attribute + support to tdb log functions. + + +o Bill McGonigle + * BUG 1926: Type in debug message. + + +o Sean McGrath + * BUG 1822: Add -D_REENTRANT to CPPFLAGS and -lthread to LDFLAGS + for libsmbclient. + + +o Luke Mewburn + * BUG 1782: Prevent testparm from displaying parameter synonyms. + + +o Stefan Metzmacher + * Fix crash in smbcquotas and smbcacls caused by setup_logging(). + * Fix client quota support. + * Fix opening of system quota file. + + +o Lars Mueller + * Small fixes for autogen.sh to deal with version detection + of autoconf and autoheader; fixes for examples using + libtool to adhere to stricter syntax of newer version. + + +o Henrik Nordstrom + * Allow winbindd to return the correct number of groups + when the groups array must be enlarged. + + +o Narayana Pattipati + * Solaris autoconf detection fixes. + + +o Tim Potter + * BUG 1360: (correct fix) Use -Wl when passing flags to + the linker. + * HP-UX compile fixes (from JBravo on #samba-technical). + * BUG 1731: More HP-UX compiles fixes. + * BUG 1778: Include yp_prot.h before ypclnt.h as AIX 5.2 + spits the dummy otherwise. + * Fix bug in Python printerdata wrapper. + * BUG 1762: nss_winbind fixes on AIX 5.x (patch from + ). + * Fix parameter confusion in priming of name-to-sid cache + (Found by Qiao Yang). + * BUG 1888: Remove '..' from all pre-processor commands. + * BUG 1903: Change some #if DEBUG_PASSWORD's to #ifdef + DEBUG_PASSWORD. + + +o Matt Selsky + * BUG 350: use autoconf 2.57 feature for checking header file + preprocessing (fixes configure warnings on Solaris). + + +o Richard Renard + * Fix usermgr.exe and trust relationships. + + +o Paul Szabo + * Fix to make find_workgroup use the same + truncation as create_workgroup. + + +o Richard Sharpe + * Ensure cli_write() can support writes >= 65536 bytes. + + +o Simo Sorce + * Added check password script code in examples/auth/crackcheck/ + * Fix memory corruption bug caused in freeing static memory. + + +o Andrew Tridgell + * Remove lp_use_mmap() from map_file() since the latter + is for read only and does not require coherence. + * Ensure that the uuid pack/unpack routines do not go past + the end of the structure. + * Converted Samba 3 tree to use the new utf-16 aware iconv + code. + * Changed iconv to recognise UCS-2LE and UTF-16LE as synonyms. + * Ensure configure only uses '=' instead of the bashism '=='. + * Reduces the number of tdb locking calls made on file IO. + + +o Jelmer Vernooij + * Convert internal data to UTF-8 before calling libxml2. + * Complain if 'password chat' doesn't contain the %u variable + (based on a patch by Ronan Waide). + + +o Josef Zlomek + * BUG 1541: Fix recursive ls in smbclient. + + +o Igor Zhbanov + * BUG 1797: Prevent winbind and nmbd from ignoring the "-l" + option. + + -------------------------------------------------- + + ============================= + Release Notes for Samba 3.0.7 + Sept 13, 2004 + ============================= + +Common bugs fixed in 3.0.7 include: + + o Fixes for two Denial of Service vulnerabilities + (CVE ID# CAN-2004-0807 & CAN-2004-0808). + o Winbind failure to return user entries under certain + conditions. + o Syntax errors in the OpenLDAP schema file (samba.schema). + o Printing errors caused by not setting default values + for the various printing commands. + + +Changes since 3.0.6 +------------------- + +smb.conf changes +---------------- + + Parameter Name Action + -------------- ------ + winbind enable local accounts disabled by default + + +commits +------- +o Jeremy Allison + * Fix parsing of names ending in dot and a few other error + returns. + * BUG 1674: Move the symlinks checks into reduce_name(). + * Fix memleak when checking the valid names smb.conf option. + * Fix memleak on error return path in the file open code. + * More paranoia checks in the hash2 mangling code. + * Fix syntax error in configure.in. + * Match Win2k3's behavior for pathname parsing error returns. + * Make nmbd more robust against bad netbios packets + (CAN-2004-0808). + * Add more checks for invalid ASN.1 packets for SPNEGO packets + (CAN-2004-0807). + + +o Andrew Bartlett + * Janitor work in loadparm.c -- remove unused parameters. + + +o Gerald Carter + * BUG 1464: Ensure that printing commands are initialized even + if the 'printing' parameter is not explicitly set. + * Resolve name conflict on DEC OSF-5.1 (inspired by patch from + Adharsh Praveen ) + * Work around parsing error in the print change notify code. + * remove duplicate declaration of getprintprocdir from + rpcclient. + * Only use sAMAccountName and not userPrincipalName when looking + up a username in AD since the breaks winbindd (lookup_name() + only works with the sAMAccountName). + * Fix bug with winbindd_getpwnam() caused by Microsoft DC's not + filling in the username in the user_info3. + * Fix logic bug in the check for creating a user's home directory + in register_vuid(); caused home directory to be mismatched to + the first share in smb.conf under certain conditions. + * BUG 1656: rename auto.a to auto.smb. + * Ensure that we assign our pid to print jobs (and not our + parent's pid); ensures that spooling jobs from dead smbds + are removed from the tdb. + * Disable 'winbind enable local accounts' by default. + * Adding some initial checks for DragonFly (same as + FreeBSD 4.1). + + +o Guenther Deschner + * Use SMB_ASSERT() to track down NULL printer names in + the tdb open code. + * Revert fix for BUG 1474 to avoid unnecessary packaging + dependencies. + + +o Olaf Flebbe . + * BUG 1627: fix for NIS compiles on HPUX 11.00, AIX 4.3 + and 5.1. + * BUG 1626: More compile fixes. + + +o Rob Foehl + * Don't clear the PRINT_ATTRIBUTE_PUBLISHED was getting reset + by attempts to sanitize the defined attributes. + + +o SATOH Fumiyasu + * BUG 1546: Preserve errno in MB strupper_m/strlower_m. + + +o Helmut Heinreichsberger . + * BUG 1657: Remove used initialized variable, + * BUG 1658: Add a little bit of const. + + +o Volker Lendecke + * If there's garbage in the pidfile, we should not panic + but assume that no one else is around. We can't find the + other guy anyway. + + +o Jim McDonough + * Fixup format string in the tdb error messages. + + +o Jonas Olsson + * BUG 1416: Don't reuncture a users list to NGROUPS_MAX when + reporting the list in usrmgr.exe. + + +o Tim Potter + * Fix out-of-tree builds (problem with the script to generate + the svn version number). + * BUG 1360: Need to use -Wl when passing flags to the linker. + * BUG 1741: Define a struct nss_groupsbymem for HPUX 11 which + doesn't have one of its own. + +o Simo Sorce + * Fixup compile issues on AIX caused by broken strlen() and + strdup(). + * Update debian packaging files. + + +o Dimitri van der Spek + * Use the correct counter when copying group rids from the + user_info3 struct in pam_winbind. + + +o Qiao Yang + * BUG 1622: Only cache the user + + + -------------------------------------------------- + + ============================= + Release Notes for Samba 3.0.6 + Aug 19, 2004 + ============================= + +Common bugs fixed in 3.0.6 include: + + o Schannel failure in winbindd. + o Numerous memory leaks. + o Incompatibilities between the 'write list' and 'force user' + smb.conf options. + o Premature optimization of the open_directory() internal + function that broke tools such as the ArcServe backup + agent, Macromedia HomeSite, and Robocopy. + o Corrupt workgroup names in nmbd's browse.dat. + o Sharing violation errors commonly seen when opening + when serving Microsoft Office documents from a Samba + file share. + o Browsing problems caused by an apostrophe (') in the + computer's description field. + o Problems creating special file types from UNIX CIFS + clients and enabling 'unix extensions'. + o Fix stalls in smbd caused by inaccessible LDAP servers. + o Remove various memory leaks. + o Fix issues in the password lockout feature. + +New features introduced in this release include: + + O Support symlinks created by CIFS clients which + can be followed on the server. + o Using a cups server other than localhost. + o Maintaining the service principal entry in the system + keytab for integration with other kerberized services. + Please refer to the 'use kerberos keytab' entry in + smb.conf(5). When using the heimdal kerberos libraries, + you must also specify the following in /etc/krb5.conf: + [libdefaults] + default_keytab_name = FILE:/etc/krb5.keytab + o Support for maintaining individual printer names + stored separately from the printer's sharename. + o Support for maintaining user password history. + o Support for honoring the logon times for user in a + Samba domain. + + +============================================ +unix extensions = yes (default) and symlinks +============================================ + +Beginning with Samba 3.0.6pre1 (formerly known as 3.0.5pre1), +clients supporting the UNIX extensions to the CIFS protocol +can create symlinks to absolute paths which will be **followed** +by the server. This functionality has been requested in order +to correctly support certain applications when the user's home +directory is mounted using some type of CIFS client (e.g. the +cifsvfs in the Linux 2.6 kernel). + +If this behavior is not acceptable for your production environment +you can set 'wide links = no' in the specific share declaration in +the server's smb.conf. Be aware that disabling wide link support +out of a share in Samba may impact the server's performance due +to the fact that smbd will now have to check each path additional +times before traversing it. + + +======================== +Password History Support +======================== + +The new password history feature allows smbd to check the new +password in password change requests against a list of the user's +previous passwords. The number of previous passwords to save can +be set using pdbedit (4 in this example): + + root# pdbedit -P "password history" -C 4 + +When using the ldapsam passdb backend, it is vital to secure the +following attributes from access by non-administrative users: + + * sambaNTPassword + * sambaLMPassword + * sambaPasswordHistory + +You should refer to your directory server's documentation on how +to implement this restriction. + + +Changes since 3.0.5 +------------------- + +smb.conf changes +---------------- + + Parameter Name Action + -------------- ------ + cups server New + defer sharing violations New + force unknown acl user New + ldap timeout New + printcap cache time New + use kerberos keytab New + +commits +------- +o Jeremy Allison + * Correct path parsing bug that broke DeletePrinterDriverEx(). + * Fix bugs in check_path_syntax() caught by asserts. + * Internal change - rearrange internal global case setting + variables to a per connection basis. + * BUG 1345: Fix premature optimization in unix_convert(). + * Allow clients to truncate a locked file. + * BUG 1319: Always check to see if a user as write access + to a share, even when 'force user' is set. + * Fix specific case of open that doesn't cause oplock break, + or share mode check. + * Correct sid type is WKN_GROUP, not alias. Added some + more known types (inspired by patch from Jianliang Lu). + * Allow creation of absolute symlink paths via CIFS clients. + * Fix charset bug in when invoking send_mailslot(). + * When using widelinks = no, use realpath to canonicalize + the connection path on connection create for the user. + * Enhance stat open code. + * Fix unix extensions mknod code path. + * Allow unix domain socket creation via unix extensions. + * Auto disable the 'store dos attribute' parameter if the + underlying filesystem doesn't support EAs. + * Implement deferred open code to fix a bug with Excel files + on Samba shares. + * BUG 1427: Catch bad path errors at the right point. Ensure + all our pathname parsing is consistent. + * Fix SMB signing error introduced by the new deferred open + code. + * Change default setting for case sensitivity to "auto". (see + commit message -- r1154 -- for details). + * Add new remote client arch -- CIFSFS. + * Allow smbd to maintain the service principal entry in the + system keytab file (based on patch Dan Perry , + Guenther Deschner, et. al.). + * Fix longstanding memleak bug with logfile name. + * Fix incorrect type in printer publishing (struct uuid, + not UUID_FLAT). + * Heimdal compile fixes after introduction of the new ketyab + feature. + * Ensure we check attributes correctly on rename request. + * Ensure we defer a sharing violation on rename correctly. + * BUG 607: Ensure we remove DNS and DNSFAIL records immediately + on timeout. + * Fix bogus error message when using "mangling method = hash" + rather than hash2. + * Turn on sendfile by default for non-Win9x clients. + * Handle non-io opens that cause oplock breaks correctly. + * Ensure ldap replication sleep time is not more than 5 seconds. + * Add support for storing a user's password history. + LDAP portion of the code was based on a patch from + Jianliang Lu . + * Correct memory leaks found in the password change code. + * Fix support for the mknod command with the Linux CIFS client. + * Remove support for passing the new password to smbpasswd + on the command line without using the -s option. + * Ensure home directory service number is correctly reused + (inspired by patches from Michael Collin Nielsen + ). + * Fix to stop printing accounts from resetting the bas + password and account lockout flags. + * If a account was locked out by an admin (and has a bad + password count of zero) leave it locked out until an admin + unlocks it (but log a message). + * Ensure we return the same ACL revision on the wire that + W2K3 does. + * BUG 1578: Hardcode replacement for invalid characters as '_' + (based on fix from Alexander E. Patrakov ). + * Fix hashed password history for LDAP backends. + * Enforce logon hours restrictions if confiogured (based on code + from Richard Renard ). + * BUG 1606: Force smbd to disable sendfile with DOS clients + and ensure that the chained header is filled in for ...&X + commands. + * BUG 1602: Fix access to shares when all symlink support + has been disabled. + + + +o Tom Alsberg + * Allow pdbedit to export a single user from a passdb backend. + + +o Andrew Bartlett + * Fix parsing bug in GetDomPwInfo(). + * Fix segfault in 'ntlm_auth --diagnostics'. + * Re-enable code to allow sid_to_gid() to perform a group + mapping lookup before checking with winbindd. + * Fix memory leak in the trans2 signing code. + * Allow more flexible GSS-SPENGO client and server operation + in ntlm_auth. + * Improve smbd's internal random number generation. + * Fix a few outstanding long password changes in smbd. + * Fix LANMAN2 session setup code. + + +o Eric Boehm + BUG 703: Final touches on netgroup case lookups. + + +o Jerome Borsboom + * Ensure error status codes don't get overwritten in + lsa_lookup_sids() server code. + * Correct bug that caused smbd to overwrite certain error + codes when returning up the call stack. + * Ensure the correct sid type returned for builtin sids. + + +o Gerald Carter + * Fix a few bugs in the Fedora Packaging files. + * Fix for setting the called name to by our IP if the + called name was *SMBSERVER and *SMBSERV. Fixes issue + with connecting to printers via \\ip.ad.dr.ess\printer + UNC path. + * BUG 1315: fix for schannel client connections to servers + when we haven't specifically negotiated AUTH_PIPE_SEAL. + * Allow PrinterDriverData valuenames with embedded backslashes + (Fixes bug with one of the Konica Fiery drivers). + * Fixed string length miscalculation in netbios names that + resulted in corrupt workgroup names in browse.dat. + * When running smbd as a daemon, launch child smbd to update + the lpq cache listing in the background. + * Allow printers "Printers..." folder to be renamed to a string + other than the share name. + * Allow winbindd to use domain trust account passwords when + running on a Samba DC to establish an schannel to remote + domains. + * Fix bad merge and ensure that we always use tdb_open_log() + instead of tdb_open_ex() (the former call enforce the 'use + mmap' parameter). + * BUG 1221: revert old change that used single and double + quotes as delimeters in next_token(), and change + print_parameter() to print out parm values surrounded by + double quotes (instead of single quotes). + * Prevent home directories added during the SMBsesssetup&X from + being removed as unused services. + * Invalidate the print object cache for open printer handles when + smbd receives a message that an attribute on a given printer + has been changed. + * Cause the configure script to exit if --enable-cups[=yes] is + defined and the system does not have the cups devel files + installed. + * BUG 1297: Prevent map_username() from being called twice + during logon. + * Ensure that we use the userPrincipalName AD attribute + value for LDAP SASL binds. + * Ensure we remove the tdb entry when deleting a job that + is being spooled. + * BUG 1520: Work around bug in Windows XP SP2 RC2 where the + client sends a FindNextPrintChangeNotify() request without + previously sending a FindFirstPrintChangeNotify(). Return + the same error code as Windows 2000 SP4. + * BUG 1516: Manually declare ldap_open_with_timeout() to + workaround compiler errors on IRIX (or other systems without + LDAP headers). + * Merge security fixes for CAN-2004-0600, CAN-2004-0686 from + 3.0.5. + * Corrected syntax error in the OID for sambaUnixIdPool, + sambaSidEntry, & sambaIdmapEntry object classes. + * Tighten the cache consistency with the ntprinters.tdb entry + an the in memory cache associated with open printer handles. + * Make sure that register_messages_flags() doesn't overwrite + the originally registered flags. + + +o Fabien Chevalier + * Debian BUG 252591: Ensure that the return value from the + number of available interfaces is initialized in case no + interfaces are actually available. + + +o Guenther Deschner + * Implement 'rpcclient setprintername'. + * Add local groups to the user's NT_TOKEN since they are + actually supported now. + * Heimdal compile fixes after introduction of the new keytab + feature. + * Correctly honor the info level parameter in 'rpcclient + enumprinters'. + * Reintroduce 'force unknown acl user' parameter. When getting a + security descriptor for a file, if the owner sid is not known, + the owner uid is set to the current uid. Same for group sid. + * Ensure that REG_SZ values in the SetPrinterData actually + get written in UNICODE strings rather than ASCII. + * Ensure that the last kerberos error return is not invalid. + * Display share ACL entries from rpcclient. + * Correct infinite loop in pam_winbind's verification of + group membership in the 'other sids' field in the user_info3 + struct. + + +o Fabian Franz + * Support specifying a port in the device URL passed to smbspool. + + +o Steve French + * Handle -S and user mount parms in mount.cifs. + * Fix user unmount of shares mount with suid mount.cifs. + * prevent infinite recusion in reopen_logs() when expanding + the smb.conf variable %I. + + +o Bjoern Jacke + * Install libsmbclient into $(LIBDIR), not into hard coded + ${prefix}/lib. This helps amd64 systems with /lib and /lib64 + and an explicit configure --libdir setting. + + +o + * Correct more memory leaks and initialization bugs. + * Fix bug that prevented core dumps from being generated + even if you tried. + * Connect to the winbind pipe in non-blocking mode to + prevent processes from hanging. + * Memory leak fixes. + + +o Stephan Kulow + * Fix crash bug in libsmbclient. + + +o Volker Lendecke + * Added vfs_full_audit module. + * Add vfs_afsacl.c which can display & set AFS acls via + the NT security editor. + * Fix crash bug caused by trying to Base64 encode a NULL string. + * Fix DOS error code bug in reply_chkpath(). + * Correct misunderstanding of the max_size field in + cli_samr_enum_als_groups; it is more like an account_control + field with individual bits what to retrieve. + * Implement 'net rpc group rename' -- rename domain groups. + * Implement the 'cups server' option. This makes it possible + to have virtual smbd's connect to different cups daemons. + * Paranoia fixes when adding local aliases to a user's NT_TOKEN. + * Fix sid_to_gid() calls in winbindd to prevent loops. + * Ensure that local_sid_to_gid() sets the type of the group on + return. + * Make sure that the clients are given back the IP address to + which they connected in the case of a multi-homed host. Only + affects strings the spoolss printing replies. + * Fix the bad password lockout. This has not worked as pdb_ldap.c + did not ask for the modifyTimestamp attribute, so it could + not find it. Try not to regress by not putting that attrib + in the main list but append it manually for the relevant searches. + * Fix two memleaks in login_cache.c. + * fixes memory bloat when unmarshalling strings. + * Fix compile errors using gcc 3.2 on SuSE 8.2. + * Fix the build for systems without kerberos headers. + * Allow winbindd to handle authentication requests only when + started without either an 'idmap uid' or 'idmap gid' range. + * Fix the build for systems without ldap headers. + * Fix interaction between share security descriptor and the + 'read only' smb.conf option. + * Fix bug that caused _samr_lookupsids() with more than 32 ( + MAX_REF_DOMAINS) SIDs to fail. + * Allow the 'idmap backend' parameter to accept a list of + LDAP servers for failover purposes. + * Revert code in smbd to remove a tdb when it has become + corrupted. + * Add paranoid checks when mapping SIDs to a uid/gid to + ensure that the type is correct. + * Initial work on getting client support for sending mailslot + datagrams. + * Add 'ldap timeout' parameter. + * Dont always uppercase 'afs username map'. + * Expand aliases for getusersids as well. + * Improved NT->AFS ACL mapping VFS module. + + +o Herb Lewis + * Add the acls debug class. + * Fix logic bug in netbios name truncate routine. + * Fix smbd crash caused by smbtorture IOCTL test. + * Fix errno tromping before calling iconv to reset the + conversion state. + * need to leave empty dacl so we can remove last ACE. + + +o Jianliang Lu + * Fix to stop smbd hanging on missing group member in + get_memberuids(). + * Make sure Samba returns the correct group types. + * Reset the bad password count password counts upon a successful login. + + +o Jason Mader + * BUG 1385: Don't use non-consts in a structure initialization. + + +o Jim McDonough + * BUG 1279: SMBjobid fix for Samba print servers running on + Big-Endian platforms. + + +o Joe Meadows + * Add optional timeout parameter to ldap open calls. + * Allow get_dc_list() to check the negative cache. + + +o Stefan Metzmacher + * fix a configure logic bug for linux/XFS quotas when + using --with-sys-quotas. + * Use quota debug class in quota code. + * print out the SVN revision by configure, + + +o Buchan Milne + * Mandrake packaging fixes. + + +o Lars Mueller + * BUG 1279: Added 'printcap cache time' parameter. + * Fix afs related build issues on SuSE. + * Fix compiler warnings in the kerberos client code. + + +o James Peach + * More iconv detection fixes for IRIX. + * Compile fixed for systems that do not have C99/UNIX98 compliant + vsnprintf by default. + * Prevent smbd from attempting to use sendfile at all if it is + not supported by the server's OS. + * Allow SWAT to search for index.html when serving html files + in a directory. + + +o Dan Peterson + * Implement NFS quota support on FreeBSD. + + +o Tim Potter + * BUG 1360: Use -Bsymbolic when creating shared libraries to + avoid conflicts with identical symbols in the global namespace + when loading libnss_wins.so. + + +o Richard Renard + * Save the current password as it is being changed into the + password history list. + + +o Richard Sharpe + * Fix error return codes on some lock messages. + * BUG 1178: Make the libsmbclient routines callable + by C++ programs. + * BUG 1333: Make sure we return an error code when + things go wrong. + * BUG 1301: Return NT_STATUS_SHARING_VIOLATION when + share mode locking requests fail. + + +o Simo Sorce + * Update Debian stable & unstable packaging. + * Tidy up parametric options in testparm output. + + +o Richard Sharpe + * Add sigchild handling to winbindd to restart the child + daemon if necessary. + + +o Tom Shaw + * Use winbindd_fill_pwent() consistently. + + +o Nick Thompson + * Protect smbd against broken filesystems which return zero + blocksize. + + +o Andrew Tridgell + * Fixed bug in handling of timeout in socket connections. + + +o Nick Wellnhofer + * Prevent lp_interfaces() list from being corrupted. Fixes + bug where nmbd would lose the list of network interfaces + on the system and consequently shutdown. + + +o James Wilkinson + * Fix ntlm_auth memory leaks. + + +o Jelmer Vernooij + * Additional NT status to unix error mappings. + * BUG 478: Rename vsnprintf to smb_vsnprintf so we don't + get duplicate symbol errors. + * Return an error when the last command read from stdin + fails in smbclient. + * Prepare for better error checking in tar. + * BUG 1474: Fix build of --with-expsam stuff on Solaris. + + + -------------------------------------------------- + + ============================= + Release Notes for Samba 3.0.5 + July 20, 2004 + ============================= + +Please note that Samba 3.0.5 is identical to Samba 3.0.4 with +the exception of correcting the two security issues outlined +below. + +######################## SECURITY RELEASE ######################## + +Summary: Multiple Potential Buffer Overruns in Samba 3.0.x +CVE ID: CAN-2004-0600, CAN-2004-0686 + (http://cve.mitre.org/) + + +This is the latest stable release of Samba. This is the version +that production Samba servers should be running for all current +bug-fixes. + +It has been confirmed that versions of Samba 3 prior to v3.0.4 +are vulnerable to two potential buffer overruns. The individual +details are given below. + +============= +CAN-2004-0600 +============= + +Affected Versions: Samba 3.0.2 and later + +The internal routine used by the Samba Web Administration +Tool (SWAT v3.0.2 and later) to decode the base64 data +during HTTP basic authentication is subject to a buffer +overrun caused by an invalid base64 character. It is +recommended that all Samba v3.0.2 or later installations +running SWAT either (a) upgrade to v3.0.5, or (b) disable +the swat administration service as a temporary workaround. + +This same code is used internally to decode the +sambaMungedDial attribute value when using the ldapsam +passdb backend. While we do not believe that the base64 +decoding routines used by the ldapsam passdb backend can +be exploited, sites using an LDAP directory service with +Samba are strongly encouraged to verify that the DIT only +allows write access to sambaSamAccount attributes by a +sufficiently authorized user. + +The Samba Team would like to heartily thank Evgeny Demidov +for analyzing and reporting this bug. + +------------- +CAN-2004-0686 +------------- + +Affected Versions: Samba 3.0.0 and later + +A buffer overrun has been located in the code used to support +the 'mangling method = hash' smb.conf option. Please be aware +that the default setting for this parameter is 'mangling method += hash2' and therefore not vulnerable. + +Affected Samba 3 installations can avoid this possible security +bug by using the default hash2 mangling method. Server +installations requiring the hash mangling method are encouraged +to upgrade to Samba 3.0.5. + + +################################################################## + + -------------------------------------------------- + + ============================= + Release Notes for Samba 3.0.4 + May 8, 2004 + ============================= + +Common bugs fixed in Samba 3.0.4 include: + + o Password changing after applying the patch described in + the Microsoft KB828741 article to Windows clients. + o Crashes in smbd. + o Managing print jobs via Windows on Big-Endian servers. + o Several memory leaks in winbindd and smbd. + o Compile issues on AIX and *BSD. + +Changes since 3.0.3 +-------------------- + +commits +------- + +o Jeremy Allison + * Fix path processing for DeletePrinterDriverEx(). + * BUG 1303: Fix for Microsoft hotfix MS04-011 password change + breakage. + + +o Andrew Bartlett + * Fix alignment bug in GetDomPwInfo(). + + +o Alexander Bokovoy + * Fix utime[s]() issues in smbwrapper on systems + that can boot both the 2.4 and 2.6 Linux kernels. + + +o Gerald Carter + * Fedora packaging fixes. + * BUG 1302: Fix seg fault by not trying to optimize a list of + invalid gids using the wrong array size. + * BUG 1309: fix seg fault caused by trying to strdup(NULL) + seen when 'security = share'. + * Fix problems when using IBM's compiler on AIX. + * Link Developer's Guide, Example Guide, and multi-page HOWTO + into SWAT's welcome page. + * BUG 1293: fix double free in printer publishing code. + + +o Wim Delvaux + * Fix for handling timeouts in socket connections. + + +o Michel Gravey + * BUG 483: patch from to fix password hash creation in SWAT. + + +o Volker Lendecke + * Close the open NT pipes before the tdis. + * Fix AFS related build issues. + * Handle error conditions when base64 encoding a blob of 0 bytes. + + +o Herb Lewis + * Added 'acls' debug class. + +o kawasa_r@itg.hitachi.co.jp + * Multiple variable initialization and memory leak fixes. + + +o Stephan Kulow + * Fix string length bug in libsmbclient that caused KDE's + Konqueror to crash. + * BUG 429: More libsmbclient fixes. + + +o Jim McDonough + * BUG 1007, 1279: Store the print job using a little-endian key. + + +o Eric Mertens + o Compile fix for OpenBSD (ENOTSUP not supported). + + +o Stefan Metzmacher + * Correct bug in disks quota views from explorer. + + +o Tim Potter + BUG 1305: Correct debug output. + + +o Richard Sharpe + * Fix incorrect error code mapping. + + +o Jelmer Vernooij + * Add additional NT_STATUS errorm mappings. + + + -------------------------------------------------- + + ============================= + Release Notes for Samba 3.0.3 + April 29, 2004 + ============================= + + +Common bugs fixed in Samba 3.0.3 include: + + o Crash bugs and change notify issues in Samba's printing code. + o Honoring secondary group membership on domain member servers. + o TDB scalability issue surrounding the TDB_CLEAR_IF_FIRST flag. + o Substitution errors for %[UuGg] in smb.conf. + o winbindd crashes when using ADS security mode. + o SMB signing errors. + o Delays in winbindd startup caused by unnecessary + connections to trusted domain controllers. + o Various small memory leaks. + o Winbindd failing due to expired Kerberos tickets. + +New features introduced in Samba 3.0.3 include: + + o Improved support for i18n character sets. + o Support for account lockout policy based on + bad password attempts. + o Improved support for long password changes (>14 + characters) and strong password enforcement. + o Support for Windows aliases (i.e. nested groups). + o Experimental support for storing DOS attribute on files + and folders in Extended Attributes. + o Support for local nested groups via winbindd. + o Specifying options to be passed directly to the CUPS libraries. + +Please be aware that the Samba source code repository was +migrated from CVS to Subversion on April 4, 2004. Details on +accessing the Samba source tree via anonymous svn can be found +at http://svn.samba.org/samba/subversion.html. + + +Changes since 3.0.2a +-------------------- +smb.conf changes +---------------- + + Parameter Name Action + -------------- ------ + cups options New + ea support New + only user Deprecated + store dos attributes New + unicode Removed + winbind nested groups New + + +commits +------- + +o Jeremy Allison + * Ensure that Kerberos mutex is always properly unlocked. + * Removed Heimdal "in-memory keytab" support. + * Fixup the 'multiple-vuids' bugs in our server code. + * Correct return code from lsa_lookup_sids() on unmapped + sids (based on work by vl@samba.org). + * Fix the "too many fcntl locks" scalability problem + raised by tridge. + * Fixup correct (as per W2K3) returns for lookupsids + as well as lookupnames. + * Fixups for delete-on-close semantics as per Win2k3 behavior. + * Make SMB_FILE_ACCESS_INFORMATION call work correctly. + * Fix "unable to initialize" bug when smbd hasn't been run with + new system and a user is being added via pdbedit/smbpasswd. + * Added NTrename SMB (0xA5). + * Fixup correct timeout values for blocking lock timeouts. + * Fix various bugs reported by 'gentest'. + * More locking fixes in the case where we own the lock. + * Fix up regression in IS_NAME_VALID and renames. + * Don't set allocation size on directories. + * Return correct error code on fail if file exists and target + is a directory. + * Added client "hardlink" comment to test doing NT rename with + hard links. Added hardlink_internals() code - UNIX extensions + now use this as well. + * Use a common function to parse all pathnames from the wire for + much closer emulation of Win2k3 error return codes. + * Implement check_path_syntax() and rewrite string sub + functions for better multibyte support. + * Ensure msdfs referrals are multibyte safe. + * Allow msdfs symlink syntax to be more forgiving. + eg. sym_link -> msdfs://server/share/path/in/share + or sym_link -> msdfs:\\server\share\path\in\share. + * Cleanup multibyte netbios name support in nmbd ( based on patch + by MORIYAMA Masayuki ). + * Fix check_path_syntax() for multibyte encodings which have + no '\' as second byte (based on work by ab@samba.org. + * Fix the "dfs self-referrals as anonymous user" problem + (based on patch from vl@samba.org). + * BUG 1064: Ensure truncate attribute checking is done correctly + on "hidden" dot files. + * Fix bug in anonymous dfs self-referrals again. + * Fix get/set of EA's in client library + * Added support for OS/2 EA's in smbd server. + * Added 'ea support' parameter to smb.conf. + * Added 'store dos attributes' parameter to smb.conf. + * Fix wildcard identical rename. + * Fix reply_ctemp - make compatible with w2k3. + * Fix wildcard unlink. + * Fix wildcard src with wildcard dest renames. + * BUG 1139: Fix based on suggestion by jdev@panix.com. + swap lookups for user and group - group will do an + algorithmic lookup if it fails, user won't. + * Make EA's lookups case independent. + * Fix SETPATHINFO in 'unix extensions' support. + * Make 3.x pass the Samba 4.x RAW-SEARCH tests - except for + the UNIX info levels, and the short case preserve names. + + +o Timur Bakeyev + * BUG 1144: only set --with-fhs when the argument is 'yes' + * BUG 1152: Allow python modules to build despite libraries added + to LDFLAGS instead of LDPATH. + * BUG 1141: Fix nss*.so names on FreeBSD 5.x. + + +o Craig Barratt + * BUG 389: Allow multiple exclude arguments with smbclient + tar -Xr options (better support for Amanda backup client). + + +o Andrew Bartlett + * Include support for linking with cracklib for enforcing strong + password changes. + * Add support for >14 character password changes from Windows + clients. + * Add 'admin set password' capability to 'net rpc'. + * Allow 'net rpc samdump' to work with any joined domain + regardless of smb.conf settings. + * Use an allocated buffer for count_chars. + * Add sanity checks for changes in the domain SID in an + LDAP DIT. + * Implement python unit tests for Samba's multibyte string + support. + * Remove 'unicode' smb.conf option. + * BUG 1138: Fix support for 'optional' SMB signing and other + signing bugs. + * BUG 169: Fix NTLMv2-only behavior. + * Ensure 'net' honors the 'netbios name' in the smb.conf by + default. + * Support SMB signing on connections using only the LANMAN + password and generate the correct the 'session key' for these + connections. + * Implement --required-membership-of=, an ntlm_auth option + that restricts all authentication to members of this particular + group. + * Improve our fall back code for password changes. + * Only send the ntlm_auth 'ntlm-server-1' helper client a '.' + after the server had said something (such as an error). + * Add 'ntlm-server-1' helper protocol to ntlm_auth. + + +o Alexander Bokovoy + * Fix incorrect size calculation of the directory name + in recycle.so. + * Fix problems with very long filenames in both smbd and smbclient + caused by truncating paths during character conversions. + * Fix smbfs problem with Tree Disconnect issued before smbfs + starts its work. + + +o Gerald Carter + * BUG 850: Fix 'make installmodules' bug on True64. + * BUG 66: mark 'only user' deprecated. + * Remove corrupt tdb and shutdown (only for printing tdbs, + connections, sessionid & locking). + * decrement smbd counter in connections.tdb in smb_panic(). + * RedHat specfile updates. + * Fix xattr.h build issue on Debian testing and SuSE 8.2. + * BUG 1147; bad pointer case in get_stored_queue_info() + causing seg fault. + * BUG 761: read the config file before initialized default + values for printing options; don't default to bsd printing + Linux. + * Allow the 'printing' parameter to be set on a per share basis. + * BUG 503: RedHat/Fedora packaging fixes regarding logrotate. + * BUG 848: don't create winbind local users/groups that already + exist in the tdb. + * BUG 1080: fix declaration of SMB_BIG_UINT (broke compile on + LynxOS/ppc). + * BUG 488: fix the 'show client in col 1' button and correctly + enumerate active connections. + * BUG 1007 (partial): Fix abort in smbd caused by byte ordering + problem when storing the updating pid for the lpq cache. + * BUG 1007 (partial): Fix print change notify bugs. + * BUG 1165, 1126: Fix bug with secondary groups (security = ads) + and winbind use default domain = yes. Also ensures that + * BUG 1151: Ensure that winbindd users are passed through + the username map. + * Fix client rpc binds for ASU derived servers (pc netlink, + etc...). + * BUG 417, 1128: Ensure that the current_user_info is set + consistently so that %[UuGg] is expanded correctly. + * BUG 1195: Fix crash in winbindd when the ADS server is + unavailable. + * BUG 1185: Set reconnect time to be the same as the + 'winbind cache time'. + * Ensure that we return the sec_desc in smb_io_printer_info_2. + * Change Samba printers Win32 attribute to PRINTER_ATTRIBUTE_LOCAL. + * BUG 1095: Honor the '-l' option in smbclient. + * BUG 1023: surround get_group_from_gid() with become_unbecome_root() + block. + * Ensure server schannel uses the auth level requested by the + client. + * Removed --with-cracklib option due to potential crash issue. + * Fix -lcrypto linking problem with wbinfo. + * BUG 761: allow printing parameter to set defaults on a per + share basis. + * Add 'cups options' parameter to allow raw printing without + changing /etc/cups/cupsd.conf. + * BUG 1081, 1183: Added remove_duplicate_gids() to smbd and + winbindd. + * BUG 1246: Fix typo in Fedora /etc/init.d/winbind. + * BUG 1288: resolve any machine netbios name (0x00) and not just + servers (0x20). + * BUG 1199: Fix potential symlink issue in + examples/printing/smbprint. + + +o Robert Dahlem + * BUG 1048: Don't return short names when when 'mangled names = no' + + +o Guenther Deschner + * Remove hard coded attribute name in the ads ranged retrieval + code. + * Add --with-libdir and --with-mandir to autoconf script. + + +o Bostjan Golob + * BUG 1046: Fix getpwent_list() so that the username is not + overwritten by other fields. + + +o Landon Fuller + * BUG 1232: patch from landonf@opendarwin.org (Landon Fuller) + to fix user/group enumeration on systems whose libc does not + call setgrent() before trying to enumerate users (i.e. + FreeBSD 5.2). + + +o Steve French + * Update mount.cifs to version 1.1. + * Disable dev (MS_NODEV) on user mounts from cifs vfs. + * Fixes to minor security bug in the mount helper. + * Fix credential file mounting for cifs vfs. + * Fix free of incremented pointer in cifsvfs mount helper. + * Fix path canonicalization of the mount target path and help + text display in the cifs mount helper. + * Add missing guest mount option for mount.cifs. + + +o SATOH Fumiyasu + * BUG 1055; formatting fixes for 'net share'. + * BUG 692: correct truncation of share names and workgroup + names in smbclient. + * BUG 1088: use strchr_m() for query_host (smbclient -L). + * Patch from to internally count characters correctly. + + +o Paul Green + * Update VOS _POSIX_C_SOURCE macro to 200112L. + * Fix bug in configure.ion by moving the first use of + AC_CHECK_HEADERS so it is always executed. + * Fix configure.in to only use $BLDSHARED to select whether to + build static or shared libraries. + + +o Pat Haywarrd + * Make the session_users list dynamic (max of 128K). + + +o Cal Heldenbrand + * Fix for for 'pam_smbpass migrate' functionality. + + +o Chris Hertel + * fix enumeration of shares 12 characters in length via + smbclient. + + +o Ulrich Holeschak + * BUG 932: fix local password change using pam_smbpass + + +o Krischan Jodies + * Implement 'net rpc group delete' + + +o John Klinger + * Return NSS_SUCCESS once the max number of gids possible + has been found in initgroups() on Solaris. + * BUG 1182: Re-enable the -n 'no cache' option for winbindd. + + +o Volker Lendecke + * Fix success message for net groupmap modify. + * Fix errors when enumerating members of groups in 'net rpc'. + * Match Windows behavior in samr_lookup_names() by returning + ALIAS(4) when you search in BUILTIN. + * Fix server SAMR code to be able to set alias info for + builtin as well. + * Fix duplication of logic when creating groups via smbd. + * Ensure that the HWM values are set correctly after running + 'net idmap'. + * Add 'net rpc group add'. + * Implement 'net groupmap set' and 'net groupmap cleanup'. + * Add 'net rpc group [add|del]mem' for domain groups and aliases. + * Fix wb_delgrpmem (wbinfo -o). + * As a DC we should not reply to lsalookupnames on DCNAME\\user. + * Fix sambaUserWorkstations on a Samba DC. + * Implement wbinfo -k: Have winbind generate an AFS token after + authenticating the user. + * Add expand_msdfs VFS module for providing referrals based on the + the client's IP address. + * Implement client side NETLOGON GetDCName function. + * Fix caching of name->sid lookups. + * Add support in winbindd for expanding nested local groups. + * Fix memleak in winbindd. + * Fix msdfs proxy. + * Don't list domain groups from BUILTIN. + * Fix memleak in policy handle utility functions. + * Decrease winbindd startup time by only contacting trusted + domains as necessary. + * Allow winbindd to ask the DC for its domain for a trusted + DC. + * Fix Netscape DS schema based on comments from + . + * Correct case where adding a domain user to a XP local group + did a lsalookupname on the user without domain prefix, and + failed. + * Fix segfault in winbindd caused by 'wbinfo -a'. + + +o Herb Lewis + * Fix typo for tag in proto file. + * Add missing #ifdef HAVE_BICONV stuff. + * Truncate Samba's netbios name at the first '.' (not + right to left). + + +o Derrell Lipman + * Bug fixes and enhancements to libsmbclient library. + + +o Jianliang Lu + * Enforce the 'user must change password at next login' flag. + * Decode meaning of 'fields present' flags (improves support + for usrmgr.exe). + * NTLMv2 fixes. + * Don't force an upper case domain name in the ntlmssp code. + + +o L. Lucius . + * type fixes. + + +o Jim McDonough + * Add versioning support to tdbsam. + * Update the IBM Directory Server schema with the OpenLDAP + file. + * Various decoding fixes to improve usrmgr.exe support. + * Fix statfs redeclaration of statfs struct on ppc + * Implement support for password lockout of Samba domain + controllers and standalone servers. + * Get MungedDial attribute actually working with full TS + strings in it for pdb_ldap. + * BUG 1208 (partial): Improvements for working with expired krb5 + tickets in winbindd. + * Use timegm, or our already existing replacement instead of + timezone (spotted by Andrzej Tobola ). + * Remove modifyTimestamp from list of our attributes. + * Fix lsalookupnames to check for domain users as well as local + users. + * Merge struct uuid replacement for GUID from trunk. + * BUG 1208: Finish support for handling expired tickets in + winbindd (in conjunction with Guenther Deschner ). + + +o Stefan Metzmacher + * Implement new VERSION schema based on subversion revision + numbers. + * Add shadow_copy vfs module. + * Fix segault in login_cache support. + + +o Heinrich Mislik + o BUG 979 -- Fix quota display on AIX. + + +o James Peach + * Correct check for printf() format when using the SGI MIPSPro + compiler. + * BUG 1038: support backtrace for 'panic action' on IRIX. + * BUG 768: Accept profileing arg to IRIX init script. + * BUG 748: Relax arg parsing to sambalp script (IRIX). + * BUG 758: Fix pdma build. + * Search IRIX ABI paths for libiconv. Based on initial fix from + Jason Mader. + + +o Kurt Pfeifle + * Add example shell script for migrating drivers and printers + from a Windows print server to a Samba print server using + smbclient/rpcclient (examples/printing/VamireDriversFunctions). + + +o Tim Potter + * Fix logic bug in tdb non-blocking lock routines when + errno == EAGAIN. + * BUG 1025: Include sys/acl.h in check for broken nisplus + include files. + * BUG 1066: s/printf/d_printf/g in SWAT. + * BUG 1098: rename internal msleep() function to fix build + problems on AIX. + * BUG 1112: Fix for writable printerdata problem in python bindings. + * BUG 1154: Remove reference to in tdbdump.c. + * BUG 1155: enclose use of fchown() with guards. + * Relicense tdb python module as LGPL. + + +o Richard Sharpe + * Add support to smbclient for multiple logins on the same + session (based on work by abartlet@samba.org). + * Correct blocking condition in smbd's use of accept() on IRIX. + * Add support for printing out the MAC address on nmblookup. + + +o Simo Sorce + * Replace unknown_3 with fields_present in SAMR code. + * More length checks in strlcat(). + + +o Andrew Tridgell + * Rewrote the AIX UESS backend for winbindd. + * Fixed compilation with --enable-dmalloc. + * Change tdb license to LGPL (see source/tdb/tdb.c). + * Force winbindd to use schannel in clients connections to + DC's if possible. + + +o Jelmer Vernooij + * Fix ETA Calculation when resuming downloads in smbget. + * Add -O (for writing downloaded files to standard out) + based on patch by Bas van Sisseren . + * Fix syntax error in example mysql table + + +o TAKEDA yasuma + * BUG 900: fix token processing in cmd_symlink, cmd_link, + cmd_chown, cmd_chmod smbclient functions. + + +o Shiro Yamada + * BUG 1129: install image files for SWAT. + + + -------------------------------------------------- + + ============================== + Release Notes for Samba 3.0.2a + February 13, 2004 + ============================== + +Samba 3.0.2a is a minor patch release for the 3.0.2 code base +to address, in particular, a problem when using pdbedit to +sanitize (--force-initialized-passwords) Samba's tdbsam +backend. This is the latest stable release of Samba. This +is the version that all production Samba servers should be +running for all current bug-fixes. + +******************* Attention! Achtung! Kree! ********************* + +Beginning with Samba 3.0.2, passwords for accounts with a last +change time (LCT-XXX in smbpasswd, sambaPwdLastSet attribute in +ldapsam, etc...) of zero (0) will be regarded as uninitialized +strings. This will cause authentication to fail for such +accounts. If you have valid passwords that meet this criteria, +you must update the last change time to a non-zero value. If you +do not, then 'pdbedit --force-initialized-passwords' will disable +these accounts and reset the password hashes to a string of X's. + +******************* Attention! Achtung! Kree! ********************* + + +Changes since 3.0.2 +------------------- + +commits +------- + +Please refer to the CVS log for the SAMBA_3_0 branch for complete +details. The list of changes per contributor are as follows: + + +o Jeremy Allison + * Added paranoia checks in parsing code. + + +o Andrew Bartlett + * Ensure that changes to uninitialized passwords in ldapsam + are written to the DIT. + + +o Gerald (Jerry) Carter + * Fixed iterator in tdbsam. + * Fix bug that disabled accounts with a valid NT password + hash, but no LanMan hash. + + +o Steve French + * Added missing nosetuid and noexec options. + + +o Bostjan Golob + * BUG 1046: Don't overwrite usernames of entries returned + by getpwent_list(). + + +o Sebastian Krahmer + * Fixed potential crash bug in NTLMSSP parsing code. + + +o Tim Potter + * Fixed logic in tdb_brlock error checking. + + +o Urban Widmark + * Set nosuid,nodev flags in smbmnt by default. + + + -------------------------------------------------- + + ============================= + Release Notes for Samba 3.0.2 + February 9, 2004 + ============================= + +It has been confirmed that previous versions of Samba 3.0 are +susceptible to a password initialization bug that could grant an +attacker unauthorized access to a user account created by the +mksmbpasswd.sh shell script. + +The Common Vulnerabilities and Exposures project (cve.mitre.org) +has assigned the name CAN-2004-0082 to this issue. + +Samba administrators not wishing to upgrade to the current +version should download the 3.0.2 release, build the pdbedit +tool, and run + + root# pdbedit-3.0.2 --force-initialized-passwords + +This will disable all accounts not possessing a valid password +(e.g. the password field has been set a string of X's). + +Samba servers running 3.0.2 are not vulnerable to this bug +regardless of whether or not pdbedit has been used to sanitize +the passdb backend. + +Some of the more visible bugs in 3.0.1 addressed in the 3.0.2 +release include: + + o Joining a Samba domain from Pre-SP2 Windows 2000 clients. + o Logging onto a Samba domain from Windows XP clients. + o Problems with the %U and %u smb.conf variables in relation to + Windows 9x/ME clients. + o Kerberos failures due to an invalid in memory keytab detection + test. + o Updates to the ntlm_auth tool. + o Fixes for various SMB signing errors. + o Better separation of WINS and DNS queries for domain controllers. + o Issues with nss_winbind FreeBSD and Solaris. + o Several crash bugs in smbd and winbindd. + o Output formatting fixes for smbclient for better compatibility + with scripts based on the 2.2 version. + + +Changes since 3.0.1 +------------------- + +smb.conf changes +---------------- + + Parameter Name Action + -------------- ------ + ldap replication sleep New + read size removed (unused) + source environment removed (unused) + + +commits +------- + +Please refer to the CVS log for the SAMBA_3_0 branch for complete +details. The list of changes per contributor are as follows: + +o Jeremy Allison + * Revert change that broke Exchange clear text samlogons. + * Fix gcc 3.4 warning in MS-DFS code. + * Tidy up of NTLMSSP code. + * Fixes for SMB signing errors + * BUG 815: Workaround NT4 bug to support plaintext + password logins and UNICODE. + * Fix SMB signing bug when copying large files. + * Correct error logic in mkdir_internals() (caused a panic + when combined with --enable-developer). + * BUG 830: Protect against crashes due to bad character + conversions. + + +o Petri Asikainen + * BUG 330, 387:Fix single valued attribute updates when + working with Novell NDS. + + +o Andrew Bartlett + * Correctly handle per-pipe NTLMSSP inside a NULL session. + * Fix segfault in gencache + * Fix early free() of encrypted_session_key. + * Change DC lookup routines to more carefully separate + DNS names (realms) from NetBIOS domain names. + * Add new sid_to_dn() function for internal winbindd use. + * Refactor cli_ds_enum_domain_trusts(). + * BUG 707: Implement range retrieval of ADS attributes (based + on work from Volker and Guenther Deschner + ). + * Automatically initialize the signing engine if a session key + is available. + * BUG 916: Do not perform a + -> ' ' substitution for squid URL + encoded strings, only form input in SWAT. + * Resets the NTLMSSP state for new negotiate packets. + * Add 2-byte alignments in net_samlogon() queries to parse + odd-length plain text passwords. + * Allow Windows groups with no members in winbindd. + * Allow normal authentication in the absence of a server + generated session key. + * More optimizations for looking up UNIX group lists. + * Clean up error codes and return values for pam_winbindd + and winbindd PAM interface. + * Fix string return values in ntlm_auth tool. + * Fix segfault when 'security = ads' but no realm is defined. + * BUG 722: Allow winbindd to map machine accounts to uids. + * More cleanups for winbindd's find_our_domain(). + * More clearly detect whether a domain controller is an NT4 + or mixed-mode AD DC (additional bug fixes by jerry & jmcd). + * Increase separation between DNS queries for hosts and queries + for AD domain controllers. + * Include additional NT_STATUS to PAM error mappings. + * Password initialization fixes. + + +o Justin Baugh + * BUG 948: Implement missing functions required for FreeBSD + nss_winbind support. + + +o Alexander Bokovoy + * BUG 922: Make sure enable fast path for strlower_m() and + strupper_m(). + + +o Luca Bolcioni + * Fix crash when using 'security = server' and 'encrypt + passwords = no' by always initializing the session key. + + +o Dmitry Butskoj + * Fix for special files being hidden from admins. + + +o Gerald (Jerry) Carter + * Fix bug in the lanman session key generation. Caused + "decode_pw: incorrect password length" error messages. + * Save the right case for the located user name in + fill_sam_account(). Fixes %U/%u expansion for win9x clients. + * BUG 897: Add well known rid for pre win2k compatible access + group. + * BUG 887: Correct typo in delete user script example. + * Use short lived TALLOC_CTX* for allocating printer objects + from the print handle cache. + * BUG 912: Fix check for HAVE_MEMORY_KEYTAB. + * Fix several warnings reported by the SUN Forte C compiler. + * Fully control DNS queries for AD DC's using 'name resolve order'. + * BUG 770: Send the SMBjobid for UNIX jobs back to the client. + * BUG 972: Fix segfault in cli_ds_getprimarydominfo(). + * BUG 936: fix bind credentials for schannel binds in smbd. + * BUG 446: Fix output of smbclient for better compatibility + with scripts based on the 2.2 version (including Amanda). + * BUG 891, 949: Fedora packaging fixes. + * Fix bug that caused rpcclient to incorrectly retrieve + the SID for a server (this causing all calls that required + this information to fail). + * BUG 977: Don't create a homes share for a user if a static + share already exists by the same name. + * Removed unused smb.conf options. + * Password initialization fixes. + * Set the disable flag for template accounts created by + mksmbpasswd.sh. + * Disable any account has no passwords and does not have the + ACB_PWNOTREQ bit set. + + +o Guenther Deschner + * Install smbwrapper.so should be put into the $(libdir) + and not $(bindir). + * Add the capability to specify the new user password + for "net ads password" on the command line. + * Correctly detect AFS headers on SuSE. + + +o James Flemer + * Fix AIX compile bug by linking HAVE_ATTR_LIST to + HAVE_SYS_ATTRIBUTES_H. + + +o Luke Howard + * Fix segfault in session setup reply caused by a early free(). + + +o Stoian Ivanov + * Implement grepable output for smbclient -L. + + +o LaMont Jones + * BUG 225328 (Debian): Correct false failure LFS test that resulted + in _GNU_SOURCE not being defined (thus resulting in strndup() + not being defined). + + +o Volker Lendecke + * BUG 583: Ensure that user names always contain the short + version of the domain name. + * Fix our parsing of the LDAP uri. + * Don't show the 'afs username map' in the SWAT basic view. + * Fix SMB signing issues in relation to failed NTLMSSP logins. + * BUG 924: Fix return codes in smbtorture harness. + * Always lower-case usernames before handing it to AFS code. + * Add a German translation for SWAT. + * Fix a segfaults in winbindd. + * Fix the user's domain passed to register_vuid() from + reply_spnego_kerberos(). + * Add NSS example code in nss_winbind to convert UNIX + id's <-> Windows SIDs. + * Display more descriptive error messages for login via 'net'. + * Fix compiler warning in the net tool. + * Fix length bug when decoding base64 strings. + * Ensure we don't call getpwnam() inside a loop that is iterating + over users with getpwent(). This broke on glibc 2.3.2. + + +o Herb Lewis + * Fix bit rot in psec. + + +o Jianliang Lu + * Ensure we delete the group mapping before calling the delete + group script. + * Define well known RID for managing the "Power Users" group. + * BUG 381: check builtin (not local) group SID when updating + group membership. + * BUG 101: set the SV_TYPE_PRINTQ_SERVER flag in host announcement + packet. + + +o John Klinger + * Implement initgroups() call in nss_winbind on Solaris. + + +o Jim McDonough + * Fix regression in net rpc join caused by recent changes + to cli_lsa_query_info_policy(). + * BUG 964: Fix crash bug in 'net rpc join' using a preexisting + machine account. + + +o MORIYAMA Masayuki + * BUG 570: Ensure that configure honors the LDFLAGS variable. + + +o Stefan Metzmacher + * Implement LDAP rebind sleep patch. + * Revert to 2.2 quota code because of so many broken quota files + out there. + * Fix XFS quotas: HAVE_XFS_QUOTA -> HAVE_XFS_QUOTAS + XFS_USER_QUOTA -> USRQUOTA + XFS_GROUP_QUOTA -> GRPQUOTA + * Fix disk_free calculation with group quotas. + * Add debug class 'quota' and a lot of DEBUG()'s + to the quota code. + * Fix sys_chown() when no chown() is present. + * Add SIGABRT to fault handling in order to catch got a + backtrace if an error occurs the OpenLDAP client libs. + + +o + * Allow an existing LDAP machine account to be re-used when + joining an AD domain. + + +o James Peach + * BUG 889: Change smbd to use pread/pwrite on platforms that + support these calls. Can lead to a significant speed increase. + + +o Tim Potter + * BUG 905: Remove POBAD_CC to fix Solaris Forte compiles. + * BUG 924: Fix typo in RW2 torture test. + + +o Richard Sharpe + * Small fixes to torture.c to cleanup the error handling + and prevent crashes. + + +o J. Tournier + * Small fixes for the smbldap-tool scripts. + + +o Andrew Tridgell + * Fix src len check in pull_usc2(). + + +o Jelmer Vernooij + * Put functions for generating SQL queries in pdb_sql.c + * Add pgSQL backend (based on patch by Hamish Friedlander) + * BUG 908: Fix -s option to smbcontrol. + * Add smbget utility - a wget-clone for the SMB/CIFS protocol. + * Fix for libnss_wins on IRIX platforms. + * Fix swatdir for --with-fhs. + + + -------------------------------------------------- + + ============================= + Release Notes for Samba 3.0.1 + December 15, 2003 + ============================= + +Some of the more common bugs in 3.0.0 addressed in the release +include: + + o Substitution problems with smb.conf variables. + o Errors in return codes which caused some applications + to fail to open files. + o General Protection Faults on Windows 2000/XP clients + using Samba point-n-print features. + o Several miscellaneous crash bugs. + o Access problems when enumerating group mappings are + stored in an LDAP Directory. + o Several common SWAT bugs when writing changes to + smb.conf. + o Internal inconsistencies when 'winbind use default + domain = yes' + + + +Changes since 3.0.0 +---------------------- + + Parameter Name Action + -------------- ------ + hide local users Removed + mangled map Deprecated + mangled stack Removed + passwd chat timeout New + + +commits +------- + +o Change the interface for init_unistr2 to not take a length + but a flags field. We were assuming that + 2*strlen(mb_string) == length of ucs2-le string. (bug 480). +o Allow d_printf() to handle strings with escaped quotation + marks since the msg file includes the escape character (bug 489). +o Fix bad html table row termination in SWAT wizard code (bug 413). +o Fix to parse the level-2 strings. +o Fix for "valid users = %S" in [homes]. Fix read/write + list as well. +o Change AC_CHECK_LIB_EXT to prepend libraries instead of append. + This is the same way AC_CHECK_LIB works (bug 508). +o Testparm output fixes for clarity. +o Fix broken wins hook functionality -- i18n bug (bug 528). +o Take care of condition where DOS and NT error codes must differ. +o Default to using only built-in charsets when a working iconv + implementation cannot be located. +o Wrap internals of sys_setgroups() so the sys_XX() call can + be done unconditionally (bug 550). +o Remove duplicate smbspool link on SWAT's front page (bug 541). +o Save and restore CFLAGS before/after AC_PROG_CC. Ensures that + --enable-debug=[yes|no] works correctly. +o Allow ^C to interrupt smbpasswd if using our getpass + (e.g. smbpasswd command). +o Support signing only on RPC's (bug 167). +o Correct bug that prevented Excel 2000 clients from opening + files marked as read-only. +o Portability fix bugs 546 - 549). +o Explicitly initialize the value of AR for vendor makes that don't + do this (e.g. HPUX 11). (bug 552). +o More i18n fixes for SWAT (bug 413). +o Change the cwd before the postexec script to ensure that a + umount will succeed. +o Correct double free that caused winbindd to crash when a DC + is rebooted (bug 437). +o Fix incorrect mode sum (bug 562). +o Canonicalize SMB_INFO_ALLOCATION in the same was as + SMB_FS_FULL_SIZE_INFORMATION (bug 564). +o Add script to generate *msg files. +o Add Dutch SWAT translation file. +o Make sure to call get_user_groups() with the full winbindd + name for a user if he/she has one (bug 406). +o Fix up error code returns from Samba4 tester. Ensure invalid + paths are validated the same way. +o Allow Samba3 to pass the Samba4 RAW-READ tests. +o Refuse to configure if --with-expsam=$BACKEND was used but no + libraries were found for $BACKEND. +o Move sysquotas autoconf tests to a separate file. +o Match W2K w.r.t. writelock and writeclose. Samba4 torture + tester +o Make sure that the files that contain the static_init_$subsystem; + macro get recompiled after configure by removing the object + files. +o Ensure canceling a blocking lock returns the correct error + message. +o Match Samba 2.2 behavior; make ACB_NORMAL the default ACB value. +o Updated Japanese welcome file in SWAT. +o Fix to nt-time <-> unix-time functions reversible. +o Ensure that winbindd uses the the escaped DN when querying + an AD ldap server. +o Fix portability issues when compiling (bug 505, 550) +o Compile fix for tdbbackup when Samba needs to override + non-C99 compliant implementations of snprintf(). +o Use @PICSUFFIX@ instead of .po in Makefile.in (bug 574). +o Make sure we break out of samsync loop on error. +o Ensure error code path doesn't free unmalloc()'d memory + (bug 628). +o Add configure test for krb5_keytab_entry keyblock vs key + member (bug 636). +o Fixed spinlocks. +o Modified testparm so that all output so all debug output goes + to stderr, and all file processing goes to stdout. +o Fix error return code for BUFFER_TOO_SMALL in smbcacls + and smbcquotas. +o Fix "NULL dest in safe_strcpy()" log message by ensuring that + we have a devmode before copying a string to the devicename. +o Support mapping REALM.COM\user to a local user account (without + running winbindd) for compatibility with 2.2.x release. +o Ensure we don't use mmap() on blacklisted systems. +o fixed a number of bugs and memory leaks in the AIX + winbindd shim +o Call initgroups() in SWAT before becomming the user so that + secondary group permissions can be used when writing to + smb.conf. +o Fix signing problems when reverse connecting back to a + client for printer notify +o Fix signing problems caused by a miss-sequence bug. +o Missing map in errormap for ERROR_MORE_DATA -> ERRDOS, ERRmoredata. + Fixes NEXUS tools running on Win9x clients (bug 64). +o Don't leave the domain field uninitialized in cli_lsa.c if some + SID could not be mapped. +o Fix segfault in mount.cifs helper when there is no options + specified during mount. +o Change the \n after the password prompt to go to tty instead + of stdout (bug 668). +o Stop net -P from prompting for machine account password (bug 451). +o Change in behavior to Not only change the effective uid but also + the real uid when becoming unprivileged. +o Cope with Exchange 5.5 cleartext pop password auth. +o New files for support of initshutdown pipe. Win2k doesn't + respond properly to all requests on the winreg pipe, so we need + to handle this new pipe (bug 534). +o Added more va_copy() checks in configure.in. +o Include fixes for libsmbclient build problems. +o Missing UNIX -> DOS codepage conversion in lanman.c. +o Allow DFMS-S filenames can now have arbitrary case (bug 667). +o Parameterize the listen backlog in smbd and make it larger by + default. A backlog of 5 is way too small these days. +o Check for an invalid fid before dereferencing the fsp pointer + (bug 696). +o Remove invalid memory frees and return codes in pdb_ldap.c. +o Prompt for password when invoking --set-auth-user and no + password is given. +o Bind the nmbd sending socket to the 'socket address'. +o Re-order link command for smbd, rpcclient and smbpasswd to ensure + $LDFLAGS occurs before any library specification (bug 661). +o Fix large number of printf() calls for 64-bit size_t. +o Fix AC_CHECK_MEMBER so that SLES8 does correctly finds the + keyblock in the krb5 structs. +o Remove #include in hopes to avoid problems with + apache header files. +o Correct winbindd build problems on HP-UX 11. +o Lowercase netgroups lookups (bug 703). +o Use the actual size of the buffer in strftime instead of a made + up value which just happens to be less than sizeof(fstring). + (bug 713). +o Add ldaplibs to pdbedit link line (bug 651). +o Fix crash bug in smbclient completion (bug 659). +o Fix packet length for browse list reply (bug 771). +o Fix coredump in cli_get_backup_list(). +o Make sure that we expand %N (bug 612). +o Allow rpcclient adddriver command to specify printer driver + version (bug 514). +o Compile tdbdump by default. +o Apply patches to fix iconv detection for FreeBSD. +o Do not allow the 'guest account' to be added to a passdb backend + using smbpasswd or pdbedit (bug 624). +o Save LDFLAGS during iconv detection (bug 57). +o Run krb5 logins through the username map if the winbindd + lookup fails (bug 698). +o Add const for lp_set_name_resolve_order() to avoid compiler + warnings (bug 471). +o Add support for the %i macro in smb.conf to stand in for the for + the local IP address to which a client connected. +o Allow winbindd to match local accounts to domain SID when + 'winbind trusted domains only = yes' (bug 680). +o Remove code in idmap_ldap that searches the user suffix and group + suffix. It's not needed and provides inconsistent functionality + from the tdb backend. +o Patch to handle munged dial string for Windows 2000 TSE. + Thanks to Gaz de France, Direction de la Recherche, Service + Informatique Métier for their supporting this work by Aurelien + Degrémont . +o Correct the "smbldap_open: cannot access when not root error" + messages when looking up group information (bug 281). +o Skip over the winbind separator when looking up a user. + This fixes the bug that prevented local users from + matching an AD user when not running winbindd (bug 698). +o Fix a problem with configure on *BSD systems. Make sure + we add -liconv etc to LDFLAGS. +o Fix core dump bug when "security = server" and the authentication + server goes away. +o Correct crash bug due to an empty munged dial string. +o Show files locked by a specific user (smbstatus -u 'user') + (bug 590). +o Fix bug preventing print jobs from display in the queue + monitor used by Windows NT and later clients (bug 660). +o Fix several reported problems with point-n-print from + Windows 2000/XP clients due to a bug in the EnumPrinterDataEx() + reply (bug 338, 527 & 643). +o Fix a handful of potential memory leaks in the LDAP code used + by ldapsam[_compat] and the LDAP idmap backend. +o Fix for pdbedit error code returns (bug 763). +o Make sure we only enumerate group mapping entries (not + /etc/group) even when doing local aliases. +o Relax check on the pipe name in a dce/rpc bind response to work + around issues with establishing trusts to a Windows 2003 domain. +o Ensure we mangle names ending in '.' in hash2 mangling method. +o Correct parsing issues with munged dial string. +o Fix bugs in quota support for XFS. +o Add a cleaner method for applications that need to provide + name->SID mappings to do this via NSS rather than having to + know the winbindd pipe protocol. +o Adds a variant of the winbindd_getgroups() call called + winbindd_getusersids() that provides direct SID->SIDs listing of + a users supplementary groups. This is enough to allow non-Samba + applications to do ACL checking. +o Make sure we don't append the 'ldap suffix' when writing out the + 'ldap XXX suffix' values in SWAT (bug 328). +o Fix renames across file systems. +o Ensure that items in a list of strings containing whitespace are + written out surrounded by single quotes. This means that both + double and single quotes are now used to surround strings in + smb.conf (bug 481). +o Enable SWAT to correctly determine if winbindd is running (bug + 398). +o Include WWW-Authenticate field in 401 response for bad auth + attempt (bug 629). +o Add support for NTLM2 (NTLMv2 session security). +o Add support for variable-length session keys. +o More privilege fixes for group enumeration in LDAP (bug 281). +o Use the dns name (or IP) as the originating client name when + using CUPS (bug 467). +o Fix various SMB signing bugs. +o Fix ACL propagation on a DFS root (bug 263). +o Disable NTLM2 for RPC pipes. +o Allow the client to specify the NTLM2 flags got NTLMSSP + authentication. +o Change the name of the job passed off to cups from "Test Page" + to "smbprn.00000033 Test Page" so that we can get the smb + jobid back. This allow users to delete jobs with cups printing + backend (partial work on bug 770). +o Fix build of winbindd with static pdb modules. +o Retrieve the correct ACL group bits if the file has an ACL + (bug 802). +o Implement "net rpc group members": Get members of a domain group + in human-readable format. +o Add MacOSX (Darwin) specific charset module code. +o Use samr_dispinfo(level == 1) for enumerating domain users so we + can include the full name in gecos field (bug 587). +o Add support for winbind's NSS library on FeeeBSD 5.1 (bug 797). +o Implement 'net rpc group list [global|local|builtin]*' for a + select listing of the respective user databases. +o Don't automatically set NT status code flag unless client tells + us it can cope. +o Add 'net status [sessions|shares] [parseable]'. +o Don't mistake pre-existing UNIX jobs for smb jobs (remainder of + bug 770). +o Add 'Replicator' and 'RAS Servers' to list of builtin SIDs + (bug 608). +o Fix inverted logic in hosts allow/deny checks caused by + s/strcmp/strequal/ (bug 846). +o Implement correct version SamrRemoveSidForeignDomain() (bug 252). +o Fix typo in 'hash' mangling algorithm. +o Support munged dial for ldapsam (bug 800). +o Fix process_incoming_data() to return the number of bytes handled + this call whether we have a complete PDU or not; fixes bug + with multiple PDU request rpc's broken over SMBwriteX calls + each. +o Fix incorrect smb flags2 for connections to pre-NT servers + (causes smbclient to fail to OS2 for example) (bug 821). +o Update version string in smbldap-tools Makefile to 0.8.2. +o Correct a problem with "net rpc vampire" mis-parsing the + alias member info reply. +o Ensure the ${libdir} is created by the installclientlib script. +o Fix detection of Windows 2003 client architecture in the smb.conf + %a variable. +o Ensure that smbd calls the add user script for a missing UNIX + user on kerberos auth call (bug 445). +o Fix bugs in hosts allow/deny when using a mismatched + network/netmask pair. +o Protect alloc_sub_basic() from crashing when the source string + is NULL (partial work on bug 687). +o Fix spinlocks on IRIX. +o Corrected some bad destination paths when running "configure + --with-fhs". +o Add packaging files for Fedora Core 1. +o Correct bug in SWAT install script for non-english languages. +o Support character set ISO-8859-1 internally (bug 558). +o Fixed more LDAP access errors when looking up group mappings + (bug 281). +o Fix UNISTR2 length bug in LsaQueryInfo(3) that caused SID + resolution to fail on local files on on domain members + (bug 875). +o Fix uninitialized variable in passdb.c. +o Fix formal parameter type in get_static() in nsswitch/wins.c. +o Fix problem mounting directories when mount.cifs is installed + with the setuid bit on. +o Fix bug that prevent --mandir from overriding the defaults + given in the --with-fhs macro. +o Fix bug in in-memory Kerberos keytab detection routines + in configure.in + + + +###################################################################### + + The original 3.0.0 release notes follow + ======================================= + WHATS NEW IN Samba 3.0.0 + September 24, 2003 + ======================================= + + +Major new features: +------------------- + +1) Active Directory support. Samba 3.0 is now able to + join a ADS realm as a member server and authenticate + users using LDAP/Kerberos. + +2) Unicode support. Samba will now negotiate UNICODE on the wire + and internally there is now a much better infrastructure for + multi-byte and UNICODE character sets. + +3) New authentication system. The internal authentication system + has been almost completely rewritten. Most of the changes are + internal, but the new auth system is also very configurable. + +4) New default filename mangling system. + +5) A new "net" command has been added. It is somewhat similar to + the "net" command in windows. Eventually we plan to replace + numerous other utilities (such as smbpasswd) with subcommands + in "net". + +6) Samba now negotiates NT-style status32 codes on the wire. This + improves error handling a lot. + +7) Better Windows 2000/XP/2003 printing support including publishing + printer attributes in active directory. + +8) New loadable module support for passdb backends and character + sets. + +9) New default dual-daemon winbindd support for better performance. + +10) Support for migrating from a Windows NT 4.0 domain to a Samba + domain and maintaining user, group and domain SIDs. + +11) Support for establishing trust relationships with Windows NT 4.0 + domain controllers. + +12) Initial support for a distributed Winbind architecture using + an LDAP directory for storing SID to uid/gid mappings. + +13) Major updates to the Samba documentation tree. + +14) Full support for client and server SMB signing to ensure + compatibility with default Windows 2003 security settings. + +15) Improvement of ACL mapping features based on code donated by + Andreas Grünbacher. + + +Plus lots of other improvements! + + +Additional Documentation +------------------------ + +Please refer to Samba documentation tree (included in the docs/ +subdirectory) for extensive explanations of installing, configuring +and maintaining Samba 3.0 servers and clients. It is advised to +begin with the Samba-HOWTO-Collection for overviews and specific +tasks (the current book is up to approximately 400 pages) and to +refer to the various man pages for information on individual options. + +We are very glad to be able to include the second edition of +"Using Samba" by Jay Ts, Robert Eckstein, and David Collier-Brown +(O'Reilly & Associates) in this release. The book is available +on-line at http://samba.org/samba/docs/ and is included with +the Samba Web Administration Tool (SWAT). Thanks to the authors and +publisher for making "Using Samba" under the GNU Free Documentation +License. + + +###################################################################### +Upgrading from a previous Samba 3.0 beta +######################################## + +Beginning with Samba 3.0.0beta3, the RID allocation functions +have been moved into winbindd. Previously these were handled +by each passdb backend. This means that winbindd must be running +to automatically allocate RIDs for users and/or groups. Otherwise, +smbd will use the 2.2 algorithm for generating new RIDs. + +If you are using 'passdb backend = tdbsam' with a previous Samba +3.0 beta release (or possibly alpha), it may be necessary to +move the RID_COUNTER entry from /usr/local/samba/private/passdb.tdb +to winbindd_idmap.tdb. To do this: + +1) Ensure that winbindd_idmap.tdb exists (launch winbindd at least + once) +2) build tdbtool by executing 'make tdbtool' in the source/tdb/ + directory +3) run: (note that 'tdb>' is the tool's prompt for input) + + root# ./tdbtool /usr/local/samba/private/passdb.tdb + tdb> show RID_COUNTER + key 12 bytes + RID_COUNTER + data 4 bytes + [000] 0A 52 00 00 .R. + + tdb> move RID_COUNTER /usr/local/samba/var/locks/winbindd_idmap.tdb + .... + record moved + +If you are using 'passdb backend = ldapsam', it will be necessary to +store idmap entries in the LDAP directory as well (i.e. idmap backend += ldap). Refer to the 'net idmap' command for more information on +migrating SID<->UNIX id mappings from one backend to another. + +If the RID_COUNTER record does not exist, then these instructions are +unneccessary and the new RID_COUNTER record will be correctly generated +if needed. + + + +######################## +Upgrading from Samba 2.2 +######################## + +This section is provided to help administrators understand the details +involved with upgrading a Samba 2.2 server to Samba 3.0. + + +Building +-------- + +Many of the options to the GNU autoconf script have been modified +in the 3.0 release. The most noticeable are: + + * removal of --with-tdbsam (is now included by default; see section + on passdb backends and authentication for more details) + + * --with-ldapsam is now on used to provided backward compatible + parameters for LDAP enabled Samba 2.2 servers. Refer to the passdb + backend and authentication section for more details + + * inclusion of non-standard passdb modules may be enabled using + --with-expsam. This includes an XML backend and a mysql backend. + + * removal of --with-msdfs (is now enabled by default) + + * removal of --with-ssl (no longer supported) + + * --with-utmp now defaults to 'yes' on supported systems + + * --with-sendfile-support is now enabled by default on supported + systems + + +Parameters +---------- + +This section contains a brief listing of changes to smb.conf options +in the 3.0.0 release. Please refer to the smb.conf(5) man page for +complete descriptions of new or modified parameters. + +Removed Parameters (order alphabetically): + + * admin log + * alternate permissions + * character set + * client codepage + * code page directory + * coding system + * domain admin group + * domain guest group + * force unknown acl user + * hide local users + * mangled stack + * nt smb support + * postscript + * printer driver + * printer driver file + * printer driver location + * read size + * source environment + * status + * strip dot + * total print jobs + * use rhosts + * valid chars + * vfs options + +New Parameters (new parameters have been grouped by function): + + Remote management + ----------------- + * abort shutdown script + * shutdown script + + User and Group Account Management + --------------------------------- + * add group script + * add machine script + * add user to group script + * algorithmic rid base + * delete group script + * delete user from group script + * passdb backend + * set primary group script + + Authentication + -------------- + * auth methods + * realm + * passwd chat timeout + + Protocol Options + ---------------- + * client lanman auth + * client NTLMv2 auth + * client schannel + * client signing + * client use spnego + * disable netbios + * ntlm auth + * paranoid server security + * server schannel + * server signing + * smb ports + * use spnego + + File Service + ------------ + * get quota command + * hide special files + * hide unwriteable files + * hostname lookups + * kernel change notify + * mangle prefix + * map acl inherit + * msdfs proxy + * set quota command + * use sendfile + * vfs objects + + Printing + -------- + * max reported print jobs + + UNICODE and Character Sets + -------------------------- + * display charset + * dos charset + * unicode + * unix charset + + SID to uid/gid Mappings + ----------------------- + * idmap backend + * idmap gid + * idmap uid + * winbind enable local accounts + * winbind trusted domains only + * template primary group + * enable rid algorithm + + LDAP + ---- + * ldap delete dn + * ldap group suffix + * ldap idmap suffix + * ldap machine suffix + * ldap passwd sync + * ldap replication sleep + * ldap user suffix + + General Configuration + --------------------- + * preload modules + * private dir + +Modified Parameters (changes in behavior): + + * encrypt passwords (enabled by default) + * mangling method (set to 'hash2' by default) + * passwd chat + * passwd program + * restrict anonymous (integer value) + * security (new 'ads' value) + * strict locking (enabled by default) + * unix extensions (enabled by default) + * winbind cache time (increased to 5 minutes) + * winbind uid (deprecated in favor of 'idmap uid') + * winbind gid (deprecated in favor of 'idmap gid') + + +Databases +--------- + +This section contains brief descriptions of any new databases +introduced in Samba 3.0. Please remember to backup your existing +${lock directory}/*tdb before upgrading to Samba 3.0. Samba will +upgrade databases as they are opened (if necessary), but downgrading +from 3.0 to 2.2 is an unsupported path. + +Name Description Backup? +---- ----------- ------- +account_policy User policy settings yes +gencache Generic caching db no +group_mapping Mapping table from Windows yes + groups/SID to unix groups +winbindd_idmap ID map table from SIDS to UNIX yes + uids/gids. +namecache Name resolution cache entries no +netsamlogon_cache Cache of NET_USER_INFO_3 structure no + returned as part of a successful + net_sam_logon request +printing/*.tdb Cached output from 'lpq no + command' created on a per print + service basis +registry Read-only samba registry skeleton no + that provides support for exporting + various db tables via the winreg RPCs + + +Changes in Behavior +------------------- + +The following issues are known changes in behavior between Samba 2.2 and +Samba 3.0 that may affect certain installations of Samba. + + 1) When operating as a member of a Windows domain, Samba 2.2 would + map any users authenticated by the remote DC to the 'guest account' + if a uid could not be obtained via the getpwnam() call. Samba 3.0 + rejects the connection as NT_STATUS_LOGON_FAILURE. There is no + current work around to re-establish the 2.2 behavior. + + 2) When adding machines to a Samba 2.2 controlled domain, the + 'add user script' was used to create the UNIX identity of the + machine trust account. Samba 3.0 introduces a new 'add machine + script' that must be specified for this purpose. Samba 3.0 will + not fall back to using the 'add user script' in the absence of + an 'add machine script' + + +###################################################################### +Passdb Backends and Authentication +################################## + +There have been a few new changes that Samba administrators should be +aware of when moving to Samba 3.0. + + 1) encrypted passwords have been enabled by default in order to + inter-operate better with out-of-the-box Windows client + installations. This does mean that either (a) a samba account + must be created for each user, or (b) 'encrypt passwords = no' + must be explicitly defined in smb.conf. + + 2) Inclusion of new 'security = ads' option for integration + with an Active Directory domain using the native Windows + Kerberos 5 and LDAP protocols. + + MIT kerberos 1.3.1 supports the ARCFOUR-HMAC-MD5 encryption + type which is neccessary for servers on which the + administrator password has not been changed, or kerberos-enabled + SMB connections to servers that require Kerberos SMB signing. + Besides this one difference, either MIT or Heimdal Kerberos + distributions are usable by Samba 3.0. + + +Samba 3.0 also includes the possibility of setting up chains +of authentication methods (auth methods) and account storage +backends (passdb backend). Please refer to the smb.conf(5) +man page for details. While both parameters assume sane default +values, it is likely that you will need to understand what the +values actually mean in order to ensure Samba operates correctly. + +The recommended passdb backends at this time are + + * smbpasswd - 2.2 compatible flat file format + * tdbsam - attribute rich database intended as an smbpasswd + replacement for stand alone servers + * ldapsam - attribute rich account storage and retrieval + backend utilizing an LDAP directory. + * ldapsam_compat - a 2.2 backward compatible LDAP account + backend + +Certain functions of the smbpasswd(8) tool have been split between the +new smbpasswd(8) utility, the net(8) tool, and the new pdbedit(8) +utility. See the respective man pages for details. + + +###################################################################### +LDAP +#### + +This section outlines the new features affecting Samba / LDAP +integration. + +New Schema +---------- + +A new object class (sambaSamAccount) has been introduced to replace +the old sambaAccount. This change aids us in the renaming of +attributes to prevent clashes with attributes from other vendors. +There is a conversion script (examples/LDAP/convertSambaAccount) to +modify and LDIF file to the new schema. + +Example: + + $ ldapsearch .... -b "ou=people,dc=..." > sambaAcct.ldif + $ convertSambaAccount --sid= \ + --input=sambaAcct.ldif --output=sambaSamAcct.ldif \ + --changetype=[modify|add] + +The can be obtained by running 'net getlocalsid +' on the Samba PDC as root. The changetype determines +the format of the generated LDIF output--either create new entries +or modify existing entries. + +The old sambaAccount schema may still be used by specifying the +"ldapsam_compat" passdb backend. However, the sambaAccount and +associated attributes have been moved to the historical section of +the schema file and must be uncommented before use if needed. +The 2.2 object class declaration for a sambaAccount has not changed +in the 3.0 samba.schema file. + +Other new object classes and their uses include: + + * sambaDomain - domain information used to allocate rids + for users and groups as necessary. The attributes are added + in 'ldap suffix' directory entry automatically if + an idmap uid/gid range has been set and the 'ldapsam' + passdb backend has been selected. + + * sambaGroupMapping - an object representing the + relationship between a posixGroup and a Windows + group/SID. These entries are stored in the 'ldap + group suffix' and managed by the 'net groupmap' command. + + * sambaUnixIdPool - created in the 'ldap idmap suffix' entry + automatically and contains the next available 'idmap uid' and + 'idmap gid' + + * sambaIdmapEntry - object storing a mapping between a + SID and a UNIX uid/gid. These objects are created by the + idmap_ldap module as needed. + + * sambaSidEntry - object representing a SID alone, as a Structural + class on which to build the sambaIdmapEntry. + + +New Suffix for Searching +------------------------ + +The following new smb.conf parameters have been added to aid in directing +certain LDAP queries when 'passdb backend = ldapsam://...' has been +specified. + + * ldap suffix - used to search for user and computer accounts + * ldap user suffix - used to store user accounts + * ldap machine suffix - used to store machine trust accounts + * ldap group suffix - location of posixGroup/sambaGroupMapping entries + * ldap idmap suffix - location of sambaIdmapEntry objects + +If an 'ldap suffix' is defined, it will be appended to all of the +remaining sub-suffix parameters. In this case, the order of the suffix +listings in smb.conf is important. Always place the 'ldap suffix' first +in the list. + +Due to a limitation in Samba's smb.conf parsing, you should not surround +the DN's with quotation marks. + + +IdMap LDAP support +------------------ + +Samba 3.0 supports an ldap backend for the idmap subsystem. The +following options would inform Samba that the idmap table should be +stored on the directory server onterose in the "ou=idmap,dc=plainjoe, +dc=org" partition. + + [global] + ... + idmap backend = ldap:ldap://onterose/ + ldap idmap suffix = ou=idmap,dc=plainjoe,dc=org + idmap uid = 40000-50000 + idmap gid = 40000-50000 + +This configuration allows winbind installations on multiple servers to +share a uid/gid number space, thus avoiding the interoperability problems +with NFS that were present in Samba 2.2. + + + +###################################################################### +Trust Relationships and a Samba Domain +###################################### + +Samba 3.0.0beta2 is able to utilize winbindd as the means of +allocating uids and gids to trusted users and groups. More +information regarding Samba's support for establishing trust +relationships can be found in the Samba-HOWTO-Collection included +in the docs/ directory of this release. + +First create your Samba PDC and ensure that everything is +working correctly before moving on the trusts. + +To establish Samba as the trusting domain (named SAMBA) from a Windows NT +4.0 domain named WINDOWS: + + 1) create the trust account for SAMBA in "User Manager for Domains" + 2) connect the trust from the Samba domain using + 'net rpc trustdom establish GLASS' + +To create a trustlationship with SAMBA as the trusted domain: + + 1) create the initial trust account for GLASS using + 'smbpasswd -a -i GLASS'. You may need to create a UNIX + account for GLASS$ prior to this step (depending on your + local configuration). + 2) connect the trust from a WINDOWS DC using "User Manager + for Domains" + +Now join winbindd on the Samba PDC to the SAMBA domain using +the normal steps for adding a Samba server to an NT4 domain: +(note that smbd & nmbd must be running at this point) + + root# net rpc join -U root + Password: + +Start winbindd and test the join with 'wbinfo -t'. + +Now test the trust relationship by connecting to the SAMBA DC +(e.g. POGO) as a user from the WINDOWS domain: + + $ smbclient //pogo/netlogon -U Administrator -W WINDOWS + Password: + +Now connect to the WINDOWS DC (e.g. CRYSTAL) as a Samba user: + + $ smbclient //crystal/netlogon -U root -W WINDOWS + Password: + +###################################################################### +Changes in Winbind +################## + +Beginning with Samba3.0.0beta3, winbindd has been given new account +manage functionality equivalent to the 'add user script' family of +smb.conf parameters. The idmap design has also been changed to +centralize control of foreign SID lookups and matching to UNIX +uids and gids. + + +Brief Description of Changes +---------------------------- + +1) The sid_to_uid() family of functions (smbd/uid.c) have been + reverted to the 2.2.x design. This means that when resolving a + SID to a UID or similar mapping: + + a) First consult winbindd + b) perform a local lookup only if winbindd fails to + return a successful answer + + There are some variations to this, but these two rules generally + apply. + +2) All idmap lookups have been moved into winbindd. This means that + a server must run winbindd (and support NSS) in order to achieve + any mappings of SID to dynamically allocated UNIX ids. This was + a conscious design choice. + +3) (OBSOLETE) New functions have been added to winbindd to emulate + the 'add user script' family of smbd functions without requiring + that external scripts be defined. This functionality is controlled + by the 'winbind enable local accounts' smb.conf parameter (enabled + by default). + + However, this account management functionality is only supported + in a local tdb (winbindd_idmap.tdb). If these new UNIX accounts + must be shared among multiple Samba servers (such as a PDC and BDCs), + it will be necessary to define your own 'add user script', et. al. + programs that place the accounts/groups in some form of directory + such as NIS or LDAP. This requirement was deemed beyond the scope + of winbind's account management functions. Solutions for + distributing UNIX system information have been deployed and tested + for many years. We saw no need to reinvent the wheel. + +4) A member of a Samba controlled domain running winbindd is now able + to map domain users directly onto existing UNIX accounts while still + automatically creating accounts for trusted users and groups. This + behavior is controlled by the 'winbind trusted domains only' smb.conf + parameter (disabled by default to provide 2.2.x winbind behavior). + +5) Group mapping support is wrapped in the local_XX_to_XX() functions + in smbd/uid.c. The reason that group mappings are not included + in winbindd is because the purpose of Samba's group map is to + match any Windows SID with an existing UNIX group. These UNIX + groups can be created by winbindd (see next section), but the + SID<->gid mapping is retreived by smbd, not winbindd. + + +Examples +-------- + +* security = server running winbindd to allocate accounts on demand + +* Samba PDC running winbindd to handle the automatic creation of UNIX + identities for machine trust accounts + +* Automtically creating UNIX user and groups when migrating a Windows NT + 4.0 PDC to a Samba PDC. Winbindd must be running when executing + 'net rpc vampire' for this to work. + + +###################################################################### +Known Issues +############ + +* There are several bugs currently logged against the 3.0 codebase + that affect the use of NT 4.0 GUI domain management tools when run + against a Samba 3.0 PDC. This bugs should be released in an early + 3.0.x release. + +Please refer to https://bugzilla.samba.org/ for a current list of bugs +filed against the Samba 3.0 codebase. + + +###################################################################### +Reporting bugs & Development Discussion +####################################### + +Please discuss this release on the samba-technical mailing list or by +joining the #samba-technical IRC channel on irc.freenode.net. + +If you do report problems then please try to send high quality +feedback. If you don't provide vital information to help us track down +the problem then you will probably be ignored. + +A new bugzilla installation has been established to help support the +Samba 3.0 community of users. This server, located at +https://bugzilla.samba.org/, has replaced the older jitterbug server +previously located at http://bugs.samba.org/. + diff --git a/release-3-0-20b/source/Makefile.in b/release-3-0-20b/source/Makefile.in new file mode 100644 index 00000000000..ac49a388b02 --- /dev/null +++ b/release-3-0-20b/source/Makefile.in @@ -0,0 +1,1600 @@ +######################################################################### +# Makefile.in for Samba - rewritten for autoconf support +# Copyright Andrew Tridgell 1992-1998 +# Copyright (C) 2001 by Martin Pool +# Copyright Andrew Bartlett 2002 +# Copyright (C) 2003 Jim McDonough +# Copyright (C) 2002-2003 Jelmer Vernooij +########################################################################### + +prefix=@prefix@ +exec_prefix=@exec_prefix@ + +LIBS=@LIBS@ +CC=@CC@ +SHLD=@SHLD@ +CFLAGS=@CFLAGS@ +CPPFLAGS=@CPPFLAGS@ +EXEEXT=@EXEEXT@ +LDFLAGS=@LDFLAGS@ +AR=@AR@ +LDSHFLAGS=@LDSHFLAGS@ @LDFLAGS@ +WINBIND_NSS_LDSHFLAGS=@WINBIND_NSS_LDSHFLAGS@ @LDFLAGS@ +AWK=@AWK@ +DYNEXP=@DYNEXP@ +PYTHON=@PYTHON@ +PERL=@PERL@ + +TERMLDFLAGS=@TERMLDFLAGS@ +TERMLIBS=@TERMLIBS@ +PRINT_LIBS=@PRINT_LIBS@ +AUTH_LIBS=@AUTH_LIBS@ +ACL_LIBS=@ACL_LIBS@ +PASSDB_LIBS=@PASSDB_LIBS@ +IDMAP_LIBS=@IDMAP_LIBS@ +KRB5LIBS=@KRB5_LIBS@ +LDAP_LIBS=@LDAP_LIBS@ + +INSTALLCMD=@INSTALL@ +INSTALLCLIENTCMD_SH=@INSTALLCLIENTCMD_SH@ +INSTALLCLIENTCMD_A=@INSTALLCLIENTCMD_A@ + +VPATH=@srcdir@ +srcdir=@abs_srcdir@ +builddir=@abs_builddir@ +SHELL=/bin/sh +DESTDIR=/ + +# XXX: Perhaps this should be @SHELL@ instead -- apparently autoconf +# will search for a POSIX-compliant shell, and that might not be +# /bin/sh on some platforms. I guess it's not a big problem -- mbp + +# See the autoconf manual "Installation Directory Variables" for a +# discussion of the subtle use of these variables. + +BASEDIR= @prefix@ +BINDIR = @bindir@ +# sbindir is mapped to bindir when compiling SAMBA in 2.0.x compatibility mode. +SBINDIR = @sbindir@ +LIBDIR = @libdir@ +VFSLIBDIR = $(LIBDIR)/vfs +PDBLIBDIR = $(LIBDIR)/pdb +RPCLIBDIR = $(LIBDIR)/rpc +IDMAPLIBDIR = $(LIBDIR)/idmap +CHARSETLIBDIR = $(LIBDIR)/charset +AUTHLIBDIR = $(LIBDIR)/auth +CONFIGDIR = @configdir@ +VARDIR = @localstatedir@ +MANDIR = @mandir@ +DATADIR = @datadir@ + +# The permissions to give the executables +INSTALLPERMS = 0755 + +# set these to where to find various files +# These can be overridden by command line switches (see smbd(8)) +# or in smb.conf (see smb.conf(5)) +LOGFILEBASE = @logfilebase@ +CONFIGFILE = $(CONFIGDIR)/smb.conf +LMHOSTSFILE = $(CONFIGDIR)/lmhosts + +# This is where smbpasswd et al go +PRIVATEDIR = @privatedir@ + +SMB_PASSWD_FILE = $(PRIVATEDIR)/smbpasswd +PRIVATE_DIR = $(PRIVATEDIR) + +# This is where SWAT images and help files go +SWATDIR = @swatdir@ + +# the directory where lock files go +LOCKDIR = @lockdir@ + +# the directory where pid files go +PIDDIR = @piddir@ + +LIBSMBCLIENT=bin/libsmbclient.a @LIBSMBCLIENT_SHARED@ +LIBSMBCLIENT_MAJOR=0 +LIBSMBCLIENT_MINOR=1 + +LIBSMBSHAREMODES=bin/libsmbsharemodes.a @LIBSMBSHAREMODES_SHARED@ +LIBSMBSHAREMODES_MAJOR=0 +LIBSMBSHAREMODES_MINOR=1 + + +FLAGS1 = $(CFLAGS) @FLAGS1@ -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx @SMBWRAP_INC@ -I. $(CPPFLAGS) -I$(srcdir) -I$(srcdir)/tdb +FLAGS2 = +FLAGS3 = +FLAGS4 = +FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4) +FLAGS = $(ISA) $(FLAGS5) + +PASSWD_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" -DPRIVATE_DIR=\"$(PRIVATE_DIR)\" +PATH_FLAGS1 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DSBINDIR=\"$(SBINDIR)\" +PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\" -DDRIVERFILE=\"$(DRIVERFILE)\" +PATH_FLAGS3 = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" +PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\" +PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" \ + -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"@SHLIBEXT@\" +PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\" +PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS) + +# Note that all executable programs now provide for an optional executable suffix. + +SBIN_PROGS = bin/smbd@EXEEXT@ bin/nmbd@EXEEXT@ bin/swat@EXEEXT@ @EXTRA_SBIN_PROGS@ + +BIN_PROGS1 = bin/smbclient@EXEEXT@ bin/net@EXEEXT@ bin/smbspool@EXEEXT@ \ + bin/testparm@EXEEXT@ bin/smbstatus@EXEEXT@ +BIN_PROGS2 = bin/smbcontrol@EXEEXT@ bin/smbtree@EXEEXT@ bin/tdbbackup@EXEEXT@ \ + bin/nmblookup@EXEEXT@ bin/pdbedit@EXEEXT@ bin/tdbdump@EXEEXT@ \ + bin/tdbtool@EXEEXT@ +BIN_PROGS3 = bin/smbpasswd@EXEEXT@ bin/rpcclient@EXEEXT@ bin/smbcacls@EXEEXT@ \ + bin/profiles@EXEEXT@ bin/ntlm_auth@EXEEXT@ \ + bin/smbcquotas@EXEEXT@ + +TORTURE_PROGS = bin/smbtorture@EXEEXT@ bin/msgtest@EXEEXT@ \ + bin/masktest@EXEEXT@ bin/locktest@EXEEXT@ \ + bin/locktest2@EXEEXT@ bin/nsstest@EXEEXT@ bin/vfstest@EXEEXT@ + +BIN_PROGS = $(BIN_PROGS1) $(BIN_PROGS2) $(BIN_PROGS3) @EXTRA_BIN_PROGS@ + +EVERYTHING_PROGS = bin/debug2html@EXEEXT@ bin/smbfilter@EXEEXT@ bin/talloctort@EXEEXT@ \ + bin/log2pcap@EXEEXT@ + +SHLIBS = @SHLIB_PROGS@ @LIBSMBCLIENT@ @LIBSMBSHAREMODES@ + +SCRIPTS = $(srcdir)/script/smbtar $(builddir)/script/findsmb + +VFS_MODULES = @VFS_MODULES@ +PDB_MODULES = @PDB_MODULES@ +RPC_MODULES = @RPC_MODULES@ +IDMAP_MODULES = @IDMAP_MODULES@ +CHARSET_MODULES = @CHARSET_MODULES@ +AUTH_MODULES = @AUTH_MODULES@ +MODULES = $(VFS_MODULES) $(PDB_MODULES) $(RPC_MODULES) $(IDMAP_MODULES) $(CHARSET_MODULES) $(AUTH_MODULES) + +###################################################################### +# object file lists +###################################################################### + +TDBBASE_OBJ = tdb/tdb.o tdb/spinlock.o + +TDB_OBJ = $(TDBBASE_OBJ) tdb/tdbutil.o tdb/tdbback.o + +SMBLDAP_OBJ = @SMBLDAP@ @SMBLDAPUTIL@ + +VERSION_OBJ = lib/version.o + +DOSERR_OBJ = libsmb/doserr.o + +SNPRINTF_OBJ = lib/snprintf.o + +WBCOMMON_OBJ = nsswitch/wb_common.o + +AFS_OBJ = lib/afs.o + +AFS_SETTOKEN_OBJ = lib/afs_settoken.o + +SERVER_MUTEX_OBJ = lib/server_mutex.o + +ERRORMAP_OBJ = libsmb/errormap.o + +PASSCHANGE_OBJ = libsmb/passchange.o + +SOCKET_WRAPPER_OBJ = lib/socket_wrapper.o + +RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o + +LIB_OBJ = $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \ + lib/getsmbpass.o lib/interface.o lib/md4.o \ + lib/interfaces.o lib/pidfile.o lib/replace.o lib/replace1.o \ + lib/signal.o lib/system.o lib/sendfile.o lib/time.o \ + lib/ufc.o lib/genrand.o lib/username.o \ + lib/util_getent.o lib/util_pw.o lib/access.o lib/smbrun.o \ + lib/bitmap.o lib/crc32.o $(SNPRINTF_OBJ) lib/dprintf.o \ + lib/xfile.o lib/wins_srv.o \ + lib/util_str.o lib/clobber.o lib/util_sid.o lib/util_uuid.o \ + lib/util_unistr.o lib/util_file.o lib/data_blob.o \ + lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \ + lib/talloc.o lib/substitute.o lib/fsusage.o \ + lib/ms_fnmatch.o lib/select.o lib/messages.o \ + lib/tallocmsg.o lib/dmallocmsg.o libsmb/smb_signing.o \ + lib/md5.o lib/hmacmd5.o lib/iconv.o \ + nsswitch/wb_client.o $(WBCOMMON_OBJ) \ + lib/pam_errors.o intl/lang_tdb.o lib/account_pol.o \ + lib/adt_tree.o lib/gencache.o $(TDB_OBJ) \ + lib/module.o lib/ldap_escape.o @CHARSET_STATIC@ \ + lib/privileges.o lib/secdesc.o lib/secace.o lib/secacl.o @SOCKWRAP@ + +LIB_NONSMBD_OBJ = $(LIB_OBJ) lib/dummysmbd.o lib/dummyroot.o + +READLINE_OBJ = lib/readline.o + +# Also depends on $(SECRETS_OBJ) $(LIBSAMBA_OBJ) +# Be sure to include them into your application +POPT_LIB_OBJ = lib/popt_common.o + +UBIQX_OBJ = ubiqx/ubi_BinTree.o ubiqx/ubi_Cache.o ubiqx/ubi_SplayTree.o \ + ubiqx/ubi_dLinkList.o ubiqx/ubi_sLinkList.o + +PARAM_OBJ = dynconfig.o param/loadparm.o param/params.o + +KRBCLIENT_OBJ = libads/kerberos.o libads/ads_status.o + +LIBADS_OBJ = libads/ldap.o libads/ldap_printer.o libads/sasl.o \ + libads/krb5_setpw.o libads/ldap_user.o \ + libads/ads_struct.o libads/kerberos_keytab.o \ + libads/disp_sec.o libads/ads_utils.o libads/ldap_utils.o \ + libads/ads_ldap.o libads/authdata.o + +LIBADS_SERVER_OBJ = libads/util.o libads/kerberos_verify.o + +SECRETS_OBJ = passdb/secrets.o passdb/machine_sid.o + +LIBNMB_OBJ = libsmb/unexpected.o libsmb/namecache.o libsmb/nmblib.o \ + libsmb/namequery.o libsmb/conncache.o + +LIBSAMBA_OBJ = libsmb/nterr.o libsmb/smbdes.o libsmb/smbencrypt.o libsmb/ntlm_check.o \ + libsmb/ntlmssp.o libsmb/ntlmssp_parse.o libsmb/ntlmssp_sign.o + +LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \ + libsmb/clikrb5.o libsmb/clispnego.o libsmb/asn1.o \ + libsmb/clirap.o libsmb/clierror.o libsmb/climessage.o \ + libsmb/clireadwrite.o libsmb/clilist.o libsmb/cliprint.o \ + libsmb/clitrans.o libsmb/clisecdesc.o libsmb/clidgram.o \ + libsmb/clistr.o lib/util_seaccess.o \ + libsmb/cliquota.o libsmb/clifsinfo.o libsmb/clidfs.o \ + libsmb/smberr.o libsmb/credentials.o libsmb/pwd_cache.o \ + libsmb/clioplock.o $(ERRORMAP_OBJ) libsmb/clirap2.o \ + $(DOSERR_OBJ) \ + $(RPC_PARSE_OBJ1) $(LIBSAMBA_OBJ) $(LIBNMB_OBJ) + +LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \ + rpc_client/cli_netlogon.o rpc_client/cli_srvsvc.o \ + rpc_client/cli_wkssvc.o rpc_client/cli_dfs.o \ + rpc_client/cli_reg.o $(RPC_CLIENT_OBJ) \ + rpc_client/cli_spoolss.o rpc_client/cli_spoolss_notify.o \ + rpc_client/cli_ds.o rpc_client/cli_echo.o \ + rpc_client/cli_shutdown.o rpc_client/cli_svcctl.o + +REGOBJS_OBJ = registry/reg_objects.o + +REGISTRY_OBJ = registry/reg_frontend.o registry/reg_cachehook.o registry/reg_printing.o \ + registry/reg_db.o registry/reg_eventlog.o registry/reg_shares.o \ + registry/reg_util.o registry/reg_dynamic.o + +RPC_LSA_OBJ = rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o + +RPC_NETLOG_OBJ = rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o + +RPC_SAMR_OBJ = rpc_server/srv_samr.o rpc_server/srv_samr_nt.o \ + rpc_server/srv_samr_util.o + +REGFIO_OBJ = registry/regfio.o + +RPC_REG_OBJ = rpc_server/srv_reg.o rpc_server/srv_reg_nt.o $(REGFIO_OBJ) + +RPC_LSA_DS_OBJ = rpc_server/srv_lsa_ds.o rpc_server/srv_lsa_ds_nt.o + +RPC_SVC_OBJ = rpc_server/srv_srvsvc.o rpc_server/srv_srvsvc_nt.o + +RPC_WKS_OBJ = rpc_server/srv_wkssvc.o rpc_server/srv_wkssvc_nt.o + +RPC_SVCCTL_OBJ = rpc_server/srv_svcctl.o rpc_server/srv_svcctl_nt.o \ + services/svc_spoolss.o services/svc_rcinit.o services/services_db.o + +RPC_DFS_OBJ = rpc_server/srv_dfs.o rpc_server/srv_dfs_nt.o + +RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o + +RPC_EVENTLOG_OBJ = rpc_server/srv_eventlog.o rpc_server/srv_eventlog_nt.o + +RPC_PIPE_OBJ = rpc_server/srv_pipe_hnd.o rpc_server/srv_util.o \ + rpc_server/srv_pipe.o rpc_server/srv_lsa_hnd.o + +RPC_ECHO_OBJ = rpc_server/srv_echo.o rpc_server/srv_echo_nt.o + +RPC_SERVER_OBJ = @RPC_STATIC@ $(RPC_PIPE_OBJ) + +# this includes only the low level parse code, not stuff +# that requires knowledge of security contexts +RPC_PARSE_OBJ1 = $(RPC_PARSE_OBJ0) rpc_parse/parse_sec.o + +RPC_PARSE_OBJ = rpc_parse/parse_lsa.o rpc_parse/parse_net.o \ + rpc_parse/parse_reg.o rpc_parse/parse_rpc.o \ + rpc_parse/parse_samr.o rpc_parse/parse_srv.o \ + rpc_parse/parse_wks.o rpc_parse/parse_ds.o \ + rpc_parse/parse_spoolss.o rpc_parse/parse_dfs.o \ + rpc_parse/parse_echo.o rpc_parse/parse_shutdown.o \ + rpc_parse/parse_svcctl.o \ + rpc_parse/parse_eventlog.o rpc_parse/parse_buffer.o $(REGOBJS_OBJ) + +RPC_CLIENT_OBJ = rpc_client/cli_pipe.o + +LOCKING_OBJ = locking/locking.o locking/brlock.o locking/posix.o + +PASSDB_GET_SET_OBJ = passdb/pdb_get_set.o + +PASSDB_OBJ = $(PASSDB_GET_SET_OBJ) passdb/passdb.o passdb/pdb_interface.o \ + passdb/util_sam_sid.o passdb/pdb_compat.o \ + passdb/lookup_sid.o \ + passdb/login_cache.o @PDB_STATIC@ passdb/pdb_sql.o \ + lib/system_smbd.o + +XML_OBJ = passdb/pdb_xml.o +MYSQL_OBJ = passdb/pdb_mysql.o +PGSQL_OBJ = passdb/pdb_pgsql.o +DEVEL_HELP_WEIRD_OBJ = modules/weird.o +CP850_OBJ = modules/CP850.o +CP437_OBJ = modules/CP437.o +CHARSET_MACOSXFS_OBJ = modules/charset_macosxfs.o + +GROUPDB_OBJ = groupdb/mapping.o + +PROFILE_OBJ = profile/profile.o +PROFILES_OBJ = utils/profiles.o + +OPLOCK_OBJ = smbd/oplock.o smbd/oplock_irix.o smbd/oplock_linux.o + +NOTIFY_OBJ = smbd/notify.o smbd/notify_hash.o smbd/notify_kernel.o + +VFS_AUDIT_OBJ = modules/vfs_audit.o +VFS_EXTD_AUDIT_OBJ = modules/vfs_extd_audit.o +VFS_FULL_AUDIT_OBJ = modules/vfs_full_audit.o +VFS_FAKE_PERMS_OBJ = modules/vfs_fake_perms.o +VFS_RECYCLE_OBJ = modules/vfs_recycle.o +VFS_NETATALK_OBJ = modules/vfs_netatalk.o +VFS_DEFAULT_QUOTA_OBJ = modules/vfs_default_quota.o +VFS_READONLY_OBJ = modules/vfs_readonly.o modules/getdate.o +VFS_CAP_OBJ = modules/vfs_cap.o +VFS_EXPAND_MSDFS_OBJ = modules/vfs_expand_msdfs.o +VFS_SHADOW_COPY_OBJ = modules/vfs_shadow_copy.o +VFS_AFSACL_OBJ = modules/vfs_afsacl.o +VFS_CATIA_OBJ = modules/vfs_catia.o + +PLAINTEXT_AUTH_OBJ = auth/pampass.o auth/pass_check.o + +SLCACHE_OBJ = libsmb/samlogon_cache.o + +DCUTIL_OBJ = libsmb/namequery_dc.o libsmb/trustdom_cache.o libsmb/trusts_util.o + +AUTH_BUILTIN_OBJ = auth/auth_builtin.o +AUTH_DOMAIN_OBJ = auth/auth_domain.o +AUTH_SAM_OBJ = auth/auth_sam.o +AUTH_RHOSTS_OBJ = auth/auth_rhosts.o +AUTH_SERVER_OBJ = auth/auth_server.o +AUTH_UNIX_OBJ = auth/auth_unix.o +AUTH_WINBIND_OBJ = auth/auth_winbind.o + +AUTH_OBJ = auth/auth.o @AUTH_STATIC@ auth/auth_util.o auth/auth_compat.o \ + auth/auth_ntlmssp.o \ + $(PLAINTEXT_AUTH_OBJ) $(SLCACHE_OBJ) $(DCUTIL_OBJ) + +MANGLE_OBJ = smbd/mangle.o smbd/mangle_hash.o smbd/mangle_map.o smbd/mangle_hash2.o + +SMBD_OBJ_MAIN = smbd/server.o + +BUILDOPT_OBJ = smbd/build_options.o + +SMBD_OBJ_SRV = smbd/files.o smbd/chgpasswd.o smbd/connection.o \ + smbd/utmp.o smbd/session.o \ + smbd/dfree.o smbd/dir.o smbd/password.o smbd/conn.o smbd/fileio.o \ + smbd/ipc.o smbd/lanman.o smbd/negprot.o \ + smbd/message.o smbd/nttrans.o smbd/pipes.o \ + smbd/reply.o smbd/sesssetup.o smbd/trans2.o smbd/uid.o \ + smbd/dosmode.o smbd/filename.o smbd/open.o smbd/close.o \ + smbd/blocking.o smbd/sec_ctx.o smbd/srvstr.o \ + smbd/vfs.o smbd/vfs-wrap.o smbd/statcache.o \ + smbd/posix_acls.o lib/sysacls.o $(SERVER_MUTEX_OBJ) \ + smbd/process.o smbd/service.o smbd/error.o \ + printing/printfsp.o lib/sysquotas.o lib/sysquotas_linux.o \ + lib/sysquotas_xfs.o lib/sysquotas_4A.o \ + smbd/change_trust_pw.o smbd/fake_file.o \ + smbd/quotas.o smbd/ntquotas.o $(AFS_OBJ) smbd/msdfs.o \ + $(AFS_SETTOKEN_OBJ) smbd/aio.o \ + $(MANGLE_OBJ) @VFS_STATIC@ + +SMBD_OBJ_BASE = $(PARAM_OBJ) $(SMBD_OBJ_SRV) $(LIBSMB_OBJ) \ + $(RPC_SERVER_OBJ) $(RPC_PARSE_OBJ) $(SECRETS_OBJ) \ + $(LOCKING_OBJ) $(PASSDB_OBJ) $(PRINTING_OBJ) $(PROFILE_OBJ) \ + $(LIB_OBJ) $(PRINTBACKEND_OBJ) $(OPLOCK_OBJ) \ + $(NOTIFY_OBJ) $(GROUPDB_OBJ) $(AUTH_OBJ) \ + $(LIBMSRPC_OBJ) \ + $(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(LIBADS_SERVER_OBJ) \ + $(REGISTRY_OBJ) $(POPT_LIB_OBJ) \ + $(BUILDOPT_OBJ) $(SMBLDAP_OBJ) + +PRINTING_OBJ = printing/pcap.o printing/print_svid.o printing/print_aix.o \ + printing/print_cups.o printing/print_generic.o \ + printing/lpq_parse.o printing/load.o + +PRINTBASE_OBJ = printing/notify.o printing/printing_db.o + +PRINTBACKEND_OBJ = printing/printing.o printing/nt_printing.o $(PRINTBASE_OBJ) + +SMBD_OBJ = $(SMBD_OBJ_BASE) $(SMBD_OBJ_MAIN) +NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \ + nmbd/nmbd_become_lmb.o nmbd/nmbd_browserdb.o \ + nmbd/nmbd_browsesync.o nmbd/nmbd_elections.o \ + nmbd/nmbd_incomingdgrams.o nmbd/nmbd_incomingrequests.o \ + nmbd/nmbd_lmhosts.o nmbd/nmbd_logonnames.o nmbd/nmbd_mynames.o \ + nmbd/nmbd_namelistdb.o nmbd/nmbd_namequery.o \ + nmbd/nmbd_nameregister.o nmbd/nmbd_namerelease.o \ + nmbd/nmbd_nodestatus.o nmbd/nmbd_packets.o \ + nmbd/nmbd_processlogon.o nmbd/nmbd_responserecordsdb.o \ + nmbd/nmbd_sendannounce.o nmbd/nmbd_serverlistdb.o \ + nmbd/nmbd_subnetdb.o nmbd/nmbd_winsproxy.o nmbd/nmbd_winsserver.o \ + nmbd/nmbd_workgroupdb.o nmbd/nmbd_synclists.o + +NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(UBIQX_OBJ) \ + $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ) + +WREPL_OBJ1 = wrepld/server.o wrepld/process.o wrepld/parser.o wrepld/socket.o \ + wrepld/partners.o + +WREPL_OBJ = $(WREPL_OBJ1) $(PARAM_OBJ) $(UBIQX_OBJ) \ + $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) \ + $(LIBSAMBA_OBJ) + +SWAT_OBJ1 = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \ + web/swat.o web/neg_lang.o + +SWAT_OBJ = $(SWAT_OBJ1) $(PARAM_OBJ) $(PRINTING_OBJ) $(LIBSMB_OBJ) \ + $(LOCKING_OBJ) $(PASSDB_OBJ) $(SECRETS_OBJ) $(KRBCLIENT_OBJ) \ + $(LIB_NONSMBD_OBJ) $(GROUPDB_OBJ) $(PLAINTEXT_AUTH_OBJ) \ + $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) $(LIBMSRPC_OBJ) \ + $(PASSCHANGE_OBJ) + +SMBSH_OBJ = smbwrapper/smbsh.o smbwrapper/shared.o \ + $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) + +STATUS_OBJ = utils/status.o $(LOCKING_OBJ) $(PARAM_OBJ) \ + $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \ + $(SECRETS_OBJ) $(LIBSAMBA_OBJ) $(ERRORMAP_OBJ) + + +SMBCONTROL_OBJ = utils/smbcontrol.o $(LOCKING_OBJ) $(PARAM_OBJ) \ + $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \ + $(SECRETS_OBJ) $(LIBSAMBA_OBJ) \ + $(PRINTBASE_OBJ) $(ERRORMAP_OBJ) + +SMBTREE_OBJ = utils/smbtree.o $(PARAM_OBJ) \ + $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(LIBSMB_OBJ) \ + $(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) + +TESTPARM_OBJ = utils/testparm.o \ + $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \ + $(SECRETS_OBJ) $(LIBSAMBA_OBJ) + +SMBPASSWD_OBJ = utils/smbpasswd.o $(PASSCHANGE_OBJ) $(PARAM_OBJ) $(SECRETS_OBJ) \ + $(LIBSMB_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ)\ + $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) \ + $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) $(LIBMSRPC_OBJ) + +PDBEDIT_OBJ = utils/pdbedit.o $(PARAM_OBJ) $(PASSDB_OBJ) $(LIBSAMBA_OBJ) \ + $(LIB_NONSMBD_OBJ) $(GROUPDB_OBJ) $(SECRETS_OBJ) \ + $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) libsmb/asn1.o + +SMBGET_OBJ = utils/smbget.o $(POPT_LIB_OBJ) $(LIBSMBCLIENT_OBJ) + +RPCCLIENT_OBJ1 = rpcclient/rpcclient.o rpcclient/cmd_lsarpc.o \ + rpcclient/cmd_samr.o rpcclient/cmd_spoolss.o \ + rpcclient/cmd_netlogon.o rpcclient/cmd_srvsvc.o \ + rpcclient/cmd_dfs.o rpcclient/cmd_reg.o \ + rpcclient/display_sec.o rpcclient/cmd_ds.o \ + rpcclient/cmd_echo.o rpcclient/cmd_shutdown.o + +RPCCLIENT_OBJ = $(RPCCLIENT_OBJ1) \ + $(PARAM_OBJ) $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) \ + $(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(LIBMSRPC_OBJ) \ + $(READLINE_OBJ) $(GROUPDB_OBJ) $(KRBCLIENT_OBJ) \ + $(LIBADS_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ) \ + $(SMBLDAP_OBJ) $(DCUTIL_OBJ) + +PAM_WINBIND_PICOBJ = nsswitch/pam_winbind.@PICSUFFIX@ \ + nsswitch/wb_common.@PICSUFFIX@ lib/replace1.@PICSUFFIX@ \ + lib/snprintf.@PICSUFFIX@ + +SMBW_OBJ1 = smbwrapper/smbw.o \ + smbwrapper/smbw_dir.o smbwrapper/smbw_stat.o \ + smbwrapper/realcalls.o smbwrapper/shared.o \ + smbwrapper/smbw_cache.o + +SMBW_OBJ = $(SMBW_OBJ1) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(PARAM_OBJ) \ + $(LIB_NONSMBD_OBJ) + +SMBWRAPPER_OBJ1 = smbwrapper/wrapped.o + +SMBWRAPPER_OBJ = $(SMBW_OBJ) $(SMBWRAPPER_OBJ1) + +LIBSMBCLIENT_OBJ = libsmb/libsmbclient.o libsmb/libsmb_compat.o \ + libsmb/libsmb_cache.o \ + $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \ + $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \ + $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) \ + $(SECRETS_OBJ) $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ) + +LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o tdb/tdb.o tdb/spinlock.o +# This shared library is intended for linking with unit test programs +# to test Samba internals. It's called libbigballofmud.so to +# discourage casual usage. + +LIBBIGBALLOFMUD_MAJOR = 0 + +LIBBIGBALLOFMUD_OBJ = $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(UBIQX_OBJ) $(SECRETS_OBJ) \ + $(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_OBJ) \ + $(GROUPDB_OBJ) $(KRBCLIENT_OBJ) $(SMBLDAP_OBJ) + +LIBBIGBALLOFMUD_PICOBJS = $(LIBBIGBALLOFMUD_OBJ:.o=.@PICSUFFIX@) + +CLIENT_OBJ1 = client/client.o client/clitar.o + +CLIENT_OBJ = $(CLIENT_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) \ + $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) \ + $(READLINE_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) + +NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_ads_cldap.o utils/net_help.o \ + utils/net_rap.o utils/net_rpc.o utils/net_rpc_samsync.o \ + utils/net_rpc_join.o utils/net_time.o utils/net_lookup.o \ + utils/net_cache.o utils/net_groupmap.o utils/net_idmap.o \ + utils/net_status.o utils/net_rpc_printer.o utils/net_rpc_rights.o \ + utils/net_rpc_service.o utils/net_rpc_registry.o + +NET_OBJ = $(NET_OBJ1) $(PARAM_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \ + $(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \ + $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) \ + $(LIBMSRPC_OBJ) $(IDMAP_OBJ) \ + $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) $(POPT_LIB_OBJ) \ + $(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(SERVER_MUTEX_OBJ) \ + $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(PRINTERDB_OBJ) $(REGFIO_OBJ) + +CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) \ + $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(SECRETS_OBJ) + +MOUNT_OBJ = client/smbmount.o \ + $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) + +MNT_OBJ = client/smbmnt.o $(VERSION_OBJ) $(SNPRINTF_OBJ) + +UMOUNT_OBJ = client/smbumount.o + +NMBLOOKUP_OBJ = utils/nmblookup.o $(PARAM_OBJ) $(LIBNMB_OBJ) \ + $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) $(LIBSAMBA_OBJ) + +SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o torture/scanner.o torture/utable.o \ + torture/denytest.o torture/mangle_test.o + +SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) \ + $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) + +MASKTEST_OBJ = torture/masktest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \ + $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) + +MSGTEST_OBJ = torture/msgtest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \ + $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) + +LOCKTEST_OBJ = torture/locktest.o $(PARAM_OBJ) $(LOCKING_OBJ) $(KRBCLIENT_OBJ) \ + $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) + +NSSTEST_OBJ = torture/nsstest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \ + $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) + +VFSTEST_OBJ = torture/cmd_vfs.o torture/vfstest.o $(SMBD_OBJ_BASE) $(READLINE_OBJ) + +SMBICONV_OBJ = $(PARAM_OBJ) torture/smbiconv.o $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) $(LIBSAMBA_OBJ) + +LOG2PCAP_OBJ = utils/log2pcaphex.o + +LOCKTEST2_OBJ = torture/locktest2.o $(PARAM_OBJ) $(LOCKING_OBJ) $(LIBSMB_OBJ) \ + $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) + +SMBCACLS_OBJ = utils/smbcacls.o $(PARAM_OBJ) $(LIBSMB_OBJ) \ + $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(RPC_PARSE_OBJ) \ + $(PASSDB_OBJ) $(GROUPDB_OBJ) $(LIBMSRPC_OBJ) $(SECRETS_OBJ) \ + $(POPT_LIB_OBJ) $(DCUTIL_OBJ) $(LIBADS_OBJ) $(SMBLDAP_OBJ) + +SMBCQUOTAS_OBJ = utils/smbcquotas.o $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \ + $(PARAM_OBJ) \ + $(LIB_NONSMBD_OBJ) $(RPC_PARSE_OBJ) \ + $(LIBMSRPC_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ) \ + $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ) + +TALLOCTORT_OBJ = lib/talloctort.o $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) libsmb/nterr.o + +RPCTORTURE_OBJ = torture/rpctorture.o \ + rpcclient/display.o \ + rpcclient/cmd_lsarpc.o \ + rpcclient/cmd_wkssvc.o \ + rpcclient/cmd_samr.o \ + rpcclient/cmd_srvsvc.o \ + rpcclient/cmd_netlogon.o \ + $(PARAM_OBJ) $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) \ + $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_GET_SET_OBJ) + +DEBUG2HTML_OBJ = utils/debug2html.o ubiqx/debugparse.o + +SMBFILTER_OBJ = utils/smbfilter.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(SECRETS_OBJ) \ + $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) + +PROTO_OBJ = $(SMBD_OBJ_MAIN) \ + $(SMBD_OBJ_SRV) $(NMBD_OBJ1) $(SWAT_OBJ1) $(LIB_OBJ) $(LIBSMB_OBJ) \ + $(SMBTORTURE_OBJ1) $(RPCCLIENT_OBJ1) \ + $(LIBMSRPC_OBJ) @SMBWRAP_OBJS@ \ + $(RPC_PIPE_OBJ) $(RPC_PARSE_OBJ) $(KRBCLIENT_OBJ) \ + $(AUTH_OBJ) $(PARAM_OBJ) $(LOCKING_OBJ) $(SECRETS_OBJ) \ + $(PRINTING_OBJ) $(PRINTBACKEND_OBJ) $(OPLOCK_OBJ) $(NOTIFY_OBJ) \ + $(PASSDB_OBJ) $(GROUPDB_OBJ) \ + $(READLINE_OBJ) $(PROFILE_OBJ) $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) \ + $(AUTH_SAM_OBJ) $(REGISTRY_OBJ) $(POPT_LIB_OBJ) \ + $(RPC_LSA_OBJ) $(RPC_NETLOG_OBJ) $(RPC_SAMR_OBJ) $(RPC_REG_OBJ) $(RPC_LSA_DS_OBJ) \ + $(RPC_SVC_OBJ) $(RPC_WKS_OBJ) $(RPC_DFS_OBJ) $(RPC_SPOOLSS_OBJ) \ + $(RPC_ECHO_OBJ) $(RPC_SVCCTL_OBJ) $(RPC_EVENTLOG_OBJ) $(SMBLDAP_OBJ) \ + $(IDMAP_OBJ) libsmb/spnego.o $(PASSCHANGE_OBJ) + +WINBIND_WINS_NSS_OBJ = nsswitch/wins.o $(PARAM_OBJ) \ + $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) $(NSSWINS_OBJ) $(KRBCLIENT_OBJ) + +WINBIND_WINS_NSS_PICOBJS = $(WINBIND_WINS_NSS_OBJ:.o=.@PICSUFFIX@) + +PICOBJS = $(SMBWRAPPER_OBJ:.o=.@PICSUFFIX@) +LIBSMBCLIENT_PICOBJS = $(LIBSMBCLIENT_OBJ:.o=.@PICSUFFIX@) +LIBSMBSHAREMODES_PICOBJS = $(LIBSMBSHAREMODES_OBJ:.o=.@PICSUFFIX@) + +PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \ + pam_smbpass/pam_smb_acct.o pam_smbpass/support.o \ + $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \ + $(SECRETS_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ) + +PAM_SMBPASS_PICOOBJ = $(PAM_SMBPASS_OBJ_0:.o=.@PICSUFFIX@) + +IDMAP_OBJ = sam/idmap.o sam/idmap_util.o @IDMAP_STATIC@ + +WINBINDD_OBJ1 = \ + nsswitch/winbindd.o \ + nsswitch/winbindd_user.o \ + nsswitch/winbindd_group.o \ + nsswitch/winbindd_util.o \ + nsswitch/winbindd_cache.o \ + nsswitch/winbindd_pam.o \ + nsswitch/winbindd_sid.o \ + nsswitch/winbindd_misc.o \ + nsswitch/winbindd_cm.o \ + nsswitch/winbindd_wins.o \ + nsswitch/winbindd_rpc.o \ + nsswitch/winbindd_reconnect.o \ + nsswitch/winbindd_ads.o \ + nsswitch/winbindd_passdb.o \ + nsswitch/winbindd_dual.o \ + nsswitch/winbindd_async.o + +WINBINDD_OBJ = \ + $(WINBINDD_OBJ1) $(PASSDB_OBJ) $(GROUPDB_OBJ) \ + $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \ + $(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) \ + $(PROFILE_OBJ) $(SLCACHE_OBJ) $(SMBLDAP_OBJ) \ + $(SECRETS_OBJ) $(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) \ + $(DCUTIL_OBJ) $(IDMAP_OBJ) \ + $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) + +WBINFO_OBJ = nsswitch/wbinfo.o $(LIBSAMBA_OBJ) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \ + $(SECRETS_OBJ) $(POPT_LIB_OBJ) $(AFS_SETTOKEN_OBJ) + +WINBIND_NSS_OBJ = $(WBCOMMON_OBJ) lib/replace1.o @WINBIND_NSS_EXTRA_OBJS@ + +WINBIND_NSS_PICOBJS = $(WINBIND_NSS_OBJ:.o=.@PICSUFFIX@) lib/snprintf.@PICSUFFIX@ + +POPT_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \ + popt/popthelp.o popt/poptparse.o + +TDBBACKUP_OBJ = tdb/tdbbackup.o tdb/tdbback.o $(SNPRINTF_OBJ) $(TDBBASE_OBJ) + +TDBTOOL_OBJ = tdb/tdbtool.o $(TDBBASE_OBJ) $(SNPRINTF_OBJ) + +TDBDUMP_OBJ = tdb/tdbdump.o $(TDBBASE_OBJ) $(SNPRINTF_OBJ) + +NTLM_AUTH_OBJ1 = utils/ntlm_auth.o utils/ntlm_auth_diagnostics.o + +NTLM_AUTH_OBJ = ${NTLM_AUTH_OBJ1} $(LIBSAMBA_OBJ) $(POPT_LIB_OBJ) \ + libsmb/asn1.o libsmb/spnego.o libsmb/clikrb5.o libads/kerberos.o \ + libads/kerberos_verify.o $(SECRETS_OBJ) $(SERVER_MUTEX_OBJ) \ + libads/authdata.o $(RPC_PARSE_OBJ0) $(PASSDB_OBJ) $(GROUPDB_OBJ) \ + $(SMBLDAP_OBJ) $(DOSERR_OBJ) + +###################################################################### +# now the rules... +###################################################################### +all : SHOWFLAGS proto_exists $(SBIN_PROGS) $(BIN_PROGS) $(SHLIBS) \ + $(MODULES) @EXTRA_ALL_TARGETS@ + +pam_smbpass : SHOWFLAGS bin/pam_smbpass.@SHLIBEXT@ + +smbwrapper : SHOWFLAGS @SMBWRAPPER@ + +torture : SHOWFLAGS $(TORTURE_PROGS) + +smbtorture : SHOWFLAGS bin/smbtorture@EXEEXT@ + +masktest : SHOWFLAGS bin/masktest@EXEEXT@ + +msgtest : SHOWFLAGS bin/msgtest@EXEEXT@ + +locktest : SHOWFLAGS bin/locktest@EXEEXT@ + +smbcacls : SHOWFLAGS bin/smbcacls@EXEEXT@ + +smbcquotas : SHOWFLAGS bin/smbcquotas@EXEEXT@ + +locktest2 : SHOWFLAGS bin/locktest2@EXEEXT@ + +rpctorture : SHOWFLAGS bin/rpctorture@EXEEXT@ + +debug2html : SHOWFLAGS bin/debug2html@EXEEXT@ + +smbfilter : SHOWFLAGS bin/smbfilter@EXEEXT@ + +talloctort : SHOWFLAGS bin/talloctort@EXEEXT@ + +nsswitch : SHOWFLAGS bin/winbindd@EXEEXT@ bin/wbinfo@EXEEXT@ @WINBIND_NSS@ \ + @WINBIND_WINS_NSS@ nsswitch/pam_winbind.@SHLIBEXT@ + +wins : SHOWFLAGS @WINBIND_WINS_NSS@ + +modules: SHOWFLAGS proto_exists $(MODULES) + +everything: all libsmbclient debug2html smbfilter talloctort modules torture \ + $(EVERYTHING_PROGS) + +.SUFFIXES: +.SUFFIXES: .c .o .@PICSUFFIX@ .lo + +SHOWFLAGS: + @echo "Using FLAGS = $(FLAGS)" + @echo " LIBS = $(LIBS)" + @echo " LDSHFLAGS = $(LDSHFLAGS)" + @echo " LDFLAGS = $(LDFLAGS)" + @echo " PIE_CFLAGS = @PIE_CFLAGS@" + @echo " PIE_LDFLAGS = @PIE_LDFLAGS@" + +MAKEDIR = || exec false; \ + if test -d "$$dir"; then :; else \ + echo mkdir "$$dir"; \ + mkdir -p "$$dir" >/dev/null 2>&1 || \ + test -d "$$dir" || \ + mkdir "$$dir" || \ + exec false; fi || exec false + +.c.o: + @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \ + dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi + @echo Compiling $*.c + @$(CC) -I. -I$(srcdir) $(FLAGS) @PIE_CFLAGS@ -c $< \ + -o $@ +@BROKEN_CC@ -mv `echo $@ | sed 's%^.*/%%g'` $@ + +# this adds support for precompiled headers. To use it, install a snapshot +# of gcc-3.4 and run 'make pch' before you do the main build. +pch: + rm -f $(srcdir)/include/includes.h.gch + $(CC) -I. -I$(srcdir) $(FLAGS) -c $(srcdir)/include/includes.h -o $(srcdir)/include/includes.h.gch + +# These dependencies are only approximately correct: we want to make +# sure Samba's paths are updated if ./configure is re-run. Really it +# would be nice if "make prefix=/opt/samba all" also rebuilt things, +# but since we also require "make install prefix=/opt/samba" *not* to +# rebuild it's a bit hard. + +dynconfig.o: dynconfig.c Makefile + @echo Compiling $*.c + @$(CC) $(FLAGS) $(PATH_FLAGS) @PIE_CFLAGS@ -c $(srcdir)/dynconfig.c -o $@ + +dynconfig.@PICSUFFIX@: dynconfig.c Makefile + @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \ + dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi + @echo Compiling $*.c with @PICFLAGS@ + @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAGS@ -c $(srcdir)/dynconfig.c -o $@ +@BROKEN_CC@ -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.@PICSUFFIX@$$%.o%'` $@ + +lib/version.o: lib/version.c include/version.h + @echo Compiling $*.c + @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PIE_CFLAGS@ -c $(srcdir)/lib/version.c -o $@ + +lib/version.@PICSUFFIX@: lib/version.c include/version.h + @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \ + dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi + @echo Compiling $*.c with @PICFLAGS@ + @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAGS@ -c $(srcdir)/lib/version.c -o $@ +@BROKEN_CC@ -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.@PICSUFFIX@$$%.o%'` $@ + +smbd/build_options.o: smbd/build_options.c Makefile include/config.h include/build_env.h include/proto.h + @echo Compiling $*.c + @$(CC) $(FLAGS) $(PATH_FLAGS) @PIE_CFLAGS@ -c smbd/build_options.c -o $@ + +smbd/build_options.c: include/config.h.in script/mkbuildoptions.awk + @echo Generating $@ + @dir=smbd $(MAKEDIR) && $(AWK) -f $(srcdir)/script/mkbuildoptions.awk > $(builddir)/smbd/build_options.c < $(srcdir)/include/config.h.in + +.c.@PICSUFFIX@: + @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \ + dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi + @echo Compiling $*.c with @PICFLAGS@ + @$(CC) -I. -I$(srcdir) $(FLAGS) @PICFLAGS@ -c $< -o $*.@PICSUFFIX@ +@BROKEN_CC@ -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.@PICSUFFIX@$$%.o%'` $@ + +bin/.dummy: + @if (: >> $@ || : > $@) >/dev/null 2>&1; then :; else \ + dir=bin $(MAKEDIR); fi + @: >> $@ || : > $@ # what a fancy emoticon! + +bin/smbd@EXEEXT@: $(SMBD_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBD_OBJ) $(LDFLAGS) $(LDAP_LIBS) \ + $(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \ + $(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) @POPTLIBS@ + +bin/nmbd@EXEEXT@: $(NMBD_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(NMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) + +bin/wrepld@EXEEXT@: $(WREPL_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(WREPL_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ + +bin/swat@EXEEXT@: $(SWAT_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINT_LIBS) \ + $(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) + +bin/rpcclient@EXEEXT@: $(RPCCLIENT_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(LDFLAGS) $(PASSDB_LIBS) $(RPCCLIENT_OBJ) \ + $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \ + $(KRB5LIBS) $(LDAP_LIBS) + +bin/smbclient@EXEEXT@: $(CLIENT_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) + +bin/net@EXEEXT@: $(NET_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) + +bin/profiles@EXEEXT@: $(PROFILES_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(PROFILES_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ + +bin/smbspool@EXEEXT@: $(CUPS_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(CUPS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/smbmount@EXEEXT@: $(MOUNT_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(MOUNT_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/smbmnt@EXEEXT@: $(MNT_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(MNT_OBJ) $(DYNEXP) $(LDFLAGS) + +bin/smbumount@EXEEXT@: $(UMOUNT_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(UMOUNT_OBJ) $(DYNEXP) $(LDFLAGS) + +bin/testparm@EXEEXT@: $(TESTPARM_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(TESTPARM_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ + +bin/smbstatus@EXEEXT@: $(STATUS_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(STATUS_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \ + @POPTLIBS@ + +bin/smbcontrol@EXEEXT@: $(SMBCONTROL_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) -DUSING_SMBCONTROL $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBCONTROL_OBJ) $(DYNEXP) \ + $(LDFLAGS) $(LIBS) \ + @POPTLIBS@ + +bin/smbtree@EXEEXT@: $(SMBTREE_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBTREE_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) + +bin/smbpasswd@EXEEXT@: $(SMBPASSWD_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBPASSWD_OBJ) $(LDFLAGS) $(PASSDB_LIBS) \ + $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/pdbedit@EXEEXT@: $(PDBEDIT_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(PDBEDIT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(PASSDB_LIBS) $(LDAP_LIBS) + +bin/smbget@EXEEXT@: $(SMBGET_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBGET_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) + +bin/samtest@EXEEXT@: $(SAMTEST_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SAMTEST_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(PASSDB_LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/nmblookup@EXEEXT@: $(NMBLOOKUP_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(NMBLOOKUP_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(LDAP_LIBS) + +bin/smbtorture@EXEEXT@: $(SMBTORTURE_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBTORTURE_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/talloctort@EXEEXT@: $(TALLOCTORT_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(TALLOCTORT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) + +bin/masktest@EXEEXT@: $(MASKTEST_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(MASKTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/msgtest@EXEEXT@: $(MSGTEST_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(MSGTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/smbcacls@EXEEXT@: $(SMBCACLS_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBCACLS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) + +bin/smbcquotas@EXEEXT@: $(SMBCQUOTAS_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBCQUOTAS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) + +bin/locktest@EXEEXT@: $(LOCKTEST_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(LOCKTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/nsstest@EXEEXT@: $(NSSTEST_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(NSSTEST_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/vfstest@EXEEXT@: $(VFSTEST_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(VFSTEST_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) $(ACL_LIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) + +bin/smbiconv@EXEEXT@: $(SMBICONV_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBICONV_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(LIBS) @POPTLIBS@ + +bin/log2pcap@EXEEXT@: $(LOG2PCAP_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(LOG2PCAP_OBJ) $(LDFLAGS) $(DYNEXP) @POPTLIBS@ $(LIBS) + +bin/locktest2@EXEEXT@: $(LOCKTEST2_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(LOCKTEST2_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/rpctorture@EXEEXT@: $(RPCTORTURE_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(RPCTORTURE_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/debug2html@EXEEXT@: $(DEBUG2HTML_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DEBUG2HTML_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) + +bin/smbfilter@EXEEXT@: $(SMBFILTER_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBFILTER_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/smbw_sample@EXEEXT@: $(SMBW_OBJ) utils/smbw_sample.o bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBW_OBJ) utils/smbw_sample.o $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) + +bin/smbsh@EXEEXT@: $(SMBSH_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBSH_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) + +bin/smbwrapper.@SHLIBEXT@: $(PICOBJS) bin/.dummy + @echo Linking shared library $@ + @$(SHLD) $(LDSHFLAGS) -o $@ $(PICOBJS) $(LIBS) \ + $(KRB5LIBS) $(LDAP_LIBS) \ + @SONAMEFLAG@`basename $@` + +bin/libsmbclient.@SHLIBEXT@: $(LIBSMBCLIENT_PICOBJS) + @echo Linking libsmbclient shared library $@ + @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBSMBCLIENT_PICOBJS) $(LDFLAGS) $(LIBS) \ + $(KRB5LIBS) $(LDAP_LIBS) \ + @SONAMEFLAG@`basename $@`.$(LIBSMBCLIENT_MAJOR) + +bin/libsmbclient.a: $(LIBSMBCLIENT_PICOBJS) + @echo Linking libsmbclient non-shared library $@ + @-$(AR) -rc $@ $(LIBSMBCLIENT_PICOBJS) + +bin/libsmbsharemodes.@SHLIBEXT@: $(LIBSMBSHAREMODES_PICOBJS) + @echo Linking libsmbsharemodes shared library $@ + @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBSMBSHAREMODES_PICOBJS) $(LDFLAGS) $(LIBS) \ + $(KRB5LIBS) $(LDAP_LIBS) \ + @SONAMEFLAG@`basename $@`.$(LIBSMBSHAREMODES_MAJOR) + +bin/libsmbsharemodes.a: $(LIBSMBSHAREMODES_PICOBJS) + @echo Linking libsmbsharemodes non-shared library $@ + @-$(AR) -rc $@ $(LIBSMBSHAREMODES_PICOBJS) + +# This is probably wrong for anything other than the GNU linker. +bin/libbigballofmud.@SHLIBEXT@: $(LIBBIGBALLOFMUD_PICOBJS) + @echo Linking bigballofmud shared library $@ + @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBBIGBALLOFMUD_PICOBJS) $(LIBS) \ + $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS) \ + @SONAMEFLAG@`basename $@`.$(LIBBIGBALLOFMUD_MAJOR) + ln -snf libbigballofmud.so bin/libbigballofmud.so.0 + +# It would be nice to build a static bigballofmud too, but when I try +# I get linker errors about dl_open and similar things. I'm not sure if +# it can be fixed or if they just can't be called from a static +# library. + +libsmbclient: $(LIBSMBCLIENT) +libsmbsharemodes: $(LIBSMBSHAREMODES) + +bin/librpc_lsarpc.@SHLIBEXT@: $(RPC_LSA_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_LSA_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/librpc_samr.@SHLIBEXT@: $(RPC_SAMR_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SAMR_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/librpc_srvsvc.@SHLIBEXT@: $(RPC_SVC_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SVC_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/librpc_svcctl.@SHLIBEXT@: $(RPC_SVCCTL_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SVCCTL_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/librpc_wkssvc.@SHLIBEXT@: $(RPC_WKS_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_WKS_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/librpc_NETLOGON.@SHLIBEXT@: $(RPC_NETLOG_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_NETLOG_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/librpc_winreg.@SHLIBEXT@: $(RPC_REG_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_REG_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/librpc_lsa_ds.@SHLIBEXT@: $(RPC_LSA_DS_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_LSA_DS_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/librpc_spoolss.@SHLIBEXT@: $(RPC_SPOOLSS_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SPOOLSS_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/librpc_eventlog.@SHLIBEXT@: $(RPC_EVENTLOG_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_EVENTLOG_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/librpc_netdfs.@SHLIBEXT@: $(RPC_DFS_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_DFS_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/librpc_echo.@SHLIBEXT@: $(RPC_ECHO_OBJ) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_ECHO_OBJ) -lc \ + @SONAMEFLAG@`basename $@` + +bin/winbindd@EXEEXT@: $(WINBINDD_OBJ) @BUILD_POPT@ bin/.dummy + @echo "Linking $@" + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(WINBINDD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \ + @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) + +# Please don't add .o files to libnss_winbind, libnss_wins, or the pam_winbind +# libraries. Add to the appropriate PICOBJ variable instead. + +@WINBIND_NSS@: $(WINBIND_NSS_PICOBJS) + @echo "Linking $@" + @$(SHLD) $(WINBIND_NSS_LDSHFLAGS) -o $@ $(WINBIND_NSS_PICOBJS) \ + @WINBIND_NSS_EXTRA_LIBS@ @SONAMEFLAG@`basename $@` + +@WINBIND_WINS_NSS@: $(WINBIND_WINS_NSS_PICOBJS) + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_WINS_NSS_PICOBJS) \ + $(LDAP_LIBS) $(KRB5LIBS) -lc \ + @SONAMEFLAG@`basename $@` + +nsswitch/pam_winbind.@SHLIBEXT@: $(PAM_WINBIND_PICOBJ) bin/.dummy + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_WINBIND_PICOBJ) \ + @SONAMEFLAG@`basename $@` -lpam + +bin/rhosts.@SHLIBEXT@: $(AUTH_RHOSTS_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_RHOSTS_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@` + +bin/builtin.@SHLIBEXT@: $(AUTH_BUILTIN_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_BUILTIN_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@` + +bin/domain.@SHLIBEXT@: $(AUTH_DOMAIN_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_DOMAIN_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@` + +bin/smbserver.@SHLIBEXT@: $(AUTH_SERVER_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_SERVER_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@` + +bin/winbind.@SHLIBEXT@: $(AUTH_WINBIND_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_WINBIND_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@` + +bin/unix.@SHLIBEXT@: $(AUTH_UNIX_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_UNIX_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@` + +bin/sam.@SHLIBEXT@: $(AUTH_SAM_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_SAM_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@` + +bin/mysql.@SHLIBEXT@: $(MYSQL_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(MYSQL_OBJ:.o=.@PICSUFFIX@) @MYSQL_LIBS@ \ + @SONAMEFLAG@`basename $@` + +bin/pgsql.@SHLIBEXT@: $(PGSQL_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(PGSQL_OBJ:.o=.@PICSUFFIX@) @PGSQL_LIBS@ \ + @SONAMEFLAG@`basename $@` + +bin/ldapsam.@SHLIBEXT@: passdb/pdb_ldap.@PICSUFFIX@ + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) $(LDAP_LIBS) -o $@ passdb/pdb_ldap.@PICSUFFIX@ \ + @SONAMEFLAG@`basename $@` + +bin/tdbsam.@SHLIBEXT@: passdb/pdb_tdb.@PICSUFFIX@ + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ passdb/pdb_tdb.@PICSUFFIX@ \ + @SONAMEFLAG@`basename $@` + +bin/smbpasswd.@SHLIBEXT@: passdb/pdb_smbpasswd.@PICSUFFIX@ + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ passdb/pdb_smbpasswd.@PICSUFFIX@ \ + @SONAMEFLAG@`basename $@` + +bin/idmap_rid.@SHLIBEXT@: sam/idmap_rid.@PICSUFFIX@ + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ sam/idmap_rid.@PICSUFFIX@ \ + @SONAMEFLAG@`basename $@` + +bin/idmap_ad.@SHLIBEXT@: sam/idmap_ad.@PICSUFFIX@ + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ sam/idmap_ad.@PICSUFFIX@ \ + @SONAMEFLAG@`basename $@` + +bin/weird.@SHLIBEXT@: $(DEVEL_HELP_WEIRD_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(DEVEL_HELP_WEIRD_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/CP850.@SHLIBEXT@: $(CP850_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(CP850_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/CP437.@SHLIBEXT@: $(CP437_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(CP437_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/macosxfs.@SHLIBEXT@: $(CHARSET_MACOSXFS_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(CHARSET_MACOSXFS_OBJ:.o=.@PICSUFFIX@) \ + -framework CoreFoundation @SONAMEFLAG@`basename $@` + +bin/xml.@SHLIBEXT@: $(XML_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(XML_OBJ:.o=.@PICSUFFIX@) @XML_LIBS@ \ + @SONAMEFLAG@`basename $@` + +bin/audit.@SHLIBEXT@: $(VFS_AUDIT_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_AUDIT_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/extd_audit.@SHLIBEXT@: $(VFS_EXTD_AUDIT_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_EXTD_AUDIT_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/full_audit.@SHLIBEXT@: $(VFS_FULL_AUDIT_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_FULL_AUDIT_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/recycle.@SHLIBEXT@: $(VFS_RECYCLE_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_RECYCLE_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/netatalk.@SHLIBEXT@: $(VFS_NETATALK_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_NETATALK_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/fake_perms.@SHLIBEXT@: $(VFS_FAKE_PERMS_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_FAKE_PERMS_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/default_quota.@SHLIBEXT@: $(VFS_DEFAULT_QUOTA_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_DEFAULT_QUOTA_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/readonly.@SHLIBEXT@: $(VFS_READONLY_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_READONLY_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/shadow_copy.@SHLIBEXT@: $(VFS_SHADOW_COPY_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_SHADOW_COPY_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/cap.@SHLIBEXT@: $(VFS_CAP_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_CAP_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/expand_msdfs.@SHLIBEXT@: $(VFS_EXPAND_MSDFS_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_EXPAND_MSDFS_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + +bin/afsacl.@SHLIBEXT@: $(VFS_AFSACL_OBJ:.o=.po) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_AFSACL_OBJ:.o=.po) \ + @SONAMEFLAG@`basename $@` + +bin/catia.@SHLIBEXT@: $(VFS_CATIA_OBJ:.o=.@PICSUFFIX@) + @echo "Building plugin $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_CATIA_OBJ:.o=.@PICSUFFIX@) \ + @SONAMEFLAG@`basename $@` + + +bin/wbinfo@EXEEXT@: $(WBINFO_OBJ) @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(LDFLAGS) $(WBINFO_OBJ) $(DYNEXP) $(LIBS) @POPTLIBS@ + +bin/ntlm_auth@EXEEXT@: $(NTLM_AUTH_OBJ) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \ + @BUILD_POPT@ bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(LDFLAGS) $(DYNEXP) $(NTLM_AUTH_OBJ) \ + $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(LIBS) \ + @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) + +bin/pam_smbpass.@SHLIBEXT@: $(PAM_SMBPASS_PICOOBJ) + @echo "Linking shared library $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_PICOOBJ) -lpam $(DYNEXP) $(LIBS) -lc $(LDAP_LIBS) $(KRB5LIBS) + +bin/libmsrpc.a: $(LIBMSRPC_PICOBJ) + @-$(AR) -rc $@ $(LIBMSRPC_PICOBJ) + +bin/tdbbackup@EXEEXT@: $(TDBBACKUP_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBBACKUP_OBJ) @SOCKWRAP@ + +bin/tdbtool@EXEEXT@: $(TDBTOOL_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBTOOL_OBJ) @SOCKWRAP@ + +bin/tdbdump@EXEEXT@: $(TDBDUMP_OBJ) bin/.dummy + @echo Linking $@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(LDFLAGS) $(DYNEXP) $(LIBS) $(TDBDUMP_OBJ) @SOCKWRAP@ + +bin/t_strcmp@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_strcmp.o + $(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(LIBS) torture/t_strcmp.o -L ./bin -lbigballofmud + +bin/t_strstr@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_strstr.o + $(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(LIBS) torture/t_strstr.o -L ./bin -lbigballofmud + +bin/t_stringoverflow@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_stringoverflow.o + $(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) torture/t_stringoverflow.o -L./bin -lbigballofmud + +bin/t_doschar@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_doschar.o + $(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(LIBS) torture/t_doschar.o -L ./bin -lbigballofmud +bin/t_push_ucs2@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_push_ucs2.o + $(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(LIBS) torture/t_push_ucs2.o -L ./bin -lbigballofmud + +bin/t_snprintf@EXEEXT@: lib/snprintf.c + $(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) -DTEST_SNPRINTF lib/snprintf.c -lm +install: installbin installman installscripts installdat installswat installmodules @INSTALLCLIENT@ + +install-everything: install installmodules + +# DESTDIR is used here to prevent packagers wasting their time +# duplicating the Makefile. Remove it and you will have the privelege +# of package each samba release for muliple versions of multiple +# distributions and operating systems, or at least supplying patches +# to all the packaging files required for this, prior to committing +# the removal of DESTDIR. Do not remove it even though you think it +# is not used + +installdirs: + @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) $(DESTDIR)$(PIDDIR) $(DESTDIR)$(LOCKDIR) $(DESTDIR)$(MANDIR) + +installservers: all installdirs + @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS) + +installbin: all installdirs + @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS) + @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(BIN_PROGS) + + +# Some symlinks are required for the 'probing' of modules. +# This mechanism should go at some point.. +installmodules: modules installdirs + @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(VFSLIBDIR) $(VFS_MODULES) + @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(PDBLIBDIR) $(PDB_MODULES) + @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(RPCLIBDIR) $(RPC_MODULES) + @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(IDMAPLIBDIR) $(IDMAP_MODULES) + @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSETLIBDIR) $(CHARSET_MODULES) + @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(AUTHLIBDIR) $(AUTH_MODULES) + @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(PDBLIBDIR) ldapsam.@SHLIBEXT@ ldapsam_compat.@SHLIBEXT@ + @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) rhosts.@SHLIBEXT@ hostsequiv.@SHLIBEXT@ + @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) sam.@SHLIBEXT@ sam_ignoredomain.@SHLIBEXT@ + @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) domain.@SHLIBEXT@ trustdomain.@SHLIBEXT@ ntdomain.@SHLIBEXT@ + @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) builtin.@SHLIBEXT@ guest.@SHLIBEXT@ fixed_challenge.@SHLIBEXT@ name_to_ntstatus.@SHLIBEXT@ + +installscripts: installdirs + @$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS) + +installdat: installdirs + @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir) + +installmsg: installdirs + @$(SHELL) $(srcdir)/script/installmsg.sh $(DESTDIR)$(LIBDIR) $(srcdir) + +installswat: installdirs installmsg + @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir) + +installclientlib: installdirs libsmbclient + @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(LIBDIR) + -$(INSTALLCLIENTCMD_SH) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)$(LIBDIR) + -$(INSTALLCLIENTCMD_A) bin/libsmbclient.a $(DESTDIR)$(LIBDIR) + @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/include + -$(INSTALLCMD) $(srcdir)/include/libsmbclient.h $(DESTDIR)${prefix}/include + +# Python extensions + +PYTHON_OBJS = $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(LIBSMB_OBJ) $(RPC_PARSE_OBJ) \ + $(LIBMSRPC_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \ + $(SECRETS_OBJ) $(KRBCLIENT_OBJ) $(SMBLDAP_OBJ) + +PYTHON_PICOBJS = $(PYTHON_OBJS:.o=.@PICSUFFIX@) + +python_ext: $(PYTHON_PICOBJS) + @if test -z "$(PYTHON)"; then \ + echo Use the option --with-python to configure python; \ + exit 1; \ + fi + PYTHON_OBJS="$(PYTHON_PICOBJS)" \ + PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS) $(FLAGS)" \ + LIBS="$(LDFLAGS) $(LIBS) $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS)" \ + $(PYTHON) python/setup.py build + +python_install: $(PYTHON_PICOBJS) + @if test -z "$(PYTHON)"; then \ + echo Use the option --with-python to configure python; \ + exit 1; \ + fi + PYTHON_OBJS="$(PYTHON_PICOBJS)" \ + PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \ + LIBS="$(LDFLAGS) $(LIBS)" \ + $(PYTHON) python/setup.py install + +python_clean: + @-if test -n "$(PYTHON)"; then $(PYTHON) python/setup.py clean; fi + +# revert to the previously installed version +revert: + @$(SHELL) $(srcdir)/script/revert.sh $(SBINDIR) $(SBIN_PROGS) + @$(SHELL) $(srcdir)/script/revert.sh $(BINDIR) $(BIN_PROGS) $(SCRIPTS) + +installman: installdirs + @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(srcdir) C "@ROFF@" + +.PHONY: showlayout + +showlayout: + @echo "Samba will be installed into:" + @echo " basedir: $(BASEDIR)" + @echo " bindir: $(BINDIR)" + @echo " sbindir: $(SBINDIR)" + @echo " libdir: $(LIBDIR)" + @echo " vardir: $(VARDIR)" + @echo " mandir: $(MANDIR)" + @echo " privatedir: $(PRIVATE_DIR)" + @echo " configdir: $(CONFIGDIR)" + @echo " lockdir: $(LOCKDIR)" + @echo " piddir: $(PIDDIR)" + @echo " swatdir: $(SWATDIR)" + + +uninstall: uninstallman uninstallbin uninstallscripts uninstallmodules + +uninstallman: + @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(srcdir) C + +uninstallbin: + @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS) + @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS) + +uninstallmodules: + @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(VFSLIBDIR) $(DESTDIR)$(VFS_MODULES) + @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(PDBLIBDIR) $(DESTDIR)$(PDB_MODULES) + @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(RPCLIBDIR) $(DESTDIR)$(RPC_MODULES) + @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSETLIBDIR) $(DESTDIR)$(CHARSET_MODULES) + @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(AUTHLIBDIR) $(DESTDIR)$(AUTH_MODULES) + +uninstallscripts: + @$(SHELL) $(srcdir)/script/uninstallscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS) + +# Toplevel clean files +TOPFILES=dynconfig.o dynconfig.@PICSUFFIX@ + +clean: delheaders python_clean + -rm -f core */*~ *~ */*.o */*.@PICSUFFIX@ */*.@SHLIBEXT@ \ + $(TOPFILES) $(BIN_PROGS) $(SBIN_PROGS) $(MODULES) $(TORTURE_PROGS) \ + $(LIBSMBCLIENT) $(LIBSMBSHAREMODES) $(EVERYTHING_PROGS) .headers.stamp + -rm -rf t_dir + +# Making this target will just make sure that the prototype files +# exist, not necessarily that they are up to date. Since they're +# removed by "make clean" this will always be run when you do anything +# afterwards. +proto_exists: include/proto.h include/wrepld_proto.h include/build_env.h \ + nsswitch/winbindd_proto.h web/swat_proto.h \ + client/client_proto.h utils/net_proto.h utils/ntlm_auth_proto.h smbd/build_options.c + +delheaders: + @echo Removing prototype headers + @rm -f include/proto.h include/build_env.h include/wrepld_proto.h \ + nsswitch/winbindd_proto.h web/swat_proto.h \ + client/client_proto.h utils/net_proto.h \ + smbd/build_options.c + +MKPROTO_SH = $(srcdir)/script/mkproto.sh + +include/proto.h: smbd/build_options.c + @echo Building include/proto.h + @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \ + -h _PROTO_H_ $(builddir)/include/proto.h \ + $(PROTO_OBJ) + +include/build_env.h: script/build_env.sh + @echo Building include/build_env.h + @$(SHELL) $(srcdir)/script/build_env.sh $(srcdir) $(builddir) $(CC) \ + > $(builddir)/include/build_env.h + +include/wrepld_proto.h: + @echo Building include/wrepld_proto.h + @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \ + -h _WREPLD_PROTO_H_ $(builddir)/include/wrepld_proto.h \ + $(WREPL_OBJ1) + +nsswitch/winbindd_proto.h: + @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \ + -h _WINBINDD_PROTO_H_ $(builddir)/nsswitch/winbindd_proto.h \ + $(WINBINDD_OBJ1) + +web/swat_proto.h: + @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \ + -h _SWAT_PROTO_H_ $(builddir)/web/swat_proto.h \ + $(SWAT_OBJ1) + +client/client_proto.h: + @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \ + -h _CLIENT_PROTO_H_ $(builddir)/client/client_proto.h \ + $(CLIENT_OBJ1) + +utils/net_proto.h: + @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \ + -h _NET_PROTO_H_ $(builddir)/utils/net_proto.h \ + $(NET_OBJ1) + +utils/ntlm_auth_proto.h: + @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \ + -h _NTLM_AUTH_PROTO_H_ $(builddir)/utils/ntlm_auth_proto.h \ + $(NTLM_AUTH_OBJ1) + +# "make headers" or "make proto" calls a subshell because we need to +# make sure these commands are executed in sequence even for a +# parallel make. +headers: + $(MAKE) delheaders; \ + $(MAKE) smbd/build_options.c; \ + $(MAKE) include/proto.h; \ + $(MAKE) include/build_env.h; \ + $(MAKE) include/wrepld_proto.h; \ + $(MAKE) nsswitch/winbindd_proto.h; \ + $(MAKE) web/swat_proto.h; \ + $(MAKE) client/client_proto.h; \ + $(MAKE) utils/ntlm_auth_proto.h; \ + $(MAKE) utils/net_proto.h; + +proto: headers + +.PHONY: headers proto + +etags: + etags `find $(srcdir) -name "*.[ch]" | grep -v /CVS/` + +ctags: + ctags `find $(srcdir) -name "*.[ch]" | grep -v /CVS/` + +realclean: clean delheaders + -rm -f config.log bin/.dummy script/findsmb + +distclean: realclean + -rm -f include/stamp-h + -rm -f include/config.h Makefile + -rm -f config.status config.cache so_locations + -rm -rf .deps TAGS + +realdistclean: distclean + -rm -f include/config.h.in + -rm -f include/version.h + -rm -f configure + +# this target is really just for my use. It only works on a limited +# range of machines and is used to produce a list of potentially +# dead (ie. unused) functions in the code. (tridge) +finddead: + nm */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt + nm */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt + comm -13 nmused.txt nmfns.txt + + +# when configure.in is updated, reconfigure +$(srcdir)/configure: $(srcdir)/configure.in + @echo "WARNING: you need to rerun ./autogen.sh" + +config.status: $(srcdir)/configure + @echo "WARNING: you need to run ./configure" + +Makefile: $(srcdir)/Makefile.in config.status + @echo "WARNING: you need to run ./config.status" + +###################################################################### +# Samba Testing Framework + +# FIXME: LD_LIBRARY_PATH is not portable, but in the absence of +# libtool I don't know a better way to do it. Perhaps we should fix +# libbigballofmud to link statically? +## +## not working...to be replaced by 'make test' --jerry +## +#check: check-programs +# LD_LIBRARY_PATH="`pwd`/bin:$$LD_LIBRARY_PATH" \ +# PATH="`pwd`/bin:$$PATH" \ +# python stf/standardcheck.py; \ +# if test -n "$(PYTHON)"; then \ +# python stf/pythoncheck.py; \ +# fi + +# These are called by the test suite and need to be built before +# running it. For the time being we don't build all of BIN_PROGS, +# because they're not all needed. +check-programs: bin/t_strcmp bin/t_strstr bin/t_push_ucs2 bin/smbcontrol bin/t_snprintf + +test: all + @if test -z "$(SMB4TORTURE)"; then \ + echo "Please set the SMB4TORTURE environment variable"; \ + exit 1; \ + fi + ./script/smb4torture.sh `pwd`/prefix-test $(SMB4TORTURE) diff --git a/release-3-0-20b/source/VERSION b/release-3-0-20b/source/VERSION new file mode 100644 index 00000000000..3598e01f77a --- /dev/null +++ b/release-3-0-20b/source/VERSION @@ -0,0 +1,93 @@ +######################################################## +# SAMBA Version # +# # +# script/mkversion.sh # +# will use this file to create # +# include/version.h # +# # +######################################################## + +######################################################## +# This are the main SAMBA version numbers # +# # +# .. # +# # +# e.g. SAMBA_VERSION_MAJOR=3 # +# SAMBA_VERSION_MINOR=0 # +# SAMBA_VERSION_RELEASE=0 # +# -> "3.0.0" # +######################################################## +SAMBA_VERSION_MAJOR=3 +SAMBA_VERSION_MINOR=0 +SAMBA_VERSION_RELEASE=20 + +######################################################## +# If a official release has a serious bug # +# a security release will have 'a' sufffix # +# # +# so SAMBA's version will be # +# .. # +# # +# e.g. SAMBA_VERSION_REVISION=a # +# -> "2.2.8a" # +######################################################## +SAMBA_VERSION_REVISION=b + +######################################################## +# For 'pre' releases the version will be # +# # +# ..pre # +# # +# e.g. SAMBA_VERSION_PRE_RELEASE=1 # +# -> "2.2.9pre1" # +######################################################## +SAMBA_VERSION_PRE_RELEASE= + +######################################################## +# For 'rc' releases the version will be # +# # +# ..rc # +# # +# e.g. SAMBA_VERSION_RC_RELEASE=1 # +# -> "3.0.0rc1" # +######################################################## +SAMBA_VERSION_RC_RELEASE= + +######################################################## +# To mark SVN snapshots this should be set to 'yes' # +# in the development BRANCH, and set to 'no' only in # +# the SAMBA_X_X_RELEASE BRANCH # +# # +# ..[...]cvs # +# # +# e.g. SAMBA_VERSION_IS_SVN_SNAPSHOT=yes # +# -> "3.0.0-SVN-build-199" # +######################################################## +SAMBA_VERSION_IS_SVN_SNAPSHOT= + +######################################################## +# This can be set by vendors if they want... # +# This can be a string constant or a function which # +# returns a string (const char *) # +# # +# ..[...]- # +# # +# Note the '-' is automaticaly added # +# # +# e.g. SAMBA_VERSION_VENDOR_SUFFIX="VendorVersion" # +# -> "CVS 3.0.0rc2-VendorVersion" # +# # +# Note: If you want to use a function, # +# then patch lib/version.c and add this function # +# there, because the symbol must be available in # +# binary. # +# # +# const char *vendor_version(void) # +# { # +# return "VendorVersion"; # +# } # +# # +# e.g. SAMBA_VERSION_VENDOR_SUFFIX=vendor_version() # +# -> "CVS 3.0.0rc2-VendorVersion" # +######################################################## +SAMBA_VERSION_VENDOR_SUFFIX= diff --git a/release-3-0-20b/source/configure.in b/release-3-0-20b/source/configure.in new file mode 100644 index 00000000000..bbb1c30e32a --- /dev/null +++ b/release-3-0-20b/source/configure.in @@ -0,0 +1,5042 @@ +dnl Process this file with autoconf to produce a configure script. + +dnl We must use autotools 2.53 or above +AC_PREREQ(2.53) +AC_INIT(include/includes.h) +AC_CONFIG_HEADER(include/config.h) + +AC_DISABLE_STATIC +AC_ENABLE_SHARED + +SMB_VERSION_STRING=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_OFFICIAL_STRING' | cut -d '"' -f2` +echo "SAMBA VERSION: ${SMB_VERSION_STRING}" + +SAMBA_VERSION_SVN_REVISION=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_SVN_REVISION' | cut -d ' ' -f3-` +if test -n "${SAMBA_VERSION_SVN_REVISION}";then + echo "BUILD REVISION: ${SAMBA_VERSION_SVN_REVISION}" +fi + +################################################# +# Directory handling stuff to support both the +# legacy SAMBA directories and FHS compliant +# ones... +AC_PREFIX_DEFAULT(/usr/local/samba) + +lockdir="\${VARDIR}/locks" +piddir="\${VARDIR}/locks" +mandir="\${prefix}/man" +logfilebase="\${VARDIR}" +privatedir="\${prefix}/private" +libdir="\${prefix}/lib" +configdir="\${LIBDIR}" +swatdir="\${prefix}/swat" + +AC_ARG_WITH(fhs, +[ --with-fhs Use FHS-compliant paths (default=no)], +[ case "$withval" in + yes) + lockdir="\${VARDIR}/lib/samba" + piddir="\${VARDIR}/run" + mandir="\${prefix}/share/man" + logfilebase="\${VARDIR}/log/samba" + privatedir="\${CONFIGDIR}/private" + libdir="\${prefix}/lib/samba" + configdir="${sysconfdir}/samba" + swatdir="\${DATADIR}/samba/swat" + ;; + esac]) + +################################################# +# set private directory location +AC_ARG_WITH(privatedir, +[ --with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)], +[ case "$withval" in + yes|no) + # + # Just in case anybody calls it without argument + # + AC_MSG_WARN([--with-privatedir called without argument - will use default]) + ;; + * ) + privatedir="$withval" + ;; + esac]) + +################################################# +# set lock directory location +AC_ARG_WITH(lockdir, +[ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)], +[ case "$withval" in + yes|no) + # + # Just in case anybody calls it without argument + # + AC_MSG_WARN([--with-lockdir called without argument - will use default]) + ;; + * ) + lockdir="$withval" + ;; + esac]) + +################################################# +# set pid directory location +AC_ARG_WITH(piddir, +[ --with-piddir=DIR Where to put pid files ($ac_default_prefix/var/locks)], +[ case "$withval" in + yes|no) + # + # Just in case anybody calls it without argument + # + AC_MSG_WARN([--with-piddir called without argument - will use default]) + ;; + * ) + piddir="$withval" + ;; + esac]) + +################################################# +# set SWAT directory location +AC_ARG_WITH(swatdir, +[ --with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)], +[ case "$withval" in + yes|no) + # + # Just in case anybody does it + # + AC_MSG_WARN([--with-swatdir called without argument - will use default]) + ;; + * ) + swatdir="$withval" + ;; + esac]) + +################################################# +# set configuration directory location +AC_ARG_WITH(configdir, +[ --with-configdir=DIR Where to put configuration files ($libdir)], +[ case "$withval" in + yes|no) + # + # Just in case anybody does it + # + AC_MSG_WARN([--with-configdir called without argument - will use default]) + ;; + * ) + configdir="$withval" + ;; + esac]) + +################################################# +# set log directory location +AC_ARG_WITH(logfilebase, +[ --with-logfilebase=DIR Where to put log files ($VARDIR)], +[ case "$withval" in + yes|no) + # + # Just in case anybody does it + # + AC_MSG_WARN([--with-logfilebase called without argument - will use default]) + ;; + * ) + logfilebase="$withval" + ;; + esac]) + +################################################# +# set lib directory location +AC_ARG_WITH(libdir, +[ --with-libdir=DIR Where to put libdir ($libdir)], +[ case "$withval" in + yes|no) + # + # Just in case anybody does it + # + AC_MSG_WARN([--with-libdir without argument - will use default]) + ;; + * ) + libdir="$withval" + ;; + esac]) + +################################################# +# set lib directory location +AC_ARG_WITH(mandir, +[ --with-mandir=DIR Where to put man pages ($mandir)], +[ case "$withval" in + yes|no) + # + # Just in case anybody does it + # + AC_MSG_WARN([--with-mandir without argument - will use default]) + ;; + * ) + mandir="$withval" + ;; + esac]) + +AC_ARG_WITH(cfenc, +[ --with-cfenc=HEADERDIR Use internal CoreFoundation encoding API + for optimization (Mac OS X/Darwin only)], +[ +# May be in source $withval/CoreFoundation/StringEncodings.subproj. +# Should have been in framework $withval/CoreFoundation.framework/Headers. +for d in \ + $withval/CoreFoundation/StringEncodings.subproj \ + $withval/StringEncodings.subproj \ + $withval/CoreFoundation.framework/Headers \ + $withval/Headers \ + $withval +do + if test -r $d/CFStringEncodingConverter.h; then + ln -sfh $d include/CoreFoundation + fi +done +]) + +AC_SUBST(configdir) +AC_SUBST(lockdir) +AC_SUBST(piddir) +AC_SUBST(logfilebase) +AC_SUBST(privatedir) +AC_SUBST(swatdir) +AC_SUBST(bindir) +AC_SUBST(sbindir) + +dnl Unique-to-Samba variables we'll be playing with. +AC_SUBST(SHELL) +AC_SUBST(LDSHFLAGS) +AC_SUBST(SONAMEFLAG) +AC_SUBST(SHLD) +AC_SUBST(HOST_OS) +AC_SUBST(PICFLAGS) +AC_SUBST(PICSUFFIX) +AC_SUBST(libc_cv_fpie) +AC_SUBST(PIE_CFLAGS) +AC_SUBST(PIE_LDFLAGS) +AC_SUBST(SHLIBEXT) +AC_SUBST(INSTALLCLIENT) +AC_SUBST(INSTALLCLIENTCMD_SH) +AC_SUBST(INSTALLCLIENTCMD_A) +AC_SUBST(LIBSMBCLIENT_SHARED) +AC_SUBST(LIBSMBCLIENT) +AC_SUBST(LIBSMBSHAREMODES_SHARED) +AC_SUBST(LIBSMBSHAREMODES) +AC_SUBST(PRINT_LIBS) +AC_SUBST(AUTH_LIBS) +AC_SUBST(ACL_LIBS) +AC_SUBST(PASSDB_LIBS) +AC_SUBST(IDMAP_LIBS) +AC_SUBST(KRB5_LIBS) +AC_SUBST(LDAP_LIBS) +AC_SUBST(SHLIB_PROGS) +AC_SUBST(SMBWRAPPER) +AC_SUBST(SMBWRAP_OBJS) +AC_SUBST(SMBWRAP_INC) +AC_SUBST(EXTRA_BIN_PROGS) +AC_SUBST(EXTRA_SBIN_PROGS) +AC_SUBST(EXTRA_ALL_TARGETS) + +# Set defaults +PIE_CFLAGS="" +PIE_LDFLAGS="" +AC_ARG_ENABLE(pie, [ --enable-pie Turn on pie support if available (default=yes)]) + +if test "x$enable_pie" != xno +then + AC_CACHE_CHECK(for -fPIE, libc_cv_fpie, [dnl + cat > conftest.c <&AS_MESSAGE_LOG_FD]) + then + libc_cv_fpie=yes + PIE_CFLAGS="-fPIE" + PIE_LDFLAGS="-pie" + fi + rm -f conftest*]) +fi +if test "x$PIE_CFLAGS" = x +then + libc_cv_fpie=no +fi + +AC_ARG_ENABLE(debug, +[ --enable-debug Turn on compiler debugging information (default=no)], + [if eval "test x$enable_debug = xyes"; then + CFLAGS="${CFLAGS} -g" + fi]) + +AC_SUBST(SOCKWRAP) +AC_ARG_ENABLE(socket-wrapper, +[ --enable-socket-wrapper Turn on socket wrapper library (default=no)], + [if eval "test x$enable_socket_wrapper = xyes"; then + AC_DEFINE(SOCKET_WRAPPER,1,[Use socket wrapper library]) + SOCKWRAP="\$(SOCKET_WRAPPER_OBJ)" + fi]) + +# compile with optimization and without debugging by default, but +# allow people to set their own preference. +# do this here since AC_CACHE_CHECK apparently sets the CFLAGS to "-g -O2" +# if it has no value. This prevent *very* large debug binaries from occurring +# by default. +if test "x$CFLAGS" = x; then + CFLAGS="-O" +fi + +CFLAGS="${CFLAGS} -D_SAMBA_BUILD_" + +AC_ARG_ENABLE(developer, [ --enable-developer Turn on developer warnings and debugging (default=no)], + [if eval "test x$enable_developer = xyes"; then + developer=yes + CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER" + # Add -Wdeclaration-after-statement if compiler supports it + AC_CACHE_CHECK( + [that the C compiler understands -Wdeclaration-after-statement], + samba_cv_HAVE_Wdeclaration_after_statement, [ + AC_TRY_RUN_STRICT([ + int main(void) + { + return 0; + }],[-Wdeclaration-after-statement],[$CPPFLAGS],[$LDFLAGS], + samba_cv_HAVE_Wdeclaration_after_statement=yes, + samba_cv_HAVE_Wdeclaration_after_statement=no, + samba_cv_HAVE_Wdeclaration_after_statement=cross) + ]) + if test x"$samba_cv_HAVE_Wdeclaration_after_statement" = x"yes"; then + CFLAGS="${CFLAGS} -Wdeclaration-after-statement" + fi + fi]) + +AC_ARG_ENABLE(krb5developer, [ --enable-krb5developer Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)], + [if eval "test x$enable_krb5developer = xyes"; then + developer=yes + CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER" + fi]) + +AC_ARG_ENABLE(dmalloc, [ --enable-dmalloc Enable heap debugging [default=no]]) + +if test "x$enable_dmalloc" = xyes +then + AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging]) + AC_DEFINE(DMALLOC_FUNC_CHECK, 1, + [Define to check invariants around some common functions]) + LIBS="$LIBS -ldmalloc" +fi + +dnl Checks for programs. + +## +## for some reason this macro resets the CFLAGS +## so save and restore +## +OLD_CFLAGS=${CFLAGS} +AC_PROG_CC +CFLAGS=${OLD_CFLAGS} + +OLD_CFLAGS=${CFLAGS} +AC_PROG_CPP +CFLAGS=${OLD_CFLAGS} + +AC_PROG_INSTALL +AC_PROG_AWK +AC_PATH_PROG(PERL, perl) + +AC_CHECK_TOOL(AR, ar) + +dnl Check if we use GNU ld +LD=ld +AC_PROG_LD_GNU + +dnl Certain versions of GNU ld the default is not to have the +dnl --allow-shlib-undefined flag defined. This causes a stackload of +dnl warnings when building modules. +if test "$ac_cv_prog_gnu_ld" = "yes"; then + ac_cv_gnu_ld_version=`$LD -v 2>/dev/null | head -1` + AC_MSG_CHECKING(GNU ld release date) + changequote(,)dnl + ac_cv_gnu_ld_date=`echo $ac_cv_gnu_ld_version | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'` + changequote([,])dnl + AC_MSG_RESULT(${ac_cv_gnu_ld_date}) + if test -n "$ac_cv_gnu_ld_date"; then + if test "$ac_cv_gnu_ld_date" -lt 20030217; then + ac_cv_gnu_ld_no_default_allow_shlib_undefined=yes + fi + else + AC_MSG_CHECKING(GNU ld release version) + changequote(,)dnl + ac_cv_gnu_ld_vernr=`echo $ac_cv_gnu_ld_version | sed -n 's,^.*\([1-9][0-9]*\.[0-9][0-9]*\).*$,\1,p'` + ac_cv_gnu_ld_vernr_major=`echo $ac_cv_gnu_ld_vernr | cut -d '.' -f 1` + ac_cv_gnu_ld_vernr_minor=`echo $ac_cv_gnu_ld_vernr | cut -d '.' -f 2` + changequote([,])dnl + AC_MSG_RESULT(${ac_cv_gnu_ld_vernr}) + AC_MSG_CHECKING(GNU ld release version major) + AC_MSG_RESULT(${ac_cv_gnu_ld_vernr_major}) + AC_MSG_CHECKING(GNU ld release version minor) + AC_MSG_RESULT(${ac_cv_gnu_ld_vernr_minor}) + if test "$ac_cv_gnu_ld_vernr_major" -lt 2 || test "$ac_cv_gnu_ld_vernr_minor" -lt 14; then + ac_cv_gnu_ld_no_default_allow_shlib_undefined=yes + fi + fi +fi + +dnl needed before AC_TRY_COMPILE +AC_ISC_POSIX + +dnl look for executable suffix +AC_EXEEXT + +dnl Check if C compiler understands -c and -o at the same time +AC_PROG_CC_C_O +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then + BROKEN_CC= +else + BROKEN_CC=# +fi +AC_SUBST(BROKEN_CC) + +dnl Check if the C compiler understands -Werror +AC_CACHE_CHECK([that the C compiler understands -Werror],samba_cv_HAVE_Werror, [ + AC_TRY_RUN_STRICT([ + int main(void) + { + return 0; + }],[-Werror],[$CPPFLAGS],[$LDFLAGS], + samba_cv_HAVE_Werror=yes,samba_cv_HAVE_Werror=no,samba_cv_HAVE_Werror=cross)]) +if test x"$samba_cv_HAVE_Werror" = x"yes"; then + Werror_FLAGS="-Werror" +else +dnl Check if the C compiler understands -w2 +AC_CACHE_CHECK([that the C compiler understands -w2],samba_cv_HAVE_w2, [ + AC_TRY_RUN_STRICT([ + int main(void) + { + return 0; + }],[-w2],[$CPPFLAGS],[$LDFLAGS], + samba_cv_HAVE_w2=yes,samba_cv_HAVE_w2=no,samba_cv_HAVE_w2=cross)]) +if test x"$samba_cv_HAVE_w2" = x"yes"; then + Werror_FLAGS="-w2" +fi +fi + +dnl Check if the C compiler understands volatile (it should, being ANSI). +AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [ + AC_TRY_COMPILE([#include ],[volatile int i = 0], + samba_cv_volatile=yes,samba_cv_volatile=no)]) +if test x"$samba_cv_volatile" = x"yes"; then + AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile]) +fi + +UNAME_S=`(uname -s) 2>/dev/null` || UNAME_S="unknown" +AC_MSG_CHECKING(uname -s) +AC_MSG_RESULT(${UNAME_S}) + +UNAME_R=`(uname -r) 2>/dev/null` || UNAME_R="unknown" +AC_MSG_CHECKING(uname -r) +AC_MSG_RESULT(${UNAME_R}) + +UNAME_M=`(uname -m) 2>/dev/null` || UNAME_M="unknown" +AC_MSG_CHECKING(uname -m) +AC_MSG_RESULT(${UNAME_M}) + +UNAME_P=`(uname -p) 2>/dev/null` || UNAME_P="unknown" +AC_MSG_CHECKING(uname -p) +AC_MSG_RESULT(${UNAME_P}) + +AC_CANONICAL_SYSTEM + +dnl Add #include for broken IRIX header files + case "$host_os" in + *irix6*) AC_ADD_INCLUDE() + ;; +esac + +AC_VALIDATE_CACHE_SYSTEM_TYPE + +DYNEXP= + +dnl Add modules that have to be built by default here +dnl These have to be built static: +default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsa rpc_samr rpc_reg rpc_lsa_ds rpc_wks rpc_svcctl rpc_net rpc_dfs rpc_srv rpc_spoolss rpc_eventlog auth_rhosts auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin printerdb_file" + +dnl These are preferably build shared, and static if dlopen() is not available +default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy charset_CP850 charset_CP437" + +if test "x$developer" = xyes; then + default_static_modules="$default_static_modules rpc_echo" + default_shared_modules="$default_shared_modules charset_weird" +fi + +# +# Config CPPFLAG settings for strange OS's that must be set +# before other tests. Do NOT invoke AC_CHECK_HEADERS within this +# case statement; its first reference must be unconditional. +# +case "$host_os" in +# Try to work out if this is the native HPUX compiler that uses the -Ae flag. + *hpux*) + + AC_PROG_CC_FLAG(Ae) + # mmap on HPUX is completely broken... + AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken]) + if test $ac_cv_prog_cc_Ae = yes; then + CPPFLAGS="$CPPFLAGS -Ae" + fi +# +# Defines needed for HPUX support. +# HPUX has bigcrypt but (sometimes?) doesn't use it for +# password hashing - hence the USE_BOTH_CRYPT_CALLS define. +# + case `uname -r` in + *9*|*10*) + CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4 -DMAX_POSITIVE_LOCK_OFFSET=0x1ffffffffffLL" + AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls]) + AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions]) + AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions]) + AC_DEFINE(_ALIGNMENT_REQUIRED,1,[Required alignment]) + AC_DEFINE(_MAX_ALIGNMENT,4,[Maximum alignment]) + ;; + *11*) + CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4 -DMAX_POSITIVE_LOCK_OFFSET=0x1ffffffffffLL" + AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls]) + AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions]) + AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions]) + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to use large file support]) + AC_DEFINE(_ALIGNMENT_REQUIRED, 1, [Required alignment]) + AC_DEFINE(_MAX_ALIGNMENT, 4, [Maximum alignment]) + ;; + esac + ;; + +# +# CRAY Unicos has broken const handling + *unicos*) + AC_MSG_RESULT([disabling const]) + CPPFLAGS="$CPPFLAGS -Dconst=" + ;; + +# +# AIX4.x doesn't even admit to having large +# files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set. +# + *aix4*) + AC_MSG_RESULT([enabling large file support]) + CPPFLAGS="$CPPFLAGS -D_LARGE_FILES" + AC_DEFINE(_LARGE_FILES, 1, [Whether to enable large file support]) + ;; +# +# Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit +# to the existance of large files.. +# Note that -D_LARGEFILE64_SOURCE is different from the Sun +# recommendations on large file support, however it makes the +# compile work using gcc 2.7 and 2.8, whereas using the Sun +# recommendation makes the compile fail on gcc2.7. JRA. +# +# Solaris uses SYSV printing. Make sure to set that here. --jerry +# + *solaris*) + AC_DEFINE(SYSV, 1, [Whether to enable System V compatibility]) + case `uname -r` in + 5.0|5.0.*|5.1|5.1.*|5.2|5.2.*|5.3|5.3.*|5.5|5.5.*) + AC_MSG_RESULT([no large file support]) + ;; + 5.*) + AC_MSG_RESULT([enabling large file support]) + if test "$ac_cv_prog_gcc" = yes; then + ${CC-cc} -v >conftest.c 2>&1 + ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c` + rm -fr conftest.c + case "$ac_cv_gcc_compiler_version_number" in + *"gcc version 2.6"*|*"gcc version 2.7"*) + CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE -D_REENTRANT" + LDFLAGS="$LDFLAGS -lthread" + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) + ;; + *) + CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64" + LDFLAGS="$LDFLAGS -lthread" + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) + AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits]) + ;; + esac + else + CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64" + LDFLAGS="$LDFLAGS -lthread" + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) + AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits]) + fi + ;; + esac + ;; +# +# IRIX uses SYSV printing. Make sure to set that here +# + *irix*) + AC_DEFINE(SYSV, 1, [Whether to enable System V compatibility]) + ;; + *freebsd*|*dragonfly*) + AC_DEFINE(FREEBSD, 1, [Whether the host os is FreeBSD]) + ;; +# +# VOS may need to have POSIX support and System V compatibility enabled. +# + *vos*) + case "$CPPFLAGS" in + *-D_POSIX_C_SOURCE*) + ;; + *) + CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L" + AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Whether to enable POSIX support]) + ;; + esac + case "$CPPFLAGS" in + *-D_SYSV*|*-D_SVID_SOURCE*) + ;; + *) + CPPFLAGS="$CPPFLAGS -D_SYSV" + AC_DEFINE(_SYSV, 1, [Whether to enable System V compatibility]) + esac + ;; +# +# Tests needed for SINIX large file support. +# + *sysv4*) + if test $host = mips-sni-sysv4 ; then + AC_MSG_CHECKING([for LFS support]) + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS" + AC_TRY_RUN([ +#include +main () { +#if _LFS64_LARGEFILE == 1 +exit(0); +#else +exit(1); +#endif +}], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross]) + CPPFLAGS="$old_CPPFLAGS" + if test x$SINIX_LFS_SUPPORT = xyes ; then + CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS" + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) + CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS" + LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS" + LIBS="`getconf LFS64_LIBS` $LIBS" + fi + AC_MSG_RESULT([$SINIX_LFS_SUPPORT]) + fi + ;; + +# Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support. +# + *linux*) + AC_MSG_CHECKING([for LFS support]) + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS" + AC_TRY_RUN([ +#include +#include +#include +#include +main() { +#if _LFS64_LARGEFILE == 1 + struct utsname uts; + char *release; + int major, minor; + + /* Ensure this is glibc 2.2 or higher */ +#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) + int libc_major = __GLIBC__; + int libc_minor = __GLIBC_MINOR__; + + if (libc_major < 2) + exit(1); + if (libc_minor < 2) + exit(1); +#endif + + /* Ensure this is kernel 2.4 or higher */ + + uname(&uts); + release = strdup(uts.release); + major = atoi(strsep(&release, ".")); + minor = atoi(strsep(&release, ".")); + + if (major > 2 || (major == 2 && minor > 3)) + exit(0); + exit(1); +#else + exit(1); +#endif +} +], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross]) + CPPFLAGS="$old_CPPFLAGS" + if test x$LINUX_LFS_SUPPORT = xyes ; then + CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS" + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) + AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits]) + AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions]) + fi + AC_MSG_RESULT([$LINUX_LFS_SUPPORT]) + ;; + +# +# MacOS X is the *only* system that uses compose character in utf8. This +# is so horribly broken.... +# + *darwin*) + AC_DEFINE(BROKEN_UNICODE_COMPOSE_CHARACTERS, 1, [Does this system use unicode compose characters]) +# Add Fink directories for various packages, like dlcompat. +# Note: iconv does that explicitly below, but other packages +# don't. + CPPFLAGS="$CPPFLAGS -I/sw/include" + LDFLAGS="$LDFLAGS -L/sw/lib" + +# If we have dlsym_prepend_underscore (from Fink's dlcompat), +# use that instead of plain dlsym. + + AC_CHECK_LIB(dl,dlopen) + AC_CHECK_FUNCS(dlsym_prepend_underscore,[CPPFLAGS="$CPPFLAGS -Ddlsym=dlsym_prepend_underscore"]) + +# Add a system specific charset module. + + default_shared_modules="$default_shared_modules charset_macosxfs" + ;; + *hurd*) + AC_MSG_CHECKING([for LFS support]) + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS" + AC_TRY_RUN([ +#include +main () { +#if _LFS64_LARGEFILE == 1 +exit(0); +#else +exit(1); +#endif +}], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross]) + CPPFLAGS="$old_CPPFLAGS" + if test x$GLIBC_LFS_SUPPORT = xyes ; then + CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS" + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) + AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions]) + fi + AC_MSG_RESULT([$GLIBC_LFS_SUPPORT]) + ;; + +esac + +AC_INLINE +AC_HEADER_STDC +AC_HEADER_DIRENT +AC_HEADER_TIME +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS(aio.h arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h) +AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h alloca.h) +AC_CHECK_HEADERS(rpc/rpc.h rpcsvc/nis.h rpcsvc/ypclnt.h) +AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/prctl.h) +AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h) +AC_CHECK_HEADERS(sys/un.h) +AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h) +AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h) +AC_CHECK_HEADERS(sys/sysmacros.h security/_pam_macros.h dlfcn.h) +AC_CHECK_HEADERS(sys/syslog.h syslog.h execinfo.h) +AC_CHECK_HEADERS(langinfo.h locale.h) + +AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[ +#if HAVE_RPC_RPC_H +#include +#endif +]]) + +## These fail to compile on IRIX so just check for their presence +AC_CHECK_HEADERS(sys/mode.h,,,) + +# Look for Darwin headers +old_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-Iinclude $CPPFLAGS" +AC_CHECK_HEADERS([CoreFoundation/CFStringEncodingConverter.h], [], [AC_CHECK_HEADERS([CFStringEncodingConverter.h])]) +CPPFLAGS="$old_CPPFLAGS" + +# In valgrind 1.0.x, it's just valgrind.h. In 1.9.x+ there's a +# subdirectory of headers. +AC_CHECK_HEADERS(valgrind.h valgrind/valgrind.h valgrind/memcheck.h) + +# check for linux on amd64 since valgrind is not quite there yet +case "$host_os" in + *linux*) + case "$UNAME_P" in + *x86_64*) + AC_DEFINE(HAVE_64BIT_LINUX,1,[Whether we are running on 64bit linux]) + ;; + esac + ;; +esac + + +# +# HPUX has a bug in that including shadow.h causes a re-definition of MAXINT. +# This causes configure to fail to detect it. Check for shadow separately on HPUX. +# +case "$host_os" in + *hpux*) + AC_TRY_COMPILE([#include ],[struct spwd testme], + ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no) + if test x"$ac_cv_header_shadow_h" = x"yes"; then + AC_DEFINE(HAVE_SHADOW_H,1,[Whether we have shadow.h]) + fi + ;; +esac +AC_CHECK_HEADERS(shadow.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h) +AC_CHECK_HEADERS(nss.h nss_common.h nsswitch.h ns_api.h sys/security.h security/pam_appl.h) +AC_CHECK_HEADERS(stropts.h poll.h) +AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h) +AC_CHECK_HEADERS(sys/acl.h sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h) +AC_CHECK_HEADERS(sys/cdefs.h glob.h) + +AC_CHECK_HEADERS(netinet/ip.h,,,[[ +#include +#if HAVE_SYS_SOCKET_H +#include +#endif +#include +#if HAVE_NETINET_IN_SYSTM_H +#include +#endif +]]) + +AC_CHECK_HEADERS(net/if.h,,,[[ +#include +#if HAVE_SYS_SOCKET_H +#include +#endif +]]) + +AC_CHECK_HEADERS(security/pam_modules.h,,,[[ +#if HAVE_SECURITY_PAM_APPL_H +#include +#endif +]]) + +# For experimental utmp support (lastlog on some BSD-like systems) +AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h) + +AC_CHECK_SIZEOF(int,cross) +AC_CHECK_SIZEOF(long,cross) +AC_CHECK_SIZEOF(short,cross) + +AC_C_CONST +AC_C_INLINE +AC_C_BIGENDIAN +AC_C_CHAR_UNSIGNED + +AC_TYPE_SIGNAL +AC_TYPE_UID_T +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_SIZE_T +AC_TYPE_PID_T +AC_STRUCT_ST_RDEV +AC_DIRENT_D_OFF +AC_CHECK_TYPE(ino_t,unsigned) +AC_CHECK_TYPE(loff_t,off_t) +AC_CHECK_TYPE(offset_t,loff_t) +AC_CHECK_TYPE(ssize_t, int) +AC_CHECK_TYPE(wchar_t, unsigned short) + +############################################ +# for cups support we need libcups, and a handful of header files + +AC_ARG_ENABLE(cups, +[ --enable-cups Turn on CUPS support (default=auto)]) + +if test x$enable_cups != xno; then + AC_PATH_PROG(CUPS_CONFIG, cups-config) + + if test "x$CUPS_CONFIG" != x; then + AC_DEFINE(HAVE_CUPS,1,[Whether we have CUPS]) + CFLAGS="$CFLAGS `$CUPS_CONFIG --cflags`" + LDFLAGS="$LDFLAGS `$CUPS_CONFIG --ldflags`" + PRINT_LIBS="$PRINT_LIBS `$CUPS_CONFIG --libs`" + elif test x"$enable_cups" = x"yes"; then + AC_MSG_ERROR(Cups support required but cups-config not located. Make sure cups-devel related files are installed.) + fi +fi + +############################################ +# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code +AC_SEARCH_LIBS(dlopen, [dl]) +# dlopen/dlclose/dlsym/dlerror will be checked again later and defines will be set then + +############################################ +# check if the compiler can do immediate structures +AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [ + AC_TRY_COMPILE([ +#include ], +[ + typedef struct {unsigned x;} FOOBAR; + #define X_FOOBAR(x) ((FOOBAR) { x }) + #define FOO_ONE X_FOOBAR(1) + FOOBAR f = FOO_ONE; + static struct { + FOOBAR y; + } f2[] = { + {FOO_ONE} + }; +], + samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)]) +if test x"$samba_cv_immediate_structures" = x"yes"; then + AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures]) +fi + +############################################ +# check if the compiler can do immediate structures +AC_CACHE_CHECK([if the compiler will optimize out function calls],samba_cv_optimize_out_funcation_calls, [ + AC_TRY_LINK([ +#include ], +[ + if (0) { + this_function_does_not_exist(); + } else { + return 1; + } + +], + samba_cv_optimize_out_funcation_calls=yes,samba_cv_optimize_out_funcation_calls=no)]) +if test x"$samba_cv_optimize_out_funcation_calls" = x"yes"; then + AC_DEFINE(HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS,1,[Whether the compiler will optimize out function calls]) +fi + +############################################ +# check for unix domain sockets +AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [ + AC_TRY_COMPILE([ +#include +#include +#include +#include +#include ], +[ + struct sockaddr_un sunaddr; + sunaddr.sun_family = AF_UNIX; +], + samba_cv_unixsocket=yes,samba_cv_unixsocket=no)]) +if test x"$samba_cv_unixsocket" = x"yes"; then + AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support]) +fi + + +AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [ + AC_TRY_COMPILE([ +#include +#if STDC_HEADERS +#include +#include +#endif +#include ],[socklen_t i = 0], + samba_cv_socklen_t=yes,samba_cv_socklen_t=no)]) +if test x"$samba_cv_socklen_t" = x"yes"; then + AC_DEFINE(HAVE_SOCKLEN_T_TYPE,1,[Whether we have the variable type socklen_t]) +fi + +AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [ + AC_TRY_COMPILE([ +#include +#if STDC_HEADERS +#include +#include +#endif +#include ],[sig_atomic_t i = 0], + samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)]) +if test x"$samba_cv_sig_atomic_t" = x"yes"; then + AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type]) +fi + +AC_CACHE_CHECK([for struct timespec type],samba_cv_struct_timespec, [ + AC_TRY_COMPILE([ +#include +#if STDC_HEADERS +#include +#include +#endif +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif +#if HAVE_AIO_H +#include +#endif +],[struct timespec ts;], + samba_cv_struct_timespec=yes,samba_cv_struct_timespec=no)]) +if test x"$samba_cv_struct_timespec" = x"yes"; then + AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec]) +fi + +# stupid headers have the functions but no declaration. grrrr. +AC_HAVE_DECL(errno, [#include ]) +AC_HAVE_DECL(setresuid, [#include ]) +AC_HAVE_DECL(setresgid, [#include ]) +AC_HAVE_DECL(asprintf, [#include ]) +AC_HAVE_DECL(vasprintf, [#include ]) +AC_HAVE_DECL(vsnprintf, [#include ]) +AC_HAVE_DECL(snprintf, [#include ]) + +# and glibc has setresuid under linux but the function does +# nothing until kernel 2.1.44! very dumb. +AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[ + AC_TRY_RUN([#include +main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}], + samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)]) +if test x"$samba_cv_have_setresuid" = x"yes"; then + AC_DEFINE(HAVE_SETRESUID,1,[Whether the system has setresuid]) +fi + +# Do the same check for setresguid... +# +AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[ + AC_TRY_RUN([#include +#include +main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}], + samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)]) +if test x"$samba_cv_have_setresgid" = x"yes"; then + AC_DEFINE(HAVE_SETRESGID,1,[Whether the system has setresgid]) +fi + +AC_FUNC_MEMCMP + +############################################### +# Readline included by default unless explicitly asked not to +test "${with_readline+set}" != "set" && with_readline=yes + +# test for where we get readline() from +AC_MSG_CHECKING(whether to use readline) +AC_ARG_WITH(readline, +[ --with-readline[=DIR] Look for readline include/libs in DIR (default=auto) ], +[ case "$with_readline" in + yes) + AC_MSG_RESULT(yes) + + AC_CHECK_HEADERS(readline.h history.h readline/readline.h) + AC_CHECK_HEADERS(readline/history.h) + + AC_CHECK_HEADERS(readline.h readline/readline.h,[ + for termlib in ncurses curses termcap terminfo termlib tinfo; do + AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break]) + done + AC_CHECK_LIB(readline, rl_callback_handler_install, + [TERMLIBS="-lreadline $TERMLIBS" + AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline]) + break], [TERMLIBS=], $TERMLIBS)]) + ;; + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(yes) + + # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at + # alternate readline path + _ldflags=${LDFLAGS} + _cppflags=${CPPFLAGS} + + # Add additional search path + LDFLAGS="-L$with_readline/lib $LDFLAGS" + CPPFLAGS="-I$with_readline/include $CPPFLAGS" + + AC_CHECK_HEADERS(readline.h history.h readline/readline.h) + AC_CHECK_HEADERS(readline/history.h) + + AC_CHECK_HEADERS(readline.h readline/readline.h,[ + for termlib in ncurses curses termcap terminfo termlib; do + AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break]) + done + AC_CHECK_LIB(readline, rl_callback_handler_install, + [TERMLDFLAGS="-L$with_readline/lib" + TERMCPPFLAGS="-I$with_readline/include" + CPPFLAGS="-I$with_readline/include $CPPFLAGS" + TERMLIBS="-lreadline $TERMLIBS" + AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline]) + break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)]) + + LDFLAGS=$_ldflags + ;; + esac], + AC_MSG_RESULT(no) +) +AC_SUBST(TERMLIBS) +AC_SUBST(TERMLDFLAGS) + +# The readline API changed slightly from readline3 to readline4, so +# code will generate warnings on one of them unless we have a few +# special cases. +AC_CHECK_LIB(readline, rl_completion_matches, + [AC_DEFINE(HAVE_NEW_LIBREADLINE, 1, + [Do we have rl_completion_matches?])], + [], + [$TERMLIBS]) + +# The following test taken from the cvs sources +# If we can't find connect, try looking in -lsocket, -lnsl, and -linet. +# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has +# libsocket.so which has a bad implementation of gethostbyname (it +# only looks in /etc/hosts), so we only look for -lsocket if we need +# it. +AC_CHECK_FUNCS(connect) +if test x"$ac_cv_func_connect" = x"no"; then + case "$LIBS" in + *-lnsl*) ;; + *) AC_CHECK_LIB(nsl_s, printf) ;; + esac + case "$LIBS" in + *-lnsl*) ;; + *) AC_CHECK_LIB(nsl, printf) ;; + esac + case "$LIBS" in + *-lsocket*) ;; + *) AC_CHECK_LIB(socket, connect) ;; + esac + case "$LIBS" in + *-linet*) ;; + *) AC_CHECK_LIB(inet, connect) ;; + esac + dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value + dnl has been cached. + if test x"$ac_cv_lib_socket_connect" = x"yes" || + test x"$ac_cv_lib_inet_connect" = x"yes"; then + # ac_cv_func_connect=yes + # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run + AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()]) + fi +fi + +############################################### +# test for where we get yp_get_default_domain() from +AC_SEARCH_LIBS(yp_get_default_domain, [nsl]) +AC_CHECK_FUNCS(yp_get_default_domain) + +# Check if we have execl, if not we need to compile smbrun. +AC_CHECK_FUNCS(execl) +if test x"$ac_cv_func_execl" = x"no"; then + EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun\$(EXEEXT)" +fi + +AC_CHECK_FUNCS(dlopen dlclose dlsym dlerror waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64) +AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync memset strlcpy strlcat setpgid) +AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid) +AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent) +AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf realpath) +AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate chsize stat64 fstat64) +AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64) +AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf) +AC_CHECK_FUNCS(opendir64 readdir64 seekdir64 telldir64 rewinddir64 closedir64) +AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink) +AC_CHECK_FUNCS(syslog vsyslog timegm) +AC_CHECK_FUNCS(setlocale nl_langinfo) +AC_CHECK_FUNCS(nanosleep) +# setbuffer, shmget, shm_open are needed for smbtorture +AC_CHECK_FUNCS(setbuffer shmget shm_open backtrace_symbols) +AC_CHECK_HEADERS(libexc.h) +AC_CHECK_LIB(exc, trace_back_stack) + +# syscall() is needed for smbwrapper. +AC_CHECK_FUNCS(syscall) + +AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir) +AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir) +AC_CHECK_FUNCS(__getcwd _getcwd) +AC_CHECK_FUNCS(__xstat __fxstat __lxstat) +AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat) +AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir) +AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl) +AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read) +AC_CHECK_FUNCS(getdirentries _write __write _fork __fork) +AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64) +AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64) +AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64) +AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64) +AC_CHECK_FUNCS(open64 _open64 __open64 creat64) +AC_CHECK_FUNCS(prctl) + +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_PRCTL_H +#include +#endif +], +[int i; i = prtcl(0); ], +AC_DEFINE(HAVE_PRCTL, 1, [Whether prctl is available]),[]) + +# +# +# +case "$host_os" in + *linux*) + # glibc <= 2.3.2 has a broken getgrouplist + AC_TRY_RUN([ +#include +#include +main() { + /* glibc up to 2.3 has a broken getgrouplist */ +#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) + int libc_major = __GLIBC__; + int libc_minor = __GLIBC_MINOR__; + + if (libc_major < 2) + exit(1); + if ((libc_major == 2) && (libc_minor <= 3)) + exit(1); +#endif + exit(0); +} +], [linux_getgrouplist_ok=yes], [linux_getgrouplist_ok=no]) + if test x"$linux_getgrouplist_ok" = x"yes"; then + AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist]) + fi + ;; + *) + AC_CHECK_FUNCS(getgrouplist) + ;; +esac + +# +# stat64 family may need on some systems, notably ReliantUNIX +# + +if test x$ac_cv_func_stat64 = xno ; then + AC_MSG_CHECKING([for stat64 in ]) + AC_TRY_LINK([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes]) + AC_MSG_RESULT([$ac_cv_func_stat64]) + if test x$ac_cv_func_stat64 = xyes ; then + AC_DEFINE(HAVE_STAT64,1,[Whether stat64() is available]) + fi +fi + +if test x$ac_cv_func_lstat64 = xno ; then + AC_MSG_CHECKING([for lstat64 in ]) + AC_TRY_LINK([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes]) + AC_MSG_RESULT([$ac_cv_func_lstat64]) + if test x$ac_cv_func_lstat64 = xyes ; then + AC_DEFINE(HAVE_LSTAT64,[Whether lstat64() is available]) + fi +fi + +if test x$ac_cv_func_fstat64 = xno ; then + AC_MSG_CHECKING([for fstat64 in ]) + AC_TRY_LINK([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes]) + AC_MSG_RESULT([$ac_cv_func_fstat64]) + if test x$ac_cv_func_fstat64 = xyes ; then + AC_DEFINE(HAVE_FSTAT64,1,[Whether fstat64() is available]) + fi +fi + +################################################# +# Check whether struct stat has timestamps with sub-second resolution. +# At least IRIX and Solaris have these. +# +# We check that +# all of st_mtim, st_atim and st_ctim exist +# all of the members are in fact of type struct timespec +# +# There is some conflicting standards weirdness about whether we should use +# "struct timespec" or "timespec_t". Linux doesn't have timespec_t, so we +# prefer struct timespec. + +AC_CACHE_CHECK([whether struct stat has sub-second timestamps], samba_stat_hires, + [ + AC_TRY_COMPILE( + [ +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif + ], + [ + struct timespec t; + struct stat s = {0}; + t.tv_sec = s.st_mtim.tv_sec; + t.tv_nsec = s.st_mtim.tv_nsec; + t.tv_sec = s.st_ctim.tv_sec; + t.tv_nsec = s.st_ctim.tv_nsec; + t.tv_sec = s.st_atim.tv_sec; + t.tv_nsec = s.st_atim.tv_nsec; + ], + samba_stat_hires=yes, samba_stat_hires=no) + ]) + +if test x"$samba_stat_hires" = x"yes" ; then + AC_DEFINE(HAVE_STAT_ST_MTIM, 1, [whether struct stat contains st_mtim]) + AC_DEFINE(HAVE_STAT_ST_ATIM, 1, [whether struct stat contains st_atim]) + AC_DEFINE(HAVE_STAT_ST_CTIM, 1, [whether struct stat contains st_ctim]) + AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1, + [whether struct stat has sub-second timestamps]) +fi + +##################################### +# we might need the resolv library on some systems +AC_CHECK_LIB(resolv, dn_expand) + +# +# Check for the functions putprpwnam, set_auth_parameters, +# getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity +# Needed for OSF1 and HPUX. +# + +AC_LIBTESTFUNC(security, putprpwnam) +AC_LIBTESTFUNC(sec, putprpwnam) + +AC_LIBTESTFUNC(security, set_auth_parameters) +AC_LIBTESTFUNC(sec, set_auth_parameters) + +# UnixWare 7.x has its getspnam in -lgen +AC_LIBTESTFUNC(gen, getspnam) + +AC_LIBTESTFUNC(security, getspnam) +AC_LIBTESTFUNC(sec, getspnam) + +AC_LIBTESTFUNC(security, bigcrypt) +AC_LIBTESTFUNC(sec, bigcrypt) + +AC_LIBTESTFUNC(security, getprpwnam) +AC_LIBTESTFUNC(sec, getprpwnam) + +############################################ +# Check if we have libattr +AC_SEARCH_LIBS(getxattr, [attr]) +AC_CHECK_FUNCS(getxattr lgetxattr fgetxattr listxattr llistxattr) +AC_CHECK_FUNCS(flistxattr removexattr lremovexattr fremovexattr) +AC_CHECK_FUNCS(setxattr lsetxattr fsetxattr) +AC_CHECK_FUNCS(attr_get attr_list attr_set attr_remove) +AC_CHECK_FUNCS(attr_getf attr_listf attr_setf attr_removef) +# Check if we have extattr +case "$host_os" in + *freebsd4* | *dragonfly* ) + AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work]) + ;; + *) + AC_CHECK_FUNCS(extattr_delete_fd extattr_delete_file extattr_delete_link) + AC_CHECK_FUNCS(extattr_get_fd extattr_get_file extattr_get_link) + AC_CHECK_FUNCS(extattr_list_fd extattr_list_file extattr_list_link) + AC_CHECK_FUNCS(extattr_set_fd extattr_set_file extattr_set_link) + ;; +esac + +# Assume non-shared by default and override below +BLDSHARED="false" + +# these are the defaults, good for lots of systems +HOST_OS="$host_os" +LDSHFLAGS="-shared" +SONAMEFLAG="#" +SHLD="\${CC} \${CFLAGS}" +PICFLAGS="" +PICSUFFIX="po" +SHLIBEXT="so" + +if test "$enable_shared" = "yes"; then + # this bit needs to be modified for each OS that is suported by + # smbwrapper. You need to specify how to create a shared library and + # how to compile C code to produce PIC object files + + AC_MSG_CHECKING([ability to build shared libraries]) + + # and these are for particular systems + case "$host_os" in + *linux*) AC_DEFINE(LINUX,1,[Whether the host os is linux]) + BLDSHARED="true" + if test "${ac_cv_gnu_ld_no_default_allow_shlib_undefined}" = "yes"; then + LDSHFLAGS="-shared -Wl,-Bsymbolic -Wl,--allow-shlib-undefined" + else + LDSHFLAGS="-shared -Wl,-Bsymbolic" + fi + DYNEXP="-Wl,--export-dynamic" + PICFLAGS="-fPIC" + SONAMEFLAG="-Wl,-soname=" + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *solaris*) AC_DEFINE(SUNOS5,1,[Whether the host os is solaris]) + BLDSHARED="true" + LDSHFLAGS="-G" + SONAMEFLAG="-h " + if test "${GCC}" = "yes"; then + PICFLAGS="-fPIC" + if test "${ac_cv_prog_gnu_ld}" = "yes"; then + DYNEXP="-Wl,-E" + fi + else + PICFLAGS="-KPIC" + ## ${CFLAGS} added for building 64-bit shared + ## libs using Sun's Compiler + LDSHFLAGS="-G \${CFLAGS}" + PICSUFFIX="po.o" + fi + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) + AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) + ;; + *sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4]) + BLDSHARED="true" + LDSHFLAGS="-G" + SONAMEFLAG="-Wl,-h," + PICFLAGS="-KPIC" # Is this correct for SunOS + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) + ;; + *netbsd* | *freebsd* | *dragonfly* ) + BLDSHARED="true" + LDSHFLAGS="-shared" + DYNEXP="-Wl,--export-dynamic" + SONAMEFLAG="-Wl,-soname," + PICFLAGS="-fPIC -DPIC" + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) + AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) + ;; + *openbsd*) BLDSHARED="true" + LDSHFLAGS="-shared" + DYNEXP="-Wl,-Bdynamic" + SONAMEFLAG="-Wl,-soname," + PICFLAGS="-fPIC" + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) + AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) + ;; + *irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix]) + case "$host_os" in + *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6]) + ;; + esac + BLDSHARED="true" + LDSHFLAGS="-set_version sgi1.0 -shared" + SONAMEFLAG="-soname " + SHLD="\${LD}" + if test "${GCC}" = "yes"; then + PICFLAGS="-fPIC" + else + PICFLAGS="-KPIC" + fi + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) + ;; + *aix*) AC_DEFINE(AIX,1,[Whether the host os is aix]) + BLDSHARED="true" + LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry,-berok" + DYNEXP="-Wl,-brtl,-bexpall" + PICFLAGS="-O2" + if test "${GCC}" != "yes"; then + ## for funky AIX compiler using strncpy() + CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000" + fi + + AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE,[The size of a block]) + AC_DEFINE(BROKEN_STRNLEN,1,[Does strnlen work correctly]) + AC_DEFINE(BROKEN_STRNDUP,1,[Does strndup work correctly]) + ;; + *hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX]) + # Use special PIC flags for the native HP-UX compiler. + if test $ac_cv_prog_cc_Ae = yes; then + BLDSHARED="true" + SHLD="cc" + LDSHFLAGS="-b -Wl,-B,symbolic,-b,-z" + SONAMEFLAG="-Wl,+h " + PICFLAGS="+z" + elif test "${GCC}" = "yes"; then + PICFLAGS="-fPIC" + fi + if test "$host_cpu" = "ia64"; then + SHLIBEXT="so" + DYNEXP="-Wl,-E,+b /usr/local/lib/hpux32:/usr/lib/hpux32" + else + SHLIBEXT="sl" + DYNEXP="-Wl,-E,+b /usr/local/lib:/usr/lib" + fi + AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block]) + AC_DEFINE(POSIX_ACL_NEEDS_MASK,1,[Does a POSIX ACL need a mask element]) + ;; + *qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *osf*) AC_DEFINE(OSF1,1,[Whether the host os is osf1]) + BLDSHARED="true" + LDSHFLAGS="-shared" + SONAMEFLAG="-Wl,-soname," + PICFLAGS="-fPIC" + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly]) + ;; + *sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware]) + BLDSHARED="true" + LDSHFLAGS="-shared" + SONAMEFLAG="-Wl,-soname," + PICFLAGS="-KPIC" + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *next2*) AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *sysv4*) AC_DEFINE(SYSV,1,[Whether this is a system V system]) + case "$host" in + *-univel-*) if [ test "$GCC" != yes ]; then + AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available]) + fi + LDSHFLAGS="-G" + DYNEXP="-Bexport" + ;; + *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX,1,[Whether the host os is reliantunix]);; + esac + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + + *sysv5*) AC_DEFINE(SYSV,1,[Whether this is a system V system]) + if [ test "$GCC" != yes ]; then + AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available]) + fi + LDSHFLAGS="-G" + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + *vos*) AC_DEFINE(STAT_ST_BLOCKSIZE,4096) + BLDSHARED="false" + LDSHFLAGS="" + ;; + + *darwin*) AC_DEFINE(DARWINOS,1,[Whether the host os is Darwin/MacOSX]) + BLDSHARED="true" + LDSHFLAGS="-bundle -flat_namespace -undefined suppress" + SHLIBEXT="dylib" + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + + *) + AC_DEFINE(STAT_ST_BLOCKSIZE,512) + ;; + esac + AC_SUBST(DYNEXP) + AC_MSG_RESULT($BLDSHARED) + AC_MSG_CHECKING([linker flags for shared libraries]) + AC_MSG_RESULT([$LDSHFLAGS]) + AC_MSG_CHECKING([compiler flags for position-independent code]) + AC_MSG_RESULT([$PICFLAGS]) +fi + +####################################################### +# test whether building a shared library actually works +if test $BLDSHARED = true; then +AC_CACHE_CHECK([whether building shared libraries actually works], + [ac_cv_shlib_works],[ + # try building a trivial shared library + ac_cv_shlib_works=no + # The $SHLD and $LDSHFLAGS variables may contain references to other + # variables so they need to be eval'ed. + $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o \ + shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c && \ + `eval echo $SHLD` `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" \ + shlib.$PICSUFFIX && ac_cv_shlib_works=yes + rm -f "shlib.$SHLIBEXT" shlib.$PICSUFFIX +]) +if test $ac_cv_shlib_works = no; then + BLDSHARED=false +fi +fi + +################ + +AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[ +AC_TRY_RUN([#include +main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }], +samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)]) +if test x"$samba_cv_have_longlong" = x"yes"; then + AC_DEFINE(HAVE_LONGLONG,1,[Whether the host supports long long's]) +fi + +# +# Check if the compiler supports the LL prefix on long long integers. +# AIX needs this. + +AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [ + AC_TRY_COMPILE([#include ],[long long i = 0x8000000000LL], + samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)]) +if test x"$samba_cv_compiler_supports_ll" = x"yes"; then + AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Whether the compiler supports the LL prefix on long long integers]) +fi + + +AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[ +AC_TRY_RUN([#include +#include +main() { exit((sizeof(off_t) == 8) ? 0 : 1); }], +samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)]) +if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then + AC_DEFINE(SIZEOF_OFF_T,8,[The size of the 'off_t' type]) +fi + +AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[ +AC_TRY_RUN([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +#include +main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }], +samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)]) +if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then + AC_DEFINE(HAVE_OFF64_T,1,[Whether off64_t is available]) +fi + +AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[ +AC_TRY_RUN([#include +#include +main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }], +samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)]) +if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then + AC_DEFINE(SIZEOF_INO_T,8,[The size of the 'ino_t' type]) +fi + +AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[ +AC_TRY_RUN([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +#include +main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }], +samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)]) +if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then + AC_DEFINE(HAVE_INO64_T,1,[Whether the 'ino64_t' type is available]) +fi + +AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[ +AC_TRY_RUN([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +#include +main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }], +samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)]) +if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then + AC_DEFINE(HAVE_DEV64_T,1,[Whether the 'dev64_t' type is available]) +fi + +AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIR64,[ +AC_TRY_COMPILE([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +#include ], +[DIR64 de;], +samba_cv_HAVE_STRUCT_DIR64=yes,samba_cv_HAVE_STRUCT_DIR64=no)]) +if test x"$samba_cv_HAVE_STRUCT_DIR64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then + AC_DEFINE(HAVE_STRUCT_DIR64,1,[Whether the 'DIR64' abstract data type is available]) +fi + +AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[ +AC_TRY_COMPILE([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +#include ], +[struct dirent64 de;], +samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)]) +if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then + AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Whether the 'dirent64' struct is available]) +fi + +AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[ +AC_TRY_RUN([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +main() { dev_t dev; int i = major(dev); return 0; }], +samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)]) +if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then + AC_DEFINE(HAVE_DEVICE_MAJOR_FN,1,[Whether the major macro for dev_t is available]) +fi + +AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[ +AC_TRY_RUN([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +main() { dev_t dev; int i = minor(dev); return 0; }], +samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)]) +if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then + AC_DEFINE(HAVE_DEVICE_MINOR_FN,1,[Whether the minor macro for dev_t is available]) +fi + +AC_CACHE_CHECK([for makedev macro],samba_cv_HAVE_MAKEDEV,[ +AC_TRY_RUN([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +main() { dev_t dev = makedev(1,2); return 0; }], +samba_cv_HAVE_MAKEDEV=yes,samba_cv_HAVE_MAKEDEV=no,samba_cv_HAVE_MAKEDEV=cross)]) +if test x"$samba_cv_HAVE_MAKEDEV" = x"yes"; then + AC_DEFINE(HAVE_MAKEDEV,1,[Whether the macro for makedev is available]) +fi + +AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[ +AC_TRY_RUN([#include +main() { char c; c=250; exit((c > 0)?0:1); }], +samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)]) +if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then + AC_DEFINE(HAVE_UNSIGNED_CHAR,1,[Whether the 'unsigned char' type is available]) +fi + +AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[ +AC_TRY_COMPILE([#include +#include +#include ], +[struct sockaddr_in sock; sock.sin_len = sizeof(sock);], +samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)]) +if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then + AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property]) +fi + +AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[ +AC_TRY_COMPILE([#include +#include +void seekdir(DIR *d, long loc) { return; }],[return 0;], +samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)]) +if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then + AC_DEFINE(SEEKDIR_RETURNS_VOID,1,[Whether seekdir returns void]) +fi + +AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[ +AC_TRY_COMPILE([#include ], [printf("%s\n", __FUNCTION__);], +samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)]) +if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then + AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro]) +fi + +AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[ +AC_TRY_RUN([ +#include +#include +main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}], + samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)]) +if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then + AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available]) +fi + +AC_CACHE_CHECK([for va_copy],samba_cv_HAVE_VA_COPY,[ +AC_TRY_LINK([#include +va_list ap1,ap2;], [va_copy(ap1,ap2);], +samba_cv_HAVE_VA_COPY=yes, +samba_cv_HAVE_VA_COPY=no)]) +if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then + AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) +else + AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE___VA_COPY,[ + AC_TRY_LINK([#include + va_list ap1,ap2;], [__va_copy(ap1,ap2);], + samba_cv_HAVE___VA_COPY=yes, + samba_cv_HAVE___VA_COPY=no)]) + if test x"$samba_cv_HAVE___VA_COPY" = x"yes"; then + AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) + fi +fi + +AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[ +AC_TRY_RUN([ +#include +#include +void foo(const char *format, ...) { + va_list ap; + int len; + char buf[5]; + + va_start(ap, format); + len = vsnprintf(buf, 0, format, ap); + va_end(ap); + if (len != 5) exit(1); + + va_start(ap, format); + len = vsnprintf(0, 0, format, ap); + va_end(ap); + if (len != 5) exit(1); + + if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1); + + exit(0); +} +main() { foo("hello"); } +], +samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)]) +if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then + AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Whether there is a C99 compliant vsnprintf]) +fi + +AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[ +AC_TRY_RUN([#include +#include +main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d); +if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 && +di->d_name[0] == 0) exit(0); exit(1);} ], +samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)]) +if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then + AC_DEFINE(HAVE_BROKEN_READDIR,1,[Whether readdir() is broken]) +fi + +AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[ +AC_TRY_COMPILE([#include +#include ], +[struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));], +samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)]) +if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then + AC_DEFINE(HAVE_UTIMBUF,1,[Whether struct utimbuf is available]) +fi + +############## +# Check utmp details, but only if our OS offers utmp.h +if test x"$ac_cv_header_utmp_h" = x"yes"; then +dnl utmp and utmpx come in many flavours +dnl We need to check for many of them +dnl But we don't need to do each and every one, because our code uses +dnl mostly just the utmp (not utmpx) fields. + +AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx) + +AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[ +AC_TRY_COMPILE([#include +#include ], +[struct utmp ut; ut.ut_name[0] = 'a';], +samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)]) +if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then + AC_DEFINE(HAVE_UT_UT_NAME,1,[Whether the utmp struct has a property ut_name]) +fi + +AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[ +AC_TRY_COMPILE([#include +#include ], +[struct utmp ut; ut.ut_user[0] = 'a';], +samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)]) +if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then + AC_DEFINE(HAVE_UT_UT_USER,1,[Whether the utmp struct has a property ut_user]) +fi + +AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[ +AC_TRY_COMPILE([#include +#include ], +[struct utmp ut; ut.ut_id[0] = 'a';], +samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)]) +if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then + AC_DEFINE(HAVE_UT_UT_ID,1,[Whether the utmp struct has a property ut_id]) +fi + +AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[ +AC_TRY_COMPILE([#include +#include ], +[struct utmp ut; ut.ut_host[0] = 'a';], +samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)]) +if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then + AC_DEFINE(HAVE_UT_UT_HOST,1,[Whether the utmp struct has a property ut_host]) +fi + +AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[ +AC_TRY_COMPILE([#include +#include ], +[struct utmp ut; time_t t; ut.ut_time = t;], +samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)]) +if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then + AC_DEFINE(HAVE_UT_UT_TIME,1,[Whether the utmp struct has a property ut_time]) +fi + +AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[ +AC_TRY_COMPILE([#include +#include ], +[struct utmp ut; struct timeval tv; ut.ut_tv = tv;], +samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)]) +if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then + AC_DEFINE(HAVE_UT_UT_TV,1,[Whether the utmp struct has a property ut_tv]) +fi + +AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[ +AC_TRY_COMPILE([#include +#include ], +[struct utmp ut; ut.ut_type = 0;], +samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)]) +if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then + AC_DEFINE(HAVE_UT_UT_TYPE,1,[Whether the utmp struct has a property ut_type]) +fi + +AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[ +AC_TRY_COMPILE([#include +#include ], +[struct utmp ut; ut.ut_pid = 0;], +samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)]) +if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then + AC_DEFINE(HAVE_UT_UT_PID,1,[Whether the utmp struct has a property ut_pid]) +fi + +AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[ +AC_TRY_COMPILE([#include +#include ], +[struct utmp ut; ut.ut_exit.e_exit = 0;], +samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)]) +if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then + AC_DEFINE(HAVE_UT_UT_EXIT,1,[Whether the utmp struct has a property ut_exit]) +fi + +AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[ +AC_TRY_COMPILE([#include +#include ], +[struct utmp ut; ut.ut_addr = 0;], +samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)]) +if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then + AC_DEFINE(HAVE_UT_UT_ADDR,1,[Whether the utmp struct has a property ut_addr]) +fi + +if test x$ac_cv_func_pututline = xyes ; then + AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[ + AC_TRY_COMPILE([#include +#include ], + [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);], + samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)]) + if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then + AC_DEFINE(PUTUTLINE_RETURNS_UTMP,1,[Whether pututline returns pointer]) + fi +fi + +AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[ +AC_TRY_COMPILE([#include +#include ], +[struct utmpx ux; ux.ut_syslen = 0;], +samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)]) +if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then + AC_DEFINE(HAVE_UX_UT_SYSLEN,1,[Whether the utmpx struct has a property ut_syslen]) +fi + +fi +# end utmp details + + +ICONV_LOCATION=standard +LOOK_DIRS="/usr /usr/local /sw /opt" +AC_ARG_WITH(libiconv, +[ --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) ], +[ + if test "$withval" = "no" ; then + AC_MSG_ERROR([argument to --with-libiconv must be a directory]) + else + if test "$withval" != "yes" ; then + ICONV_PATH_SPEC=yes + LOOK_DIRS="$withval" + fi + fi +]) + +for i in $LOOK_DIRS ; do + save_LIBS=$LIBS + save_LDFLAGS=$LDFLAGS + save_CPPFLAGS=$CPPFLAGS + ICONV_FOUND="no" + unset libext + CPPFLAGS="$CPPFLAGS -I$i/include" +dnl This is here to handle -withval stuff for --with-libiconv +dnl Perhaps we should always add a -L + +dnl Check lib and lib32 library variants to cater for IRIX ABI-specific +dnl installation paths. This gets a little tricky since we might have iconv +dnl in both libiconv and in libc. In this case the jm_ICONV test will always +dnl succeed when the header is found. To counter this, make sure the +dnl library directory is there and check the ABI directory first (which +dnl should be harmless on other systems. +dnl For IA64 HPUX systems, the libs are located in lib/hpux32 instead of lib. + for l in "lib32" "lib" "lib/hpux32"; do + if test -d "$i/$l" ; then + LDFLAGS="$save_LDFLAGS -L$i/$l" + LIBS= + export LDFLAGS LIBS CPPFLAGS +dnl Try to find iconv(3) + jm_ICONV($i/$l) + if test x"$ICONV_FOUND" = "xyes" ; then + libext="$l" + break; + fi + fi + done + + if test x"$ICONV_FOUND" = "xyes" ; then + LDFLAGS=$save_LDFLAGS + LIB_ADD_DIR(LDFLAGS, "$i/$libext") + CFLAGS_ADD_DIR(CPPFLAGS, "$i/include") + LIBS="$save_LIBS" + ICONV_LOCATION=$i + export LDFLAGS LIBS CPPFLAGS +dnl Now, check for a working iconv ... we want to do it here because +dnl there might be a working iconv further down the list of LOOK_DIRS + + ############ + # check for iconv in libc + ic_save_LIBS="$LIBS" + if test x"$ICONV_PATH_SPEC" = "xyes" ; then + LIBS="$LIBS -L$ICONV_LOCATION/$libext" + fi + if test x"$jm_cv_lib_iconv" != x; then + LIBS="$LIBS -l$jm_cv_lib_iconv" + fi +dnl AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[ + default_dos_charset=no + default_display_charset=no + default_unix_charset=no + + # check for default dos charset name + for j in CP850 IBM850 ; do + rjs_CHARSET($j) + if test x"$ICONV_CHARSET" = x"$j"; then + default_dos_charset="\"$j\"" + break + fi + done + # check for default display charset name + for j in ASCII 646 ; do + rjs_CHARSET($j) + if test x"$ICONV_CHARSET" = x"$j"; then + default_display_charset="\"$j\"" + break + fi + done + # check for default unix charset name + for j in UTF-8 UTF8 ; do + rjs_CHARSET($j) + if test x"$ICONV_CHARSET" = x"$j"; then + default_unix_charset="\"$j\"" + break + fi + done + + if test "$default_dos_charset" != "no" -a \ + "$default_dos_charset" != "cross" -a \ + "$default_display_charset" != "no" -a \ + "$default_display_charset" != "cross" -a \ + "$default_unix_charset" != "no" -a \ + "$default_unix_charset" != "cross" + then + samba_cv_HAVE_NATIVE_ICONV=yes + else if test "$default_dos_charset" = "cross" -o \ + "$default_display_charset" = "cross" -o \ + "$default_unix_charset" = "cross" + then + samba_cv_HAVE_NATIVE_ICONV=cross + else + samba_cv_HAVE_NATIVE_ICONV=no + fi + fi +dnl ]) + + LIBS="$ic_save_LIBS" + if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + if test x"$jm_cv_lib_iconv" != x; then + LIBS="$LIBS -l$jm_cv_lib_iconv" + fi + dnl Add the flags we need to CPPFLAGS and LDFLAGS + CFLAGS_ADD_DIR(CPPFLAGS, "$i/include") + LIB_ADD_DIR(LDFLAGS, "$i/$libext") + export CPPFLAGS + AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv]) + AC_DEFINE_UNQUOTED(DEFAULT_DOS_CHARSET,$default_dos_charset,[Default dos charset name]) + AC_DEFINE_UNQUOTED(DEFAULT_DISPLAY_CHARSET,$default_display_charset,[Default display charset name]) + AC_DEFINE_UNQUOTED(DEFAULT_UNIX_CHARSET,$default_unix_charset,[Default unix charset name]) + break + fi +dnl We didn't find a working iconv, so keep going + fi +dnl We only need to clean these up here for the next pass through the loop + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + export LDFLAGS LIBS CPPFLAGS +done +unset libext + + +if test x"$ICONV_FOUND" = x"no" -o x"$samba_cv_HAVE_NATIVE_ICONV" != x"yes" ; then + AC_MSG_WARN([Sufficient support for iconv function was not found. + Install libiconv from http://freshmeat.net/projects/libiconv/ for better charset compatibility!]) + AC_DEFINE_UNQUOTED(DEFAULT_DOS_CHARSET,"ASCII",[Default dos charset name]) + AC_DEFINE_UNQUOTED(DEFAULT_DISPLAY_CHARSET,"ASCII",[Default display charset name]) + AC_DEFINE_UNQUOTED(DEFAULT_UNIX_CHARSET,"UTF8",[Default unix charset name]) +fi + + +AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[ +AC_TRY_RUN([ +#include +#include +#ifndef F_GETLEASE +#define F_GETLEASE 1025 +#endif +main() { + int fd = open("/dev/null", O_RDONLY); + return fcntl(fd, F_GETLEASE, 0) == -1; +} +], +samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)]) +if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then + AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX,1,[Whether to use linux kernel oplocks]) +fi + +AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[ +AC_TRY_RUN([ +#include +#include +#include +#ifndef F_NOTIFY +#define F_NOTIFY 1026 +#endif +main() { + exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ? 1 : 0); +} +], +samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)]) +if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then + AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY,1,[Whether kernel notifies changes]) +fi + +AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[ +AC_TRY_RUN([ +#include +#include +#include +#include +#ifndef LOCK_MAND +#define LOCK_MAND 32 +#define LOCK_READ 64 +#endif +main() { + exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0); +} +], +samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)]) +if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then + AC_DEFINE(HAVE_KERNEL_SHARE_MODES,1,[Whether the kernel supports share modes]) +fi + + + + +AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[ +AC_TRY_COMPILE([#include +#include ], +[oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;], +samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)]) +if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then + AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX,1,[Whether IRIX kernel oplock type definitions are available]) +fi + +AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[ +AC_TRY_RUN([#include +#include +main() { + cap_t cap; + if ((cap = cap_get_proc()) == NULL) + exit(1); + cap->cap_effective |= CAP_NETWORK_MGT; + cap->cap_inheritable |= CAP_NETWORK_MGT; + cap_set_proc(cap); + exit(0); +} +], +samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)]) +if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then + AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES,1,[Whether IRIX specific capabilities are available]) +fi + +# +# Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h +# This is *really* broken but some systems (DEC OSF1) do this.... JRA. +# + +AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[ +AC_TRY_COMPILE([#include +#if defined(HAVE_RPC_RPC_H) +#include +#endif], +[int16 testvar;], +samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)]) +if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then + AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H,1,[Whether int16 typedef is included by rpc/rpc.h]) +fi + +AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[ +AC_TRY_COMPILE([#include +#if defined(HAVE_RPC_RPC_H) +#include +#endif], +[uint16 testvar;], +samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)]) +if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then + AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H,1,[Whether uint16 typedef is included by rpc/rpc.h]) +fi + +AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[ +AC_TRY_COMPILE([#include +#if defined(HAVE_RPC_RPC_H) +#include +#endif], +[int32 testvar;], +samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)]) +if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then + AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H,1,[Whether int32 typedef is included by rpc/rpc.h]) +fi + +AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[ +AC_TRY_COMPILE([#include +#if defined(HAVE_RPC_RPC_H) +#include +#endif], +[uint32 testvar;], +samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)]) +if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then + AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H,1,[Whether uint32 typedef is included by rpc/rpc.h]) +fi + +dnl +dnl Some systems (SCO) have a problem including +dnl and due to AUTH_ERROR being defined +dnl as a #define in and as part of an enum +dnl in . +dnl + +AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[ +AC_TRY_COMPILE([#include +#ifdef HAVE_SYS_SECURITY_H +#include +#include +#endif /* HAVE_SYS_SECURITY_H */ +#if defined(HAVE_RPC_RPC_H) +#include +#endif], +[int testvar;], +samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)]) +if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then + AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT,1,[Whether there is a conflicting AUTH_ERROR define in rpc/rpc.h]) +fi + +AC_MSG_CHECKING([for test routines]) +AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"], + AC_MSG_RESULT(yes), + AC_MSG_ERROR([cant find test code. Aborting config]), + AC_MSG_WARN([cannot run when cross-compiling])) + +AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[ +AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"], + samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)]) +if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then + AC_DEFINE(HAVE_FTRUNCATE_EXTEND,1,[Truncate extend]) +fi + +AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [ +AC_TRY_RUN([#include "${srcdir-.}/tests/unixsock.c"], + samba_cv_HAVE_WORKING_AF_LOCAL=yes, + samba_cv_HAVE_WORKING_AF_LOCAL=no, + samba_cv_HAVE_WORKING_AF_LOCAL=cross)]) +if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno +then + AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets]) +fi + +AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[ +AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"], + samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)]) +if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then + AC_DEFINE(HAVE_BROKEN_GETGROUPS,1,[Whether getgroups is broken]) +fi + +AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[ +SAVE_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt" +AC_TRY_COMPILE([ +#define REPLACE_GETPASS 1 +#define NO_PROTO_H 1 +#define NO_CONFIG_H 1 +#define main dont_declare_main +#include "${srcdir-.}/lib/getsmbpass.c" +#undef main +],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no) +CPPFLAGS="$SAVE_CPPFLAGS" +]) +if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then + AC_DEFINE(REPLACE_GETPASS,1,[Whether getpass should be replaced]) +fi + +AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[ +AC_TRY_RUN([ +#include +#include +#include +#ifdef HAVE_ARPA_INET_H +#include +#endif +main() { struct in_addr ip; ip.s_addr = 0x12345678; +if (strcmp(inet_ntoa(ip),"18.52.86.120") && + strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } +exit(1);}], + samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)]) +if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then + AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced]) +fi + +AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[ +AC_TRY_RUN([#include +#include +#include +#include +main() { + struct stat st; + char tpl[20]="/tmp/test.XXXXXX"; + int fd = mkstemp(tpl); + if (fd == -1) exit(1); + unlink(tpl); + if (fstat(fd, &st) != 0) exit(1); + if ((st.st_mode & 0777) != 0600) exit(1); + exit(0); +}], +samba_cv_HAVE_SECURE_MKSTEMP=yes, +samba_cv_HAVE_SECURE_MKSTEMP=no, +samba_cv_HAVE_SECURE_MKSTEMP=cross)]) +if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then + AC_DEFINE(HAVE_SECURE_MKSTEMP,1,[Whether mkstemp is secure]) +fi + +AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[ +AC_TRY_RUN([#include +main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }], +samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)]) +if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then + AC_DEFINE(SYSCONF_SC_NGROUPS_MAX,1,[Whether sysconf(_SC_NGROUPS_MAX) is available]) +fi + +AC_CACHE_CHECK([for sysconf(_SC_NPROC_ONLN)],samba_cv_SYSCONF_SC_NPROC_ONLN,[ +AC_TRY_RUN([#include +main() { exit(sysconf(_SC_NPROC_ONLN) == -1 ? 1 : 0); }], +samba_cv_SYSCONF_SC_NPROC_ONLN=yes,samba_cv_SYSCONF_SC_NPROC_ONLN=no,samba_cv_SYSCONF_SC_NPROC_ONLN=cross)]) +if test x"$samba_cv_SYSCONF_SC_NPROC_ONLN" = x"yes"; then + AC_DEFINE(SYSCONF_SC_NPROC_ONLN,1,[Whether sysconf(_SC_NPROC_ONLN) is available]) +fi + +AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[ +AC_TRY_RUN([main() { exit(getuid() != 0); }], + samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)]) +if test x"$samba_cv_HAVE_ROOT" = x"yes"; then + AC_DEFINE(HAVE_ROOT,1,[Whether current user is root]) +else + AC_MSG_WARN(running as non-root will disable some tests) +fi + +################## +# look for a method of finding the list of network interfaces +iface=no; +AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[ +AC_TRY_RUN([ +#define HAVE_IFACE_AIX 1 +#define AUTOCONF_TEST 1 +#include "confdefs.h" +#include "${srcdir-.}/lib/interfaces.c"], + samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)]) +if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then + iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available]) +fi + +if test $iface = no; then +AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[ +AC_TRY_RUN([ +#define HAVE_IFACE_IFCONF 1 +#define AUTOCONF_TEST 1 +#include "confdefs.h" +#include "${srcdir-.}/lib/interfaces.c"], + samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)]) +if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then + iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available]) +fi +fi + +if test $iface = no; then +AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[ +AC_TRY_RUN([ +#define HAVE_IFACE_IFREQ 1 +#define AUTOCONF_TEST 1 +#include "confdefs.h" +#include "${srcdir-.}/lib/interfaces.c"], + samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)]) +if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then + iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available]) +fi +fi + + +################################################ +# look for a method of setting the effective uid +seteuid=no; +if test $seteuid = no; then +AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[ +AC_TRY_RUN([ +#define AUTOCONF_TEST 1 +#define USE_SETRESUID 1 +#include "confdefs.h" +#include "${srcdir-.}/lib/util_sec.c"], + samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)]) +if test x"$samba_cv_USE_SETRESUID" = x"yes"; then + seteuid=yes;AC_DEFINE(USE_SETRESUID,1,[Whether setresuid() is available]) +fi +fi + + +if test $seteuid = no; then +AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[ +AC_TRY_RUN([ +#define AUTOCONF_TEST 1 +#define USE_SETREUID 1 +#include "confdefs.h" +#include "${srcdir-.}/lib/util_sec.c"], + samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)]) +if test x"$samba_cv_USE_SETREUID" = x"yes"; then + seteuid=yes;AC_DEFINE(USE_SETREUID,1,[Whether setreuid() is available]) +fi +fi + +if test $seteuid = no; then +AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[ +AC_TRY_RUN([ +#define AUTOCONF_TEST 1 +#define USE_SETEUID 1 +#include "confdefs.h" +#include "${srcdir-.}/lib/util_sec.c"], + samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)]) +if test x"$samba_cv_USE_SETEUID" = x"yes"; then + seteuid=yes;AC_DEFINE(USE_SETEUID,1,[Whether seteuid() is available]) +fi +fi + +if test $seteuid = no; then +AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[ +AC_TRY_RUN([ +#define AUTOCONF_TEST 1 +#define USE_SETUIDX 1 +#include "confdefs.h" +#include "${srcdir-.}/lib/util_sec.c"], + samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)]) +if test x"$samba_cv_USE_SETUIDX" = x"yes"; then + seteuid=yes;AC_DEFINE(USE_SETUIDX,1,[Whether setuidx() is available]) +fi +fi + + +AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[ +AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"], + samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)]) +if test x"$samba_cv_HAVE_MMAP" = x"yes"; then + AC_DEFINE(HAVE_MMAP,1,[Whether mmap works]) +fi + +AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[ +AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"], + samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)]) +if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then + AC_DEFINE(HAVE_FCNTL_LOCK,1,[Whether fcntl locking is available]) +fi + +AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[ +AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"], + samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)]) +if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then + AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS,1,[Whether fcntl64 locks are broken]) + +else + +dnl +dnl Don't check for 64 bit fcntl locking if we know that the +dnl glibc2.1 broken check has succeeded. +dnl + + AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[ + AC_TRY_RUN([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +#include + +#ifdef HAVE_FCNTL_H +#include +#endif + +#ifdef HAVE_SYS_FCNTL_H +#include +#endif +main() { struct flock64 fl64; +#if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64) +exit(0); +#else +exit(1); +#endif +}], + samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)]) + + if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then + AC_DEFINE(HAVE_STRUCT_FLOCK64,1,[Whether the flock64 struct is available]) + fi +fi + +AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[ +AC_TRY_COMPILE([#include +#include +#include ], +[struct stat st; st.st_blocks = 0;], +samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)]) +if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then + AC_DEFINE(HAVE_STAT_ST_BLOCKS,1,[Whether the stat struct has a st_block property]) +fi + +AC_CACHE_CHECK([for st_blksize in struct stat],samba_cv_HAVE_STAT_ST_BLKSIZE,[ +AC_TRY_COMPILE([#include +#include +#include ], +[struct stat st; st.st_blksize = 0;], +samba_cv_HAVE_STAT_ST_BLKSIZE=yes,samba_cv_HAVE_STAT_ST_BLKSIZE=no,samba_cv_HAVE_STAT_ST_BLKSIZE=cross)]) +if test x"$samba_cv_HAVE_STAT_ST_BLKSIZE" = x"yes"; then + AC_DEFINE(HAVE_STAT_ST_BLKSIZE,1,[Whether the stat struct has a st_blksize property]) +fi + +case "$host_os" in +*linux*) +AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_VFS_H +#include +#endif +#ifdef HAVE_SYS_CAPABILITY_H +#include +#endif +],[int i;], + samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)]) +if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then + AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS,1,[Broken RedHat 7.2 system header files]) +fi +;; +esac + +AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[ +AC_TRY_COMPILE([ +#include +#include +#if defined(HAVE_RPCSVC_NIS_H) +#include +#endif], +[int i;], +samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)]) +if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then + AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES,1,[Whether the nisplus include files are broken]) +fi + +AC_CACHE_CHECK([if the realpath function allows a NULL argument],samba_cv_REALPATH_TAKES_NULL,[ +AC_TRY_RUN([ +#include +#include +main() { + char *newpath = realpath("/tmp", NULL); + exit ((newpath != NULL) ? 0 : 1); +} +], +samba_cv_REALPATH_TAKES_NULL=yes,samba_cv_REALPATH_TAKES_NULL=no,samba_cv_REALPATH_TAKES_NULL=cross)]) +if test x"$samba_cv_REALPATH_TAKES_NULL" = x"yes"; then + AC_DEFINE(REALPATH_TAKES_NULL,1,[Whether the realpath function allows NULL]) +fi + +################################################# +# check for smbwrapper support +AC_MSG_CHECKING(whether to use smbwrapper) +AC_ARG_WITH(smbwrapper, +[ --with-smbwrapper Include SMB wrapper support (default=no) ], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_SMBWRAPPER,1,[Whether to include smbwrapper support]) + WRAPPROG="bin/smbsh\$(EXEEXT)" + WRAP="bin/smbwrapper.$SHLIBEXT" + WRAP_OBJS="\$(SMBW_OBJ1) \$(SMBWRAPPER_OBJ1)" + WRAP_INC="-I\$(srcdir)/smbwrapper" + +# Conditions under which smbwrapper should not be built. + + if test x$PICFLAGS = x; then + echo No support for PIC code - disabling smbwrapper and smbsh + WRAPPROG="" + WRAP="" + WRAP_OBJS="" + WRAP_INC="" + elif test x$ac_cv_func_syscall = xno; then + AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh]) + WRAPPROG="" + WRAP="" + WRAP_OBJS="" + WRAP_INC="" + fi + EXTRA_ALL_TARGETS="$EXTRA_ALL_TARGETS $WRAPPROG $WRAP" + SMBWRAPPER="$WRAPPROG $WRAP" + SMBWRAP_OBJS="$WRAP_OBJS" + SMBWRAP_INC="$WRAP_INC" + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +################################################# +# check for AFS clear-text auth support +samba_cv_WITH_AFS=no +AC_MSG_CHECKING(whether to use AFS clear-text auth) +AC_ARG_WITH(afs, +[ --with-afs Include AFS clear-text auth support (default=no) ], +[ case "$withval" in + yes|auto) + AC_MSG_RESULT($withval) + samba_cv_WITH_AFS=$withval + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +#################################################### +# check for Linux-specific AFS fake-kaserver support +samba_cv_WITH_FAKE_KASERVER=no +AC_MSG_CHECKING(whether to use AFS fake-kaserver) +AC_ARG_WITH(fake-kaserver, +[ --with-fake-kaserver Include AFS fake-kaserver support (default=no) ], +[ case "$withval" in + yes|auto) + AC_MSG_RESULT($withval) + samba_cv_WITH_FAKE_KASERVER=$withval + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +################################################# +# decide whether we can support WITH_AFS and / or WITH_FAKE_KASERVER +if test x"$samba_cv_WITH_AFS" != x"no" || + test x"$samba_cv_WITH_FAKE_KASERVER" != x"no"; then + + # see if this box has the afs-headers in /usr/include/afs + AC_MSG_CHECKING(for /usr/include/afs) + if test -d /usr/include/afs; then + CFLAGS="$CFLAGS -I/usr/include/afs" + CPPFLAGS="$CPPFLAGS -I/usr/include/afs" + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + + # check for afs.h + have_afs_headers=no + AC_CHECK_HEADERS(afs.h afs/afs.h) + if test x"$ac_cv_header_afs_h" = x"no" && test x"$ac_cv_header_afs_afs_h" = x"no"; then + if test x"$samba_cv_WITH_FAKE_KASERVER" = x"auto" || + test x"$samba_cv_WITH_AFS" = x"auto"; then + AC_MSG_WARN([AFS cannot be supported without afs.h]) + else + AC_MSG_ERROR([AFS cannot be supported without afs.h]) + fi + else + have_afs_headers=yes + fi +fi + +if test x"$samba_cv_WITH_FAKE_KASERVER" != x"no" && test x"$have_afs_headers" = x"yes"; then + AC_DEFINE(WITH_FAKE_KASERVER,1,[Whether to include AFS fake-kaserver support]) +fi + +################################################# +# check whether to compile AFS/NT ACL mapping module +samba_cv_WITH_VFS_AFSACL=no +AC_MSG_CHECKING(whether to use AFS fake-kaserver) +AC_ARG_WITH(vfs-afsacl, +[ --with-vfs-afsacl Include AFS to NT ACL mapping module (default=no) ], +[ case "$withval" in + yes|auto) + AC_MSG_RESULT($withval) + samba_cv_WITH_VFS_AFSACL=yes + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +if test x"$samba_cv_WITH_VFS_AFSACL" = x"yes"; then + default_shared_modules="$default_shared_modules vfs_afsacl" +fi + +if test x"$samba_cv_WITH_AFS" != x"no" && test x"$have_afs_headers" = x"yes"; then + AC_DEFINE(WITH_AFS,1,[Whether to include AFS clear-text auth support]) +fi + +################################################# +# check for the DFS clear-text auth system +AC_MSG_CHECKING(whether to use DFS clear-text auth) +AC_ARG_WITH(dfs, +[ --with-dce-dfs Include DCE/DFS clear-text auth support (default=no)], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_DFS,1,[Whether to include DFS support]) + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +######################################################## +# Compile with LDAP support? + +with_ldap_support=auto +AC_MSG_CHECKING([for LDAP support]) + +AC_ARG_WITH(ldap, +[ --with-ldap LDAP support (default yes)], +[ case "$withval" in + yes|no) + with_ldap_support=$withval + ;; + esac ]) + +AC_MSG_RESULT($with_ldap_support) + +SMBLDAP="" +AC_SUBST(SMBLDAP) +SMBLDAPUTIL="" +AC_SUBST(SMBLDAPUTIL) +if test x"$with_ldap_support" != x"no"; then + + ################################################################## + # first test for ldap.h and lber.h + # (ldap.h is required for this test) + AC_CHECK_HEADERS(ldap.h lber.h) + + if test x"$ac_cv_header_ldap_h" != x"yes"; then + if test x"$with_ldap_support" = x"yes"; then + AC_MSG_ERROR(ldap.h is needed for LDAP support) + else + AC_MSG_WARN(ldap.h is needed for LDAP support) + fi + + with_ldap_support=no + fi +fi + +if test x"$with_ldap_support" != x"no"; then + ac_save_LIBS=$LIBS + + ################################################################## + # we might need the lber lib on some systems. To avoid link errors + # this test must be before the libldap test + AC_CHECK_LIB_EXT(lber, LDAP_LIBS, ber_scanf) + + ######################################################## + # now see if we can find the ldap libs in standard paths + AC_CHECK_LIB_EXT(ldap, LDAP_LIBS, ldap_init) + + AC_CHECK_FUNC_EXT(ldap_domain2hostlist,$LDAP_LIBS) + + ######################################################## + # If we have LDAP, does it's rebind procedure take 2 or 3 arguments? + # Check found in pam_ldap 145. + AC_CHECK_FUNC_EXT(ldap_set_rebind_proc,$LDAP_LIBS) + + LIBS="$LIBS $LDAP_LIBS" + AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, smb_ldap_cv_ldap_set_rebind_proc, [ + AC_TRY_COMPILE([ + #include + #include ], + [ldap_set_rebind_proc(0, 0, 0);], + [smb_ldap_cv_ldap_set_rebind_proc=3], + [smb_ldap_cv_ldap_set_rebind_proc=2] + ) + ]) + + AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $smb_ldap_cv_ldap_set_rebind_proc, [Number of arguments to ldap_set_rebind_proc]) + + AC_CHECK_FUNC_EXT(ldap_initialize,$LDAP_LIBS) + + if test x"$ac_cv_lib_ext_ldap_ldap_init" = x"yes" -a x"$ac_cv_func_ext_ldap_domain2hostlist" = x"yes"; then + AC_DEFINE(HAVE_LDAP,1,[Whether ldap is available]) + default_static_modules="$default_static_modules pdb_ldap idmap_ldap"; + SMBLDAP="lib/smbldap.o" + SMBLDAPUTIL="lib/smbldap_util.o" + with_ldap_support=yes + AC_MSG_CHECKING(whether LDAP support is used) + AC_MSG_RESULT(yes) + else + if test x"$with_ldap_support" = x"yes"; then + AC_MSG_ERROR(libldap is needed for LDAP support) + else + AC_MSG_WARN(libldap is needed for LDAP support) + fi + + LDAP_LIBS="" + with_ldap_support=no + fi + LIBS=$ac_save_LIBS +fi + + +################################################# +# active directory support + +with_ads_support=auto +AC_MSG_CHECKING([for Active Directory and krb5 support]) + +AC_ARG_WITH(ads, +[ --with-ads Active Directory support (default auto)], +[ case "$withval" in + yes|no) + with_ads_support="$withval" + ;; + esac ]) + +AC_MSG_RESULT($with_ads_support) + +FOUND_KRB5=no +KRB5_LIBS="" + +if test x"$with_ldap_support" != x"yes"; then + if test x"$with_ads_support" = x"yes"; then + AC_MSG_ERROR(Active Directory Support requires LDAP support) + elif test x"$with_ads_support" != x"no"; then + AC_MSG_WARN(Active Directory Support requires LDAP support) + fi + with_ads_support=no +fi + +if test x"$with_ads_support" != x"no"; then + + # Do no harm to the values of CFLAGS and LIBS while testing for + # Kerberos support. + + if test x$FOUND_KRB5 = x"no"; then + ################################################# + # check for location of Kerberos 5 install + AC_MSG_CHECKING(for kerberos 5 install path) + AC_ARG_WITH(krb5, + [ --with-krb5=base-dir Locate Kerberos 5 support (default=/usr)], + [ case "$withval" in + no) + AC_MSG_RESULT(no krb5-path given) + ;; + yes) + AC_MSG_RESULT(/usr) + FOUND_KRB5=yes + ;; + *) + AC_MSG_RESULT($withval) + KRB5_CFLAGS="-I$withval/include" + KRB5_CPPFLAGS="-I$withval/include" + KRB5_LDFLAGS="-L$withval/lib" + FOUND_KRB5=yes + if test -x "$withval/bin/krb5-config"; then + KRB5CONFIG=$withval/bin/krb5-config + fi + ;; + esac ], + AC_MSG_RESULT(no krb5-path given) + ) + fi + + ################################################# + # check for krb5-config from recent MIT and Heimdal kerberos 5 + AC_PATH_PROG(KRB5CONFIG, krb5-config) + AC_MSG_CHECKING(for working krb5-config) + if test -x "$KRB5CONFIG"; then + ac_save_CFLAGS=$CFLAGS + CFLAGS="";export CFLAGS + ac_save_LDFLAGS=$LDFLAGS + LDFLAGS="";export LDFLAGS + KRB5_LIBS="`$KRB5CONFIG --libs gssapi`" + KRB5_LDFLAGS="`$KRB5CONFIG --libs gssapi | sed s/-lgss.*//`" + KRB5_CFLAGS="`$KRB5CONFIG --cflags | sed s/@INCLUDE_des@//`" + KRB5_CPPFLAGS="`$KRB5CONFIG --cflags | sed s/@INCLUDE_des@//`" + CFLAGS=$ac_save_CFLAGS;export CFLAGS + LDFLAGS=$ac_save_LDFLAGS;export LDFLAGS + FOUND_KRB5=yes + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no. Fallback to previous krb5 detection strategy) + fi + + if test x$FOUND_KRB5 = x"no"; then + ################################################# + # see if this box has the SuSE location for the heimdal krb implementation + AC_MSG_CHECKING(for /usr/include/heimdal) + if test -d /usr/include/heimdal; then + if test -f /usr/lib/heimdal/lib/libkrb5.a; then + KRB5_CFLAGS="-I/usr/include/heimdal" + KRB5_CPPFLAGS="-I/usr/include/heimdal" + KRB5_LDFLAGS="-L/usr/lib/heimdal/lib" + AC_MSG_RESULT(yes) + else + KRB5_CFLAGS="-I/usr/include/heimdal" + KRB5_CPPFLAGS="-I/usr/include/heimdal" + AC_MSG_RESULT(yes) + fi + else + AC_MSG_RESULT(no) + fi + fi + + if test x$FOUND_KRB5 = x"no"; then + ################################################# + # see if this box has the RedHat location for kerberos + AC_MSG_CHECKING(for /usr/kerberos) + if test -d /usr/kerberos -a -f /usr/kerberos/lib/libkrb5.a; then + KRB5_LDFLAGS="-L/usr/kerberos/lib" + KRB5_CFLAGS="-I/usr/kerberos/include" + KRB5_CPPFLAGS="-I/usr/kerberos/include" + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + fi + + ac_save_CFLAGS=$CFLAGS + ac_save_CPPFLAGS=$CPPFLAGS + ac_save_LDFLAGS=$LDFLAGS + + CFLAGS="$KRB5_CFLAGS $CFLAGS" + CPPFLAGS="$KRB5_CPPFLAGS $CPPFLAGS" + LDFLAGS="$KRB5_LDFLAGS $LDFLAGS" + + KRB5_LIBS="$KRB5_LDFLAGS $KRB5_LIBS" + + # now check for krb5.h. Some systems have the libraries without the headers! + # note that this check is done here to allow for different kerberos + # include paths + AC_CHECK_HEADERS(krb5.h) + + if test x"$ac_cv_header_krb5_h" = x"no"; then + + # Give a warning if AD support was not explicitly requested, + # i.e with_ads_support = auto, otherwise die with an error. + + if test x"$with_ads_support" = x"yes"; then + AC_MSG_ERROR([Active Directory cannot be supported without krb5.h]) + else + AC_MSG_WARN([Active Directory cannot be supported without krb5.h]) + fi + + # Turn off AD support and restore CFLAGS and LIBS variables + + with_ads_support="no" + + CFLAGS=$ac_save_CFLAGS + CPPFLAGS=$ac_save_CPPFLAGS + LDFLAGS=$ac_save_LDFLAGS + fi +fi + +# Now we have determined whether we really want ADS support + +if test x"$with_ads_support" != x"no"; then + ac_save_LIBS=$LIBS + + # now check for gssapi headers. This is also done here to allow for + # different kerberos include paths + AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h com_err.h) + + ################################################################## + # we might need the k5crypto and com_err libraries on some systems + AC_CHECK_LIB_EXT(com_err, KRB5_LIBS, _et_list) + AC_CHECK_LIB_EXT(k5crypto, KRB5_LIBS, krb5_encrypt_data) + + # Heimdal checks. + AC_CHECK_LIB_EXT(crypto, KRB5_LIBS, des_set_key) + AC_CHECK_LIB_EXT(asn1, KRB5_LIBS, copy_Authenticator) + AC_CHECK_LIB_EXT(roken, KRB5_LIBS, roken_getaddrinfo_hostspec) + + # Heimdal checks. On static Heimdal gssapi must be linked before krb5. + AC_CHECK_LIB_EXT(gssapi, KRB5_LIBS, gss_display_status,[],[], + AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])) + + ######################################################## + # now see if we can find the krb5 libs in standard paths + # or as specified above + AC_CHECK_LIB_EXT(krb5, KRB5_LIBS, krb5_mk_req_extended) + AC_CHECK_LIB_EXT(krb5, KRB5_LIBS, krb5_kt_compare) + + ######################################################## + # now see if we can find the gssapi libs in standard paths + AC_CHECK_LIB_EXT(gssapi_krb5, KRB5_LIBS,gss_display_status,[],[], + AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])) + + AC_CHECK_FUNC_EXT(krb5_set_real_time, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_set_default_in_tkt_etypes, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_set_default_tgs_ktypes, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_principal2salt, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_use_enctype, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_string_to_key, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_get_pw_salt, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_string_to_key_salt, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_auth_con_setkey, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_auth_con_setuseruserkey, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_locate_kdc, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_get_permitted_enctypes, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_get_default_in_tkt_etypes, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_free_ktypes, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_free_data_contents, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_principal_get_comp_string, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_free_unparsed_name, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_free_keytab_entry_contents, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_kt_free_entry, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_krbhst_get_addrinfo, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_c_enctype_compare, $KRB5_LIBS) + AC_CHECK_FUNC_EXT(krb5_enctypes_compatible_keys, $KRB5_LIBS) + + LIBS="$KRB5_LIBS $LIBS" + + AC_CACHE_CHECK([for krb5_encrypt_block type], + samba_cv_HAVE_KRB5_ENCRYPT_BLOCK,[ + AC_TRY_COMPILE([#include ], + [krb5_encrypt_block block;], + samba_cv_HAVE_KRB5_ENCRYPT_BLOCK=yes, + samba_cv_HAVE_KRB5_ENCRYPT_BLOCK=no)]) + + if test x"$samba_cv_HAVE_KRB5_ENCRYPT_BLOCK" = x"yes"; then + AC_DEFINE(HAVE_KRB5_ENCRYPT_BLOCK,1, + [Whether the type krb5_encrypt_block exists]) + fi + + AC_CACHE_CHECK([for addrtype in krb5_address], + samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS,[ + AC_TRY_COMPILE([#include ], + [krb5_address kaddr; kaddr.addrtype = ADDRTYPE_INET;], + samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS=yes, + samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS=no)]) + + if test x"$samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS" = x"yes"; then + AC_DEFINE(HAVE_ADDRTYPE_IN_KRB5_ADDRESS,1, + [Whether the krb5_address struct has a addrtype property]) + fi + + AC_CACHE_CHECK([for addr_type in krb5_address], + samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS,[ + AC_TRY_COMPILE([#include ], + [krb5_address kaddr; kaddr.addr_type = KRB5_ADDRESS_INET;], + samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS=yes, + samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS=no)]) + + if test x"$samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS" = x"yes"; then + AC_DEFINE(HAVE_ADDR_TYPE_IN_KRB5_ADDRESS,1, + [Whether the krb5_address struct has a addr_type property]) + fi + + AC_CACHE_CHECK([for enc_part2 in krb5_ticket], + samba_cv_HAVE_KRB5_TKT_ENC_PART2, + [AC_TRY_COMPILE([#include ], + [krb5_ticket tkt; tkt.enc_part2->authorization_data[0]->contents = NULL;], + samba_cv_HAVE_KRB5_TKT_ENC_PART2=yes,samba_cv_HAVE_KRB5_TKT_ENC_PART2=no)]) + + if test x"$samba_cv_HAVE_KRB5_TKT_ENC_PART2" = x"yes"; then + AC_DEFINE(HAVE_KRB5_TKT_ENC_PART2,1, + [Whether the krb5_ticket struct has a enc_part2 property]) + fi + + AC_CACHE_CHECK([for keyblock in krb5_creds], + samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS,[ + AC_TRY_COMPILE([#include ], + [krb5_creds creds; krb5_keyblock kb; creds.keyblock = kb;], + samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS=yes, + samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS=no)]) + + if test x"$samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS" = x"yes"; then + AC_DEFINE(HAVE_KRB5_KEYBLOCK_IN_CREDS,1, + [Whether the krb5_creds struct has a keyblock property]) + fi + + AC_CACHE_CHECK([for session in krb5_creds], + samba_cv_HAVE_KRB5_SESSION_IN_CREDS,[ + AC_TRY_COMPILE([#include ], + [krb5_creds creds; krb5_keyblock kb; creds.session = kb;], + samba_cv_HAVE_KRB5_SESSION_IN_CREDS=yes, + samba_cv_HAVE_KRB5_SESSION_IN_CREDS=no)]) + + if test x"$samba_cv_HAVE_KRB5_SESSION_IN_CREDS" = x"yes"; then + AC_DEFINE(HAVE_KRB5_SESSION_IN_CREDS,1, + [Whether the krb5_creds struct has a session property]) + fi + + AC_CACHE_CHECK([for keyvalue in krb5_keyblock], + samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE,[ + AC_TRY_COMPILE([#include ], + [krb5_keyblock key; key.keyvalue.data = NULL;], + samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE=yes, + samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE=no)]) + + if test x"$samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE" = x"yes"; then + AC_DEFINE(HAVE_KRB5_KEYBLOCK_KEYVALUE,1, + [Whether the krb5_keyblock struct has a keyvalue property]) + fi + + AC_CACHE_CHECK([for ENCTYPE_ARCFOUR_HMAC_MD5], + samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5,[ + AC_TRY_COMPILE([#include ], + [krb5_enctype enctype; enctype = ENCTYPE_ARCFOUR_HMAC_MD5;], + samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5=yes, + samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5=no)]) + AC_CACHE_CHECK([for KEYTYPE_ARCFOUR_56], + samba_cv_HAVE_KEYTYPE_ARCFOUR_56,[ + AC_TRY_COMPILE([#include ], + [krb5_keytype keytype; keytype = KEYTYPE_ARCFOUR_56;], + samba_cv_HAVE_KEYTYPE_ARCFOUR_56=yes, + samba_cv_HAVE_KEYTYPE_ARCFOUR_56=no)]) +# Heimdals with KEYTYPE_ARCFOUR but not KEYTYPE_ARCFOUR_56 are broken +# w.r.t. arcfour and windows, so we must not enable it here + if test x"$samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5" = x"yes" -a\ + x"$samba_cv_HAVE_KEYTYPE_ARCFOUR_56" = x"yes"; then + AC_DEFINE(HAVE_ENCTYPE_ARCFOUR_HMAC_MD5,1, + [Whether the ENCTYPE_ARCFOUR_HMAC_MD5 key type is available]) + fi + + AC_CACHE_CHECK([for AP_OPTS_USE_SUBKEY], + samba_cv_HAVE_AP_OPTS_USE_SUBKEY,[ + AC_TRY_COMPILE([#include ], + [krb5_flags ap_options; ap_options = AP_OPTS_USE_SUBKEY;], + samba_cv_HAVE_AP_OPTS_USE_SUBKEY=yes, + samba_cv_HAVE_AP_OPTS_USE_SUBKEY=no)]) + + if test x"$samba_cv_HAVE_AP_OPTS_USE_SUBKEY" = x"yes"; then + AC_DEFINE(HAVE_AP_OPTS_USE_SUBKEY,1, + [Whether the AP_OPTS_USE_SUBKEY ap option is available]) + fi + + AC_CACHE_CHECK([for KV5M_KEYTAB], + samba_cv_HAVE_KV5M_KEYTAB,[ + AC_TRY_COMPILE([#include ], + [krb5_keytab_entry entry; entry.magic = KV5M_KEYTAB;], + samba_cv_HAVE_KV5M_KEYTAB=yes, + samba_cv_HAVE_KV5M_KEYTAB=no)]) + + if test x"$samba_cv_HAVE_KV5M_KEYTAB" = x"yes"; then + AC_DEFINE(HAVE_KV5M_KEYTAB,1, + [Whether the KV5M_KEYTAB option is available]) + fi + + AC_CACHE_CHECK([for the krb5_princ_component macro], + samba_cv_HAVE_KRB5_PRINC_COMPONENT,[ + AC_TRY_LINK([#include ], + [const krb5_data *pkdata; krb5_context context; krb5_principal principal; pkdata = krb5_princ_component(context, principal, 0);], + samba_cv_HAVE_KRB5_PRINC_COMPONENT=yes, + samba_cv_HAVE_KRB5_PRINC_COMPONENT=no)]) + + if test x"$samba_cv_HAVE_KRB5_PRINC_COMPONENT" = x"yes"; then + AC_DEFINE(HAVE_KRB5_PRINC_COMPONENT,1, + [Whether krb5_princ_component is available]) + fi + + AC_CACHE_CHECK([for key in krb5_keytab_entry], + samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY,[ + AC_TRY_COMPILE([#include ], + [krb5_keytab_entry entry; krb5_keyblock e; entry.key = e;], + samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY=yes, + samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY=no)]) + + if test x"$samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY" = x"yes"; then + AC_DEFINE(HAVE_KRB5_KEYTAB_ENTRY_KEY,1, + [Whether krb5_keytab_entry has key member]) + fi + + AC_CACHE_CHECK([for keyblock in krb5_keytab_entry], + samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK,[ + AC_TRY_COMPILE([#include ], + [krb5_keytab_entry entry; entry.keyblock.keytype = 0;], + samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK=yes, + samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK=no)]) + + if test x"$samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK" = x"yes"; then + AC_DEFINE(HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK,1, + [Whether krb5_keytab_entry has keyblock member]) + fi + + if test x"$ac_cv_lib_ext_krb5_krb5_mk_req_extended" = x"yes"; then + AC_DEFINE(HAVE_KRB5,1,[Whether to have KRB5 support]) + AC_DEFINE(WITH_ADS,1,[Whether to include Active Directory support]) + AC_MSG_CHECKING(whether Active Directory and krb5 support is used) + AC_MSG_RESULT(yes) + else + if test x"$with_ads_support" = x"yes"; then + AC_MSG_ERROR(libkrb5 is needed for Active Directory support) + else + AC_MSG_WARN(libkrb5 is needed for Active Directory support) + fi + KRB5_LIBS="" + with_ads_support=no + fi + + AC_CACHE_CHECK([for WRFILE: keytab support], + samba_cv_HAVE_WRFILE_KEYTAB,[ + AC_TRY_RUN([ +#include + main() + { + krb5_context context; + krb5_keytab keytab; + + krb5_init_context(&context); + return krb5_kt_resolve(context, "WRFILE:api", &keytab); + }], + samba_cv_HAVE_WRFILE_KEYTAB=yes, + samba_cv_HAVE_WRFILE_KEYTAB=no)]) + + if test x"$samba_cv_HAVE_WRFILE_KEYTAB" = x"yes"; then + AC_DEFINE(HAVE_WRFILE_KEYTAB,1, + [Whether the WRFILE:-keytab is supported]) + fi + + AC_CACHE_CHECK([for krb5_princ_realm returns krb5_realm or krb5_data], + samba_cv_KRB5_PRINC_REALM_RETURNS_REALM,[ + AC_TRY_COMPILE([#include ], + [ + krb5_context context; + krb5_principal principal; + krb5_realm realm; realm = *krb5_princ_realm(context, principal);], + samba_cv_KRB5_PRINC_REALM_RETURNS_REALM=yes, + samba_cv_KRB5_PRINC_REALM_RETURNS_REALM=no)]) + + if test x"$samba_cv_KRB5_PRINC_REALM_RETURNS_REALM" = x"yes"; then + AC_DEFINE(KRB5_PRINC_REALM_RETURNS_REALM,1, + [Whether krb5_princ_realm returns krb5_realm or krb5_data]) + fi + +LIBS="$ac_save_LIBS" +fi + +######################################################## +# Compile experimental passdb backends? +# (pdb_xml, pdb_mysql, pdb_pgsql) +AC_MSG_CHECKING(whether to build experimental passdb libraries) +AC_ARG_WITH(expsam, +[ --with-expsam= Include experimental passdb libraries (default=no)] +[ Valid choices include (comma separated list): ] +[ xml, mysql & pgsql], +[ expsam_pdb_modules=`echo "$withval" | sed 's/,/ /g'` + if test "z$expsam_pdb_modules" = "zyes"; then + expsam_pdb_modules="xml mysql pgsql" + fi + AC_MSG_RESULT($expsam_pdb_modules) + for i in $expsam_pdb_modules + do + case "$i" in + xml|all|yes) + ## pdb_xml + AM_PATH_XML2([2.0.0],[default_shared_modules="$default_shared_modules pdb_xml"],[AC_MSG_ERROR([Can't find XML libraries while XML support is requested])]) + CFLAGS="$CFLAGS $XML_CFLAGS" + ;; + mysql|all|yes) + ## pdb_mysql + AM_PATH_MYSQL([default_shared_modules="$default_shared_modules pdb_mysql"],[AC_MSG_ERROR([Can't find MySQL libraries while MySQL support is requested])]) + CFLAGS="$CFLAGS $MYSQL_CFLAGS" + ;; + pgsql|all|yes) + ## pdb_pgsql + AM_PATH_PGSQL([default_shared_modules="$default_shared_modules pdb_pgsql"],[]) + CFLAGS="$CFLAGS $PGSQL_CFLAGS" + ;; + no) + ;; + *) + echo "Unknown module name \"$i\"! Exiting..." + exit 1 + ;; + esac + done ], + AC_MSG_RESULT(no) +) + +################################################# +# check for automount support +AC_MSG_CHECKING(whether to use automount) +AC_ARG_WITH(automount, +[ --with-automount Include automount support (default=no)], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_AUTOMOUNT,1,[Whether to include automount support]) + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +################################################# +# check for smbmount support +AC_MSG_CHECKING(whether to use smbmount) +AC_ARG_WITH(smbmount, +[ --with-smbmount Include smbmount (Linux only) support (default=no)], +[ case "$withval" in + yes) + case "$host_os" in + *linux*) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_SMBMOUNT,1,[Whether to build smbmount]) + EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbmount bin/smbmnt bin/smbumount" + ;; + *) + AC_MSG_ERROR(not on a linux system!) + ;; + esac + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + + + +################################################# +# check for a PAM clear-text auth, accounts, password and session support +with_pam_for_crypt=no +AC_MSG_CHECKING(whether to use PAM) +AC_ARG_WITH(pam, +[ --with-pam Include PAM support (default=no)], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + if test x"$ac_cv_header_security_pam_appl_h" = x"no"; then + if test x"$ac_cv_header_security_pam_modules_h" = x"no"; then + if test x"$ac_cv_header_security__pam_macros_h" = x"no"; then + AC_MSG_ERROR(--with-pam specified but no PAM headers found) + fi + fi + fi + AC_DEFINE(WITH_PAM,1,[Whether to include PAM support]) + AUTH_LIBS="$AUTH_LIBS -lpam" + with_pam_for_crypt=yes + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +# we can't build a pam module if we don't have pam. +AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM,1,[Whether libpam is available])]) + +################################################# +# check for pam_smbpass support +AC_MSG_CHECKING(whether to use pam_smbpass) +AC_ARG_WITH(pam_smbpass, +[ --with-pam_smbpass Build PAM module for authenticating against passdb backends (default=no)], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + + # Conditions under which pam_smbpass should not be built. + + if test x$PICFLAGS = x; then + AC_MSG_ERROR([No support for PIC code]) + elif test x"$ac_cv_header_security_pam_appl_h" = x"no"; then + AC_MSG_ERROR([No security/pam_appl.h found]) + elif test x$ac_cv_lib_pam_pam_get_data = xno; then + AC_MSG_ERROR([No libpam found]) + else + AUTH_LIBS="$AUTH_LIBS -lpam" + SHLIB_PROGS="$SHLIB_PROGS bin/pam_smbpass.$SHLIBEXT" + fi + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + + +############################################### +# test for where we get crypt() from +AC_SEARCH_LIBS(crypt, [crypt], + [test "$ac_cv_search_crypt" = "none required" || AUTH_LIBS="-lcrypt $AUTH_LIBS" + AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])]) + +## +## moved after the check for -lcrypt in order to +## ensure that the necessary libraries are included +## check checking for truncated salt. Wrapped by the +## $with_pam_for_crypt variable as above --jerry +## +if test $with_pam_for_crypt = no; then +AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[ +crypt_LIBS="$LIBS" +LIBS="$AUTH_LIBS $LIBS" +AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"], + samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross) +LIBS="$crypt_LIBS"]) +if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then + AC_DEFINE(HAVE_TRUNCATED_SALT,1,[Whether crypt needs truncated salt]) +fi +fi + + +######################################################################################## +## +## TESTS FOR SAM BACKENDS. KEEP THESE GROUPED TOGETHER +## +######################################################################################## + +################################################# +# check for a LDAP password database configuration backwards compatibility +AC_MSG_CHECKING(whether to use LDAP SAM 2.2 compatible configuration) +AC_ARG_WITH(ldapsam, +[ --with-ldapsam Include LDAP SAM 2.2 compatible configuration (default=no)], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_LDAP_SAMCONFIG,1,[Whether to include 2.2 compatible LDAP SAM configuration]) + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +######################################################################################## +## +## END OF TESTS FOR SAM BACKENDS. +## +######################################################################################## + +################################################# +# check for a NISPLUS_HOME support +AC_MSG_CHECKING(whether to use NISPLUS_HOME) +AC_ARG_WITH(nisplus-home, +[ --with-nisplus-home Include NISPLUS_HOME support (default=no)], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_NISPLUS_HOME,1,[Whether to include nisplus_home support]) + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +################################################# +# check for syslog logging +AC_MSG_CHECKING(whether to use syslog logging) +AC_ARG_WITH(syslog, +[ --with-syslog Include experimental SYSLOG support (default=no)], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_SYSLOG,1,[Whether to include experimental syslog support]) + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + +################################################# +# check for a shared memory profiling support +AC_MSG_CHECKING(whether to use profiling) +AC_ARG_WITH(profiling-data, +[ --with-profiling-data Include gathering source code profile information (default=no)], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_PROFILE,1,[Whether to use profiling]) + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(no) +) + + +################################################# +# check for experimental disk-quotas support + +samba_cv_WITH_QUOTAS=auto +samba_cv_TRY_QUOTAS=no +samba_cv_RUN_QUOTA_TESTS=auto +samba_cv_WITH_SYS_QUOTAS=auto +samba_cv_TRY_SYS_QUOTAS=auto +samba_cv_SYSQUOTA_FOUND=no + +AC_MSG_CHECKING(whether to try disk-quotas support) +AC_ARG_WITH(quotas, +[ --with-quotas Include disk-quota support (default=no)], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + samba_cv_WITH_QUOTAS=yes + samba_cv_TRY_QUOTAS=yes + samba_cv_RUN_QUOTA_TESTS=yes + #set sys quotas to auto in this case + samba_cv_TRY_SYS_QUOTAS=auto + ;; + auto) + AC_MSG_RESULT(auto) + samba_cv_WITH_QUOTAS=auto + samba_cv_TRY_QUOTAS=auto + samba_cv_RUN_QUOTA_TESTS=auto + #set sys quotas to auto in this case + samba_cv_TRY_SYS_QUOTAS=auto + ;; + no) + AC_MSG_RESULT(no) + samba_cv_WITH_QUOTAS=no + samba_cv_TRY_QUOTAS=no + samba_cv_RUN_QUOTA_TESTS=no + ;; + *) + AC_MSG_RESULT(${samba_cv_TRY_QUOTAS}) + ;; + esac ], + AC_MSG_RESULT(${samba_cv_TRY_QUOTAS}) +) + +AC_MSG_CHECKING(whether to try the new lib/sysquotas.c interface) +AC_ARG_WITH(sys-quotas, +[ --with-sys-quotas Include lib/sysquotas.c support (default=auto)], +[ case "$withval" in + yes) + AC_MSG_RESULT(yes) + samba_cv_WITH_SYS_QUOTAS=yes + samba_cv_TRY_SYS_QUOTAS=yes + samba_cv_RUN_QUOTA_TESTS=yes + ;; + auto) + AC_MSG_RESULT(auto) + samba_cv_WITH_SYS_QUOTAS=auto + samba_cv_TRY_SYS_QUOTAS=auto + samba_cv_RUN_QUOTA_TESTS=auto + ;; + no) + AC_MSG_RESULT(no) + samba_cv_WITH_SYS_QUOTAS=no + samba_cv_TRY_SYS_QUOTAS=no + ;; + *) + AC_MSG_RESULT(${samba_cv_TRY_SYS_QUOTAS}) + ;; + esac ], + AC_MSG_RESULT(${samba_cv_TRY_SYS_QUOTAS}) +) + +if test x"$samba_cv_TRY_SYS_QUOTAS" = x"auto"; then +AC_MSG_CHECKING(whether to try the lib/sysquotas.c interface on ${host_os}) + case "$host_os" in + *linux*) + AC_MSG_RESULT(yes) + samba_cv_TRY_SYS_QUOTAS=yes + samba_cv_RUN_QUOTA_TESTS=yes + ;; + *) + AC_MSG_RESULT(no) + samba_cv_TRY_SYS_QUOTAS=no + ;; + esac +fi + +############################################# +# only check for quota stuff if --with-quotas +if test x"$samba_cv_RUN_QUOTA_TESTS" != x"no"; then + +case "$host_os" in + # on linux we didn't need to test we have builtin support + *linux*) + samba_cv_SYSQUOTA_FOUND=yes + AC_DEFINE(HAVE_QUOTACTL_LINUX,1,[Whether Linux quota support is available]) + samba_cv_sysquotas_file="lib/sysquotas_linux.c" + AC_MSG_CHECKING(whether to use the lib/sysquotas_linux.c builtin support) + AC_MSG_RESULT(yes) + + AC_DEFINE(HAVE_LINUX_XFS_QUOTAS,1,[Whether Linux xfs quota support is available]) + samba_cv_found_xfs_header=yes + AC_MSG_CHECKING(whether to use the lib/sysquotas_xfs.c builtin support) + AC_MSG_RESULT(yes) + ;; + *solaris*) + # need to set this define when using static linking (BUG 1473) + CPPFLAGS="$CPPFLAGS -DSUNOS5" + ;; + *) + ;; +esac + +# some broken header files need this +AC_CHECK_HEADER(asm/types.h,[ + AC_DEFINE(HAVE_ASM_TYPES_H,1,[check for ]) + AC_ADD_INCLUDE() + ]) + +# For quotas on Veritas VxFS filesystems +AC_CHECK_HEADERS(sys/fs/vx_quota.h) + +# For sys/quota.h and linux/quota.h +AC_CHECK_HEADERS(sys/quota.h) + +if test x"$samba_cv_found_xfs_header" != x"yes"; then +# if we have xfs quota support (IRIX) we should use it +AC_CACHE_CHECK([for XFS QUOTA in ],samba_cv_HAVE_SYS_QUOTA_XFS, [ +AC_TRY_COMPILE([ +#include "confdefs.h" +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_ASM_TYPES_H +#include +#endif +#include +],[int i = Q_XGETQUOTA;], +samba_cv_HAVE_SYS_QUOTA_XFS=yes,samba_cv_HAVE_SYS_QUOTA_XFS=no)]) +if test "$samba_cv_HAVE_SYS_QUOTA_XFS"x = "yes"x; then + samba_cv_found_xfs_header=yes +fi +fi + +# if we have struct dqblk .dqb_fsoftlimit instead of .dqb_isoftlimit on IRIX +AC_CACHE_CHECK([if struct dqblk has .dqb_fsoftlimit],samba_cv_HAVE_DQB_FSOFTLIMIT, [ +AC_TRY_COMPILE([ +#include "confdefs.h" +#ifdef HAVE_SYS_QUOTA_H +#include +#endif +],[ +struct dqblk D; +D.dqb_fsoftlimit = 0;], +samba_cv_HAVE_DQB_FSOFTLIMIT=yes,samba_cv_HAVE_DQB_FSOFTLIMIT=no)]) +if test "$samba_cv_HAVE_DQB_FSOFTLIMIT"x = "yes"x; then + AC_DEFINE(HAVE_DQB_FSOFTLIMIT,1,[struct dqblk .dqb_fsoftlimit]) +fi + +################## +# look for a working quota system + +if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then +AC_CACHE_CHECK([for long quotactl(int cmd, char *special, qid_t id, caddr_t addr)],samba_cv_HAVE_QUOTACTL_4A,[ +AC_TRY_RUN_STRICT([ +#define HAVE_QUOTACTL_4A 1 +#define AUTOCONF_TEST 1 +#include "confdefs.h" +#include "${srcdir-.}/tests/sysquotas.c"],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS], + samba_cv_HAVE_QUOTACTL_4A=yes,samba_cv_HAVE_QUOTACTL_4A=no,samba_cv_HAVE_QUOTACTL_4A=cross)]) +if test x"$samba_cv_HAVE_QUOTACTL_4A" = x"yes"; then + samba_cv_SYSQUOTA_FOUND=yes; + AC_DEFINE(HAVE_QUOTACTL_4A,1,[Whether long quotactl(int cmd, char *special, qid_t id, caddr_t addr) is available]) + samba_cv_sysquotas_file="lib/sysquotas_4A.c" +fi +fi + +if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then +AC_CACHE_CHECK([for int quotactl(const char *path, int cmd, int id, char *addr)],samba_cv_HAVE_QUOTACTL_4B,[ +AC_TRY_RUN_STRICT([ +#define HAVE_QUOTACTL_4B 1 +#define AUTOCONF_TEST 1 +#include "confdefs.h" +#include "${srcdir-.}/tests/sysquotas.c"],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS], + samba_cv_HAVE_QUOTACTL_4B=yes,samba_cv_HAVE_QUOTACTL_4B=no,samba_cv_HAVE_QUOTACTL_4B=cross)]) +if test x"$samba_cv_HAVE_QUOTACTL_4B" = x"yes"; then + echo "int quotactl(const char *path, int cmd, int id, char *addr) is not reworked for the new sys_quota api" + samba_cv_SYSQUOTA_FOUND=yes; + AC_DEFINE(HAVE_QUOTACTL_4B,1,[Whether int quotactl(const char *path, int cmd, int id, char *addr) is available]) + samba_cv_sysquotas_file="lib/sysquotas_4B.c" +fi +fi + +if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then +AC_CACHE_CHECK([for CRAY int quotactl (char *spec, int request, char *arg)],samba_cv_HAVE_QUOTACTL_3,[ +AC_TRY_RUN_STRICT([ +#define HAVE_QUOTACTL_3 1 +#define AUTOCONF_TEST 1 +#include "confdefs.h" +#include "${srcdir-.}/tests/sysquotas.c"],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS], + samba_cv_HAVE_QUOTACTL_3=yes,samba_cv_HAVE_QUOTACTL_3=no,samba_cv_HAVE_QUOTACTL_3=cross)]) +if test x"$samba_cv_HAVE_QUOTACTL_3" = x"yes"; then + echo "CRAY int quotactl (char *spec, int request, char *arg) is NOT reworked for the sys_quota api" + samba_cv_SYSQUOTA_FOUND=yes; + AC_DEFINE(HAVE_QUOTACTL_3,1,[Whether CRAY int quotactl (char *spec, int request, char *arg); is available]) + samba_cv_sysquotas_file="lib/sysquotas_3.c" +fi +fi + +################################################# +# check for mntent.h and struct mntent +AC_CHECK_HEADERS(mntent.h) +################################################# +# check for setmntent,getmntent,endmntent +AC_CHECK_FUNCS(setmntent getmntent endmntent) + +################################################# +# check for devnm.h and struct mntent +AC_CHECK_HEADERS(devnm.h) +################################################# +# check for devnm +AC_CHECK_FUNCS(devnm) + +if test x"$samba_cv_WITH_SYS_QUOTAS" = x"yes"; then + if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then + # if --with-sys-quotas=yes then build it + # you have can use the get/set quota command smb.conf + # options then + samba_cv_SYSQUOTA_FOUND=auto + fi + if test x"$samba_cv_TRY_SYS_QUOTAS" != x"yes"; then + # if --with-sys-quotas=yes then build it + # you have can use the get/set quota command smb.conf + # options then + samba_cv_TRY_SYS_QUOTAS=auto + fi +fi + +if test x"$samba_cv_SYSQUOTA_FOUND" != x"no"; then +AC_CACHE_CHECK([whether the sys_quota interface works],samba_cv_SYSQUOTA_WORKS,[ +SAVE_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I. -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt -I${srcdir-.}/nsswitch" +AC_TRY_COMPILE([ +#include "confdefs.h" +#define NO_PROTO_H 1 +#define NO_CONFIG_H 1 +#define HAVE_SYS_QUOTAS 1 +#include "${srcdir-.}/${samba_cv_sysquotas_file}" +#include "${srcdir-.}/lib/sysquotas.c" +],[],samba_cv_SYSQUOTA_WORKS=yes,samba_cv_SYSQUOTA_WORKS=no) +CPPFLAGS="$SAVE_CPPFLAGS" +]) +if test x"$samba_cv_SYSQUOTA_WORKS" = x"yes"; then +AC_MSG_CHECKING(whether to use the new lib/sysquotas.c interface) + if test x"$samba_cv_TRY_SYS_QUOTAS" != x"no"; then + AC_DEFINE(WITH_QUOTAS,1,[Whether to use disk quota support]) + AC_DEFINE(HAVE_SYS_QUOTAS,1,[Whether the new lib/sysquotas.c interface can be used]) + samba_cv_WE_USE_SYS_QUOTAS=yes + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi +fi +fi + +if test x"$samba_cv_SYSQUOTA_FOUND" != x"no" -a x"$samba_cv_found_xfs_header" = x"yes"; then +AC_CACHE_CHECK([whether the sys_quota interface works with XFS],samba_cv_SYSQUOTA_WORKS_XFS,[ +SAVE_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I. -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt -I${srcdir-.}/nsswitch" +AC_TRY_COMPILE([ +#include "confdefs.h" +#define NO_PROTO_H 1 +#define NO_CONFIG_H 1 +#define HAVE_SYS_QUOTAS 1 +#define HAVE_XFS_QUOTAS 1 +#include "${srcdir-.}/lib/sysquotas_xfs.c" +],[],samba_cv_SYSQUOTA_WORKS_XFS=yes,samba_cv_SYSQUOTA_WORKS_XFS=no) +CPPFLAGS="$SAVE_CPPFLAGS" +]) +if test x"$samba_cv_SYSQUOTA_WORKS_XFS" = x"yes"; then + if test x"$samba_cv_WE_USE_SYS_QUOTAS" = x"yes"; then + AC_DEFINE(HAVE_XFS_QUOTAS,1,[Whether xfs quota support is available]) + fi +fi +fi + +AC_CACHE_CHECK([whether the old quota support works],samba_cv_QUOTA_WORKS,[ +SAVE_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I. -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt -I${srcdir-.}/nsswitch -I${srcdir-.}/smbwrapper" +AC_TRY_COMPILE([ +#include "confdefs.h" +#define NO_PROTO_H 1 +#define NO_CONFIG_H 1 +#include "${srcdir-.}/smbd/quotas.c" +],[],samba_cv_QUOTA_WORKS=yes,samba_cv_QUOTA_WORKS=no) +CPPFLAGS="$SAVE_CPPFLAGS" +]) +if test x"$samba_cv_QUOTA_WORKS" = x"yes"; then +AC_MSG_CHECKING(whether to use the old quota support) + if test x"$samba_cv_WE_USE_SYS_QUOTAS" != x"yes"; then + if test x"$samba_cv_TRY_QUOTAS" != x"no"; then + AC_DEFINE(WITH_QUOTAS,1,[Whether to use disk quota support]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + else + AC_MSG_RESULT(no) + fi +fi + +#################### +# End of quota check samba_cv_RUN_QUOTA_TESTS +fi + +################################################# +# check for experimental utmp accounting + +AC_MSG_CHECKING(whether to support utmp accounting) +WITH_UTMP=yes +AC_ARG_WITH(utmp, +[ --with-utmp Include utmp accounting (default, if supported by OS)], +[ case "$withval" in + no) + WITH_UTMP=no + ;; + *) + WITH_UTMP=yes + ;; + esac ], +) + +# utmp requires utmp.h +# Note similar check earlier, when checking utmp details. + +if test x"$WITH_UTMP" = x"yes" -a x"$ac_cv_header_utmp_h" = x"no"; then + utmp_no_reason=", no utmp.h on $host_os" + WITH_UTMP=no +fi + +# Display test results + +if test x"$WITH_UTMP" = x"yes"; then + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_UTMP,1,[Whether to include experimental utmp accounting]) +else + AC_MSG_RESULT(no$utmp_no_reason) +fi + +################################################# +# should we build libsmbclient? + +INSTALLCLIENTCMD_SH=: +INSTALLCLIENTCMD_A=: +INSTALLCLIENT= +LIBSMBCLIENT_SHARED= +LIBSMBCLIENT= +AC_MSG_CHECKING(whether to build the libsmbclient shared library) +AC_ARG_WITH(libsmbclient, +[ --with-libsmbclient Build the libsmbclient shared library (default=yes if shared libs supported)], +[ case "$withval" in + no) + AC_MSG_RESULT(no) + ;; + *) + if test $BLDSHARED = true; then + INSTALLCLIENTCMD_SH="\$(INSTALLCMD)" + ## build the static version of libsmbclient as well + INSTALLCLIENTCMD_A="\$(INSTALLCMD)" + LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT + LIBSMBCLIENT=libsmbclient + AC_MSG_RESULT(yes) + else + enable_static=yes + AC_MSG_RESULT(no shared library support -- will supply static library) + fi + if test $enable_static = yes; then + INSTALLCLIENTCMD_A="\$(INSTALLCMD)" + LIBSMBCLIENT=libsmbclient + fi + INSTALLCLIENT=installclientlib + ;; + esac ], +[ +# if unspecified, default is to built it iff possible. + if test $BLDSHARED = true; then + INSTALLCLIENTCMD_SH="\$(INSTALLCMD)" + LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT + LIBSMBCLIENT=libsmbclient + AC_MSG_RESULT(yes) + else + enable_static=yes + AC_MSG_RESULT(no shared library support -- will supply static library) + fi + if test $enable_static = yes; then + INSTALLCLIENTCMD_A="\$(INSTALLCMD)" + LIBSMBCLIENT=libsmbclient + fi] + INSTALLCLIENT=installclientlib +) + + +INSTALLCLIENTCMD_SH=: +INSTALLCLIENTCMD_A=: +INSTALLCLIENT= +LIBSMBSHAREMODES_SHARED= +LIBSMBSHAREMODES= +AC_MSG_CHECKING(whether to build the libsmbsharemodes shared library) +AC_ARG_WITH(libsmbsharemodes, +[ --with-libsmbsharemodes Build the libsmbsharemodes shared library (default=yes if shared libs supported)], +[ case "$withval" in + no) + AC_MSG_RESULT(no) + ;; + *) + if test $BLDSHARED = true; then + INSTALLCLIENTCMD_SH="\$(INSTALLCMD)" + ## build the static version of libsmbsharemodes as well + INSTALLCLIENTCMD_A="\$(INSTALLCMD)" + LIBSMBSHAREMODES_SHARED=bin/libsmbsharemodes.$SHLIBEXT + LIBSMBSHAREMODES=libsmbsharemodes + AC_MSG_RESULT(yes) + else + enable_static=yes + AC_MSG_RESULT(no shared library support -- will supply static library) + fi + if test $enable_static = yes; then + INSTALLCLIENTCMD_A="\$(INSTALLCMD)" + LIBSMBSHAREMODES=libsmbsharemodes + fi + INSTALLCLIENT=installclientlib + ;; + esac ], +[ +# if unspecified, default is to built it iff possible. + if test $BLDSHARED = true; then + INSTALLCLIENTCMD_SH="\$(INSTALLCMD)" + LIBSMBSHAREMODES_SHARED=bin/libsmbsharemodes.$SHLIBEXT + LIBSMBSHAREMODES=libsmbsharemodes + AC_MSG_RESULT(yes) + else + enable_static=yes + AC_MSG_RESULT(no shared library support -- will supply static library) + fi + if test $enable_static = yes; then + INSTALLCLIENTCMD_A="\$(INSTALLCMD)" + LIBSMBSHAREMODES=libsmbsharemodes + fi] + INSTALLCLIENT=installclientlib +) + + +################################################# +# these tests are taken from the GNU fileutils package +AC_CHECKING(how to get filesystem space usage) +space=no + +# Test for statvfs64. +if test $space = no; then + # SVR4 + AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64, + [AC_TRY_RUN([ +#if defined(HAVE_UNISTD_H) +#include +#endif +#include +#include + main () + { + struct statvfs64 fsd; + exit (statvfs64 (".", &fsd)); + }], + fu_cv_sys_stat_statvfs64=yes, + fu_cv_sys_stat_statvfs64=no, + fu_cv_sys_stat_statvfs64=cross)]) + if test $fu_cv_sys_stat_statvfs64 = yes; then + space=yes + AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available]) + fi +fi + +# Perform only the link test since it seems there are no variants of the +# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs) +# because that got a false positive on SCO OSR5. Adding the declaration +# of a `struct statvfs' causes this test to fail (as it should) on such +# systems. That system is reported to work fine with STAT_STATFS4 which +# is what it gets when this test fails. +if test $space = no; then + # SVR4 + AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs, + [AC_TRY_LINK([#include +#include ], + [struct statvfs fsd; statvfs (0, &fsd);], + fu_cv_sys_stat_statvfs=yes, + fu_cv_sys_stat_statvfs=no)]) + if test $fu_cv_sys_stat_statvfs = yes; then + space=yes + AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available]) + fi +fi + +if test $space = no; then + # DEC Alpha running OSF/1 + AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)]) + AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1, + [AC_TRY_RUN([ +#include +#include +#include + main () + { + struct statfs fsd; + fsd.f_fsize = 0; + exit (statfs (".", &fsd, sizeof (struct statfs))); + }], + fu_cv_sys_stat_statfs3_osf1=yes, + fu_cv_sys_stat_statfs3_osf1=no, + fu_cv_sys_stat_statfs3_osf1=no)]) + AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1) + if test $fu_cv_sys_stat_statfs3_osf1 = yes; then + space=yes + AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments]) + fi +fi + +if test $space = no; then +# AIX + AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl +member (AIX, 4.3BSD)]) + AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize, + [AC_TRY_RUN([ +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +#ifdef HAVE_SYS_VFS_H +#include +#endif + main () + { + struct statfs fsd; + fsd.f_bsize = 0; + exit (statfs (".", &fsd)); + }], + fu_cv_sys_stat_statfs2_bsize=yes, + fu_cv_sys_stat_statfs2_bsize=no, + fu_cv_sys_stat_statfs2_bsize=no)]) + AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize) + if test $fu_cv_sys_stat_statfs2_bsize = yes; then + space=yes + AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property]) + fi +fi + +if test $space = no; then +# SVR3 + AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)]) + AC_CACHE_VAL(fu_cv_sys_stat_statfs4, + [AC_TRY_RUN([#include +#include + main () + { + struct statfs fsd; + exit (statfs (".", &fsd, sizeof fsd, 0)); + }], + fu_cv_sys_stat_statfs4=yes, + fu_cv_sys_stat_statfs4=no, + fu_cv_sys_stat_statfs4=no)]) + AC_MSG_RESULT($fu_cv_sys_stat_statfs4) + if test $fu_cv_sys_stat_statfs4 = yes; then + space=yes + AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments]) + fi +fi + +if test $space = no; then +# 4.4BSD and NetBSD + AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl +member (4.4BSD and NetBSD)]) + AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize, + [AC_TRY_RUN([#include +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif + main () + { + struct statfs fsd; + fsd.f_fsize = 0; + exit (statfs (".", &fsd)); + }], + fu_cv_sys_stat_statfs2_fsize=yes, + fu_cv_sys_stat_statfs2_fsize=no, + fu_cv_sys_stat_statfs2_fsize=no)]) + AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize) + if test $fu_cv_sys_stat_statfs2_fsize = yes; then + space=yes + AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize]) + fi +fi + +if test $space = no; then + # Ultrix + AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)]) + AC_CACHE_VAL(fu_cv_sys_stat_fs_data, + [AC_TRY_RUN([#include +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +#ifdef HAVE_SYS_FS_TYPES_H +#include +#endif + main () + { + struct fs_data fsd; + /* Ultrix's statfs returns 1 for success, + 0 for not mounted, -1 for failure. */ + exit (statfs (".", &fsd) != 1); + }], + fu_cv_sys_stat_fs_data=yes, + fu_cv_sys_stat_fs_data=no, + fu_cv_sys_stat_fs_data=no)]) + AC_MSG_RESULT($fu_cv_sys_stat_fs_data) + if test $fu_cv_sys_stat_fs_data = yes; then + space=yes + AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available]) + fi +fi + +# +# As a gating factor for large file support, in order to +# use <4GB files we must have the following minimal support +# available. +# long long, and a 64 bit off_t or off64_t. +# If we don't have all of these then disable large +# file support. +# +AC_MSG_CHECKING([if large file support can be enabled]) +AC_TRY_COMPILE([ +#if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8))) +#include +#else +__COMPILE_ERROR_ +#endif +], +[int i], +samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no) +if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then + AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT,1,[Whether large file support can be enabled]) +fi +AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT]) + +AC_ARG_WITH(spinlocks, +[ --with-spinlocks Use spin locks instead of fcntl locks (default=no) ]) +if test "x$with_spinlocks" = "xyes"; then + AC_DEFINE(USE_SPINLOCKS,1,[Whether to use spin locks instead of fcntl locks]) + + case "$host_cpu" in + sparc) + AC_DEFINE(SPARC_SPINLOCKS,1,[Whether to use sparc spinlocks]) + ;; + + i386|i486|i586|i686) + AC_DEFINE(INTEL_SPINLOCKS,1,[Whether to use intel spinlocks]) + ;; + + mips) + AC_DEFINE(MIPS_SPINLOCKS,1,[Whether to use mips spinlocks]) + ;; + + powerpc) + AC_DEFINE(POWERPC_SPINLOCKS,1,[Whether to use powerpc spinlocks]) + ;; + esac +fi + +################################################# +# check for ACL support + +AC_MSG_CHECKING(whether to support ACLs) +AC_ARG_WITH(acl-support, +[ --with-acl-support Include ACL support (default=no)], +[ case "$withval" in + yes) + + case "$host_os" in + *sysv5*) + AC_MSG_RESULT(Using UnixWare ACLs) + AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available]) + ;; + *solaris*) + AC_MSG_RESULT(Using solaris ACLs) + AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available]) + ;; + *hpux*) + AC_MSG_RESULT(Using HPUX ACLs) + AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available]) + ;; + *irix*) + AC_MSG_RESULT(Using IRIX ACLs) + AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available]) + ;; + *aix*) + AC_MSG_RESULT(Using AIX ACLs) + AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available]) + ;; + *osf*) + AC_MSG_RESULT(Using Tru64 ACLs) + AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available]) + ACL_LIBS="$ACL_LIBS -lpacl" + ;; + *freebsd[[5-9]]*) + AC_MSG_RESULT(Using FreeBSD posix ACLs) + AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether FreeBSD POSIX ACLs are available]) + AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available]) + ;; + *linux*) + AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"]) + AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"]) + AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[ + acl_LIBS=$LIBS + LIBS="$LIBS -lacl" + AC_TRY_LINK([#include +#include ], +[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);], +samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no) + LIBS=$acl_LIBS]) + if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then + AC_MSG_RESULT(Using posix ACLs) + AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available]) + AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[ + acl_LIBS=$LIBS + LIBS="$LIBS -lacl" + AC_TRY_LINK([#include +#include ], +[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);], +samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no) + LIBS=$acl_LIBS]) + if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then + AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available]) + fi + fi + ;; + *) + AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"]) + AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[ + acl_LIBS=$LIBS + LIBS="$LIBS -lacl" + AC_TRY_LINK([#include +#include ], +[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);], +samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no) + LIBS=$acl_LIBS]) + if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then + AC_MSG_RESULT(Using posix ACLs) + AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available]) + AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[ + acl_LIBS=$LIBS + LIBS="$LIBS -lacl" + AC_TRY_LINK([#include +#include ], +[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);], +samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no) + LIBS=$acl_LIBS]) + if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then + AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available]) + fi + fi + ;; + esac + ;; + *) + AC_MSG_RESULT(no) + AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available]) + ;; + esac ], + AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in]) + AC_MSG_RESULT(no) +) + +################################################# +# check for AIO support + +AC_MSG_CHECKING(whether to support asynchronous io) +AC_ARG_WITH(aio-support, +[ --with-aio-support Include asynchronous io support (default=no)], +[ case "$withval" in + yes) + + AC_MSG_RESULT(yes) + case "$host_os" in + *) + AC_CHECK_LIB(rt,aio_read,[AIO_LIBS="$ACL_LIBS -lrt"]) + AC_CACHE_CHECK([for asynchronous io support],samba_cv_HAVE_AIO,[ + aio_LIBS=$LIBS + LIBS="$LIBS -lrt" + AC_TRY_LINK([#include +#include ], +[ struct aiocb a; return aio_read(&a);], +samba_cv_HAVE_AIO=yes,samba_cv_HAVE_AIO=no) + LIBS=$aio_LIBS]) + AC_CACHE_CHECK([for 64-bit asynchronous io support],samba_cv_HAVE_AIO64,[ + aio_LIBS=$LIBS + LIBS="$LIBS -lrt" + AC_TRY_LINK([#include +#include ], +[ struct aiocb64 a; return aio_read64(&a);], +samba_cv_HAVE_AIO64=yes,samba_cv_HAVE_AIO64=no) + LIBS=$aio_LIBS]) + if test x"$samba_cv_HAVE_AIO64" = x"yes"; then + AC_DEFINE(HAVE_AIOCB64,1,[Whether 64 bit aio is available]) + AC_DEFINE(WITH_AIO, 1, [Using asynchronous io]) + LIBS="$LIBS -lrt" + elif test x"$samba_cv_HAVE_AIO" = x"yes"; then + AC_DEFINE(WITH_AIO, 1, [Using asynchronous io]) + LIBS="$LIBS -lrt" + fi + + if test x"$samba_cv_HAVE_AIO" = x"yes"; then + AC_MSG_CHECKING(for aio_read) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_read(&a); }], +[AC_DEFINE(HAVE_AIO_READ, 1, [Have aio_read]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_write) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_write(&a); }], +[AC_DEFINE(HAVE_AIO_WRITE, 1, [Have aio_write]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_fsync) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_fsync(1, &a); }], +[AC_DEFINE(HAVE_AIO_FSYNC, 1, [Have aio_fsync]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_return) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_return(&a); }], +[AC_DEFINE(HAVE_AIO_RETURN, 1, [Have aio_return]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_error) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_error(&a); }], +[AC_DEFINE(HAVE_AIO_ERROR, 1, [Have aio_error]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_cancel) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_cancel(1, &a); }], +[AC_DEFINE(HAVE_AIO_CANCEL, 1, [Have aio_cancel]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_suspend) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_suspend(&a, 1, NULL); }], +[AC_DEFINE(HAVE_AIO_SUSPEND, 1, [Have aio_suspend]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + fi + + if test x"$samba_cv_HAVE_AIO64" = x"yes"; then + AC_MSG_CHECKING(for aio_read64) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_read64(&a); }], +[AC_DEFINE(HAVE_AIO_READ64, 1, [Have aio_read64]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_write64) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_write64(&a); }], +[AC_DEFINE(HAVE_AIO_WRITE64, 1, [Have aio_write64]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_fsync64) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_fsync64(1, &a); }], +[AC_DEFINE(HAVE_AIO_FSYNC64, 1, [Have aio_fsync64]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_return64) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_return64(&a); }], +[AC_DEFINE(HAVE_AIO_RETURN64, 1, [Have aio_return64]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_error64) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_error64(&a); }], +[AC_DEFINE(HAVE_AIO_ERROR64, 1, [Have aio_error64]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_cancel64) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_cancel64(1, &a); }], +[AC_DEFINE(HAVE_AIO_CANCEL64, 1, [Have aio_cancel64]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(for aio_suspend64) + AC_LINK_IFELSE([#include +int main() { struct aiocb a; return aio_suspend64(&a, 1, NULL); }], +[AC_DEFINE(HAVE_AIO_SUSPEND64, 1, [Have aio_suspend64]) AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no)]) + fi + ;; + esac + ;; + *) + AC_MSG_RESULT(no) + AC_DEFINE(HAVE_NO_AIO,1,[Whether no asynchronous io support is available]) + ;; + esac ], + AC_DEFINE(HAVE_NO_AIO,1,[Whether no asynchronous io support should be built in]) + AC_MSG_RESULT(no) +) + +################################################# +# check for sendfile support + +with_sendfile_support=yes +AC_MSG_CHECKING(whether to check to support sendfile) +AC_ARG_WITH(sendfile-support, +[ --with-sendfile-support Check for sendfile support (default=yes)], +[ case "$withval" in + yes) + + AC_MSG_RESULT(yes); + + case "$host_os" in + *linux*) + AC_CACHE_CHECK([for linux sendfile64 support],samba_cv_HAVE_SENDFILE64,[ + AC_TRY_LINK([#include ], +[\ +int tofd, fromfd; +off64_t offset; +size_t total; +ssize_t nwritten = sendfile64(tofd, fromfd, &offset, total); +], +samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)]) + + AC_CACHE_CHECK([for linux sendfile support],samba_cv_HAVE_SENDFILE,[ + AC_TRY_LINK([#include ], +[\ +int tofd, fromfd; +off_t offset; +size_t total; +ssize_t nwritten = sendfile(tofd, fromfd, &offset, total); +], +samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)]) + +# Try and cope with broken Linux sendfile.... + AC_CACHE_CHECK([for broken linux sendfile support],samba_cv_HAVE_BROKEN_LINUX_SENDFILE,[ + AC_TRY_LINK([\ +#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) +#undef _FILE_OFFSET_BITS +#endif +#include ], +[\ +int tofd, fromfd; +off_t offset; +size_t total; +ssize_t nwritten = sendfile(tofd, fromfd, &offset, total); +], +samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,samba_cv_HAVE_BROKEN_LINUX_SENDFILE=no)]) + + if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then + AC_DEFINE(HAVE_SENDFILE64,1,[Whether 64-bit sendfile() is available]) + AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used]) + elif test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then + AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available]) + AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used]) + elif test x"$samba_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then + AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used]) + else + AC_MSG_RESULT(no); + fi + + ;; + *freebsd* | *dragonfly* ) + AC_CACHE_CHECK([for freebsd sendfile support],samba_cv_HAVE_SENDFILE,[ + AC_TRY_LINK([\ +#include +#include +#include +#include ], +[\ + int fromfd, tofd, ret, total=0; + off_t offset, nwritten; + struct sf_hdtr hdr; + struct iovec hdtrl; + hdr.headers = &hdtrl; + hdr.hdr_cnt = 1; + hdr.trailers = NULL; + hdr.trl_cnt = 0; + hdtrl.iov_base = NULL; + hdtrl.iov_len = 0; + ret = sendfile(fromfd, tofd, offset, total, &hdr, &nwritten, 0); +], +samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)]) + + if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then + AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() support is available]) + AC_DEFINE(FREEBSD_SENDFILE_API,1,[Whether the FreeBSD sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included]) + else + AC_MSG_RESULT(no); + fi + ;; + + *hpux*) + AC_CACHE_CHECK([for hpux sendfile64 support],samba_cv_HAVE_SENDFILE64,[ + AC_TRY_LINK([\ +#include +#include ], +[\ + int fromfd, tofd; + size_t total=0; + struct iovec hdtrl[2]; + ssize_t nwritten; + off64_t offset; + + hdtrl[0].iov_base = 0; + hdtrl[0].iov_len = 0; + + nwritten = sendfile64(tofd, fromfd, offset, total, &hdtrl[0], 0); +], +samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)]) + if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then + AC_DEFINE(HAVE_SENDFILE64,1,[Whether sendfile64() is available]) + AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included]) + else + AC_MSG_RESULT(no); + fi + + AC_CACHE_CHECK([for hpux sendfile support],samba_cv_HAVE_SENDFILE,[ + AC_TRY_LINK([\ +#include +#include ], +[\ + int fromfd, tofd; + size_t total=0; + struct iovec hdtrl[2]; + ssize_t nwritten; + off_t offset; + + hdtrl[0].iov_base = 0; + hdtrl[0].iov_len = 0; + + nwritten = sendfile(tofd, fromfd, offset, total, &hdtrl[0], 0); +], +samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)]) + if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then + AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available]) + AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included]) + else + AC_MSG_RESULT(no); + fi + ;; + + *solaris*) + AC_CHECK_LIB(sendfile,sendfilev) + AC_CACHE_CHECK([for solaris sendfilev64 support],samba_cv_HAVE_SENDFILEV64,[ + AC_TRY_LINK([\ +#include ], +[\ + int sfvcnt; + size_t xferred; + struct sendfilevec vec[2]; + ssize_t nwritten; + int tofd; + + sfvcnt = 2; + + vec[0].sfv_fd = SFV_FD_SELF; + vec[0].sfv_flag = 0; + vec[0].sfv_off = 0; + vec[0].sfv_len = 0; + + vec[1].sfv_fd = 0; + vec[1].sfv_flag = 0; + vec[1].sfv_off = 0; + vec[1].sfv_len = 0; + nwritten = sendfilev64(tofd, vec, sfvcnt, &xferred); +], +samba_cv_HAVE_SENDFILEV64=yes,samba_cv_HAVE_SENDFILEV64=no)]) + + if test x"$samba_cv_HAVE_SENDFILEV64" = x"yes"; then + AC_DEFINE(HAVE_SENDFILEV64,1,[Whether sendfilev64() is available]) + AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the soloris sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included]) + else + AC_MSG_RESULT(no); + fi + + AC_CACHE_CHECK([for solaris sendfilev support],samba_cv_HAVE_SENDFILEV,[ + AC_TRY_LINK([\ +#include ], +[\ + int sfvcnt; + size_t xferred; + struct sendfilevec vec[2]; + ssize_t nwritten; + int tofd; + + sfvcnt = 2; + + vec[0].sfv_fd = SFV_FD_SELF; + vec[0].sfv_flag = 0; + vec[0].sfv_off = 0; + vec[0].sfv_len = 0; + + vec[1].sfv_fd = 0; + vec[1].sfv_flag = 0; + vec[1].sfv_off = 0; + vec[1].sfv_len = 0; + nwritten = sendfilev(tofd, vec, sfvcnt, &xferred); +], +samba_cv_HAVE_SENDFILEV=yes,samba_cv_HAVE_SENDFILEV=no)]) + + if test x"$samba_cv_HAVE_SENDFILEV" = x"yes"; then + AC_DEFINE(HAVE_SENDFILEV,1,[Whether sendfilev() is available]) + AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the solaris sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether to include sendfile() support]) + else + AC_MSG_RESULT(no); + fi + ;; + *aix*) + AC_CACHE_CHECK([for AIX send_file support],samba_cv_HAVE_SENDFILE,[ + AC_TRY_LINK([\ +#include ], +[\ + int fromfd, tofd; + size_t total=0; + struct sf_parms hdtrl; + ssize_t nwritten; + off64_t offset; + + hdtrl.header_data = 0; + hdtrl.header_length = 0; + hdtrl.file_descriptor = fromfd; + hdtrl.file_offset = 0; + hdtrl.file_bytes = 0; + hdtrl.trailer_data = 0; + hdtrl.trailer_length = 0; + + nwritten = send_file(&tofd, &hdtrl, 0); +], +samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)]) + if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then + AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available]) + AC_DEFINE(AIX_SENDFILE_API,1,[Whether the AIX send_file() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether to include sendfile() support]) + else + AC_MSG_RESULT(no); + fi + ;; + *) + ;; + esac + ;; + *) + AC_MSG_RESULT(no) + ;; + esac ], + AC_MSG_RESULT(yes) +) + + +################################################# +# Check whether winbind is supported on this platform. If so we need to +# build and install client programs, sbin programs and shared libraries + +AC_MSG_CHECKING(whether to build winbind) + +# Initially, the value of $host_os decides whether winbind is supported + +HAVE_WINBIND=yes + +# Define the winbind shared library name and any specific linker flags +# it needs to be built with. + +WINBIND_NSS="nsswitch/libnss_winbind.$SHLIBEXT" +WINBIND_WINS_NSS="nsswitch/libnss_wins.$SHLIBEXT" +WINBIND_NSS_LDSHFLAGS=$LDSHFLAGS + +case "$host_os" in + *linux*) + WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_linux.o" + ;; + *freebsd[[5-9]]*) + # FreeBSD winbind client is implemented as a wrapper around + # the Linux version. + WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_freebsd.o \ + nsswitch/winbind_nss_linux.o" + WINBIND_NSS="nsswitch/nss_winbind.$SHLIBEXT" + WINBIND_WINS_NSS="nsswitch/nss_wins.$SHLIBEXT" + ;; + *irix*) + # IRIX has differently named shared libraries + WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_irix.o" + WINBIND_NSS="nsswitch/libns_winbind.$SHLIBEXT" + WINBIND_WINS_NSS="nsswitch/libns_wins.$SHLIBEXT" + ;; + *solaris*) + # Solaris winbind client is implemented as a wrapper around + # the Linux version. + WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o \ + nsswitch/winbind_nss_linux.o" + WINBIND_NSS_EXTRA_LIBS="-lsocket" + ;; + *hpux11*) + WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o" + ;; + *aix*) + # AIX has even differently named shared libraries. No + # WINS support has been implemented yet. + WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_aix.o" + WINBIND_NSS_LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-ewb_aix_init" + WINBIND_NSS="nsswitch/WINBIND" + WINBIND_WINS_NSS="" + ;; + *) + HAVE_WINBIND=no + winbind_no_reason=", unsupported on $host_os" + ;; +esac + +AC_SUBST(WINBIND_NSS) +AC_SUBST(WINBIND_WINS_NSS) +AC_SUBST(WINBIND_NSS_LDSHFLAGS) +AC_SUBST(WINBIND_NSS_EXTRA_OBJS) +AC_SUBST(WINBIND_NSS_EXTRA_LIBS) + +# Check the setting of --with-winbind + +AC_ARG_WITH(winbind, +[ --with-winbind Build winbind (default, if supported by OS)], +[ + case "$withval" in + yes) + HAVE_WINBIND=yes + ;; + no) + HAVE_WINBIND=no + winbind_reason="" + ;; + esac ], +) + +# We need unix domain sockets for winbind + +if test x"$HAVE_WINBIND" = x"yes"; then + if test x"$samba_cv_unixsocket" = x"no"; then + winbind_no_reason=", no unix domain socket support on $host_os" + HAVE_WINBIND=no + fi +fi + +# Display test results + +if test x"$HAVE_WINBIND" = x"yes"; then + AC_MSG_RESULT(yes) + AC_DEFINE(WITH_WINBIND,1,[Whether to build winbind]) + + EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/wbinfo\$(EXEEXT)" + EXTRA_SBIN_PROGS="$EXTRA_SBIN_PROGS bin/winbindd\$(EXEEXT)" + if test $BLDSHARED = true; then + SHLIB_PROGS="$SHLIB_PROGS $WINBIND_NSS $WINBIND_WINS_NSS" + + if test x"$with_pam" = x"yes"; then + SHLIB_PROGS="$SHLIB_PROGS nsswitch/pam_winbind.$SHLIBEXT" + fi + fi +else + AC_MSG_RESULT(no$winbind_no_reason) +fi + +# Solaris has some extra fields in struct passwd that need to be +# initialised otherwise nscd crashes. + +AC_CHECK_MEMBER(struct passwd.pw_comment, + AC_DEFINE(HAVE_PASSWD_PW_COMMENT, 1, [Defined if struct passwd has pw_comment field]),, + [#include ]) + +AC_CHECK_MEMBER(struct passwd.pw_age, + AC_DEFINE(HAVE_PASSWD_PW_AGE, 1, [Defined if struct passwd has pw_age field]),, + [#include ]) + +# AIX 4.3.x and 5.1 do not have as many members in +# struct secmethod_table as AIX 5.2 +AC_CHECK_MEMBERS([struct secmethod_table.method_attrlist], , , + [#include ]) +AC_CHECK_MEMBERS([struct secmethod_table.method_version], , , + [#include ]) + + +################################################# +# Check to see if we should use the included popt + +AC_ARG_WITH(included-popt, +[ --with-included-popt use bundled popt library, not from system], +[ + case "$withval" in + yes) + INCLUDED_POPT=yes + ;; + no) + INCLUDED_POPT=no + ;; + esac ], +) +if test x"$INCLUDED_POPT" != x"yes"; then + AC_CHECK_LIB(popt, poptGetContext, + INCLUDED_POPT=no, INCLUDED_POPT=yes) +fi + +AC_MSG_CHECKING(whether to use included popt) +if test x"$INCLUDED_POPT" = x"yes"; then + AC_MSG_RESULT(yes) + BUILD_POPT='$(POPT_OBJS)' + POPTLIBS='$(POPT_OBJS)' + FLAGS1="-I$srcdir/popt" +else + AC_MSG_RESULT(no) + BUILD_POPT="" + POPTLIBS="-lpopt" +fi +AC_SUBST(BUILD_POPT) +AC_SUBST(POPTLIBS) +AC_SUBST(FLAGS1) + +################################################# +# Check if the user wants Python + +# At the moment, you can use this to set which Python binary to link +# against. (Libraries built for Python2.2 can't be used by 2.1, +# though they can coexist in different directories.) In the future +# this might make the Python stuff be built by default. + +# Defaulting python breaks the clean target if python isn't installed + +PYTHON= + +AC_ARG_WITH(python, +[ --with-python=PYTHONNAME build Python libraries], +[ case "${withval-python}" in + yes) + PYTHON=python + EXTRA_ALL_TARGETS="$EXTRA_ALL_TARGETS python_ext" + ;; + no) + PYTHON= + ;; + *) + PYTHON=${withval-python} + ;; + esac ]) +AC_SUBST(PYTHON) + +for i in `echo $default_static_modules | sed -e 's/,/ /g'` +do + eval MODULE_DEFAULT_$i=STATIC +done + +for i in `echo $default_shared_modules | sed -e 's/,/ /g'` +do + dnl Fall back to static if we cannot build shared libraries + eval MODULE_DEFAULT_$i=STATIC + + if test $BLDSHARED = true; then + eval MODULE_DEFAULT_$i=SHARED + fi +done + +dnl Always built these modules static +MODULE_pdb_guest=STATIC +MODULE_rpc_spoolss=STATIC +MODULE_rpc_srv=STATIC +MODULE_idmap_tdb=STATIC + +AC_ARG_WITH(static-modules, +[ --with-static-modules=MODULES Comma-seperated list of names of modules to statically link in], +[ if test $withval; then + for i in `echo $withval | sed -e 's/,/ /g'` + do + eval MODULE_$i=STATIC + done +fi ]) + +AC_ARG_WITH(shared-modules, +[ --with-shared-modules=MODULES Comma-seperated list of names of modules to build shared], +[ if test $withval; then + for i in `echo $withval | sed -e 's/,/ /g'` + do + eval MODULE_$i=SHARED + done +fi ]) + +########################################################################### +## contributed pdb_modules + +SMB_MODULE(pdb_xml, passdb/pdb_xml.o, "bin/xml.$SHLIBEXT", PDB, + [ PASSDB_LIBS="$PASSDB_LIBS $XML_LIBS" ] ) +SMB_MODULE(pdb_mysql, passdb/pdb_mysql.o, "bin/mysql.$SHLIBEXT", PDB, + [ PASSDB_LIBS="$PASSDB_LIBS $MYSQL_LIBS" ] ) +SMB_MODULE(pdb_pgsql, passdb/pdb_pgsql.o, "bin/pgsql.$SHLIBEXT", PDB, + [ PASSDB_LIBS="$PASSDB_LIBS $PGSQL_LIBS" ] ) + +## end of contributed pdb_modules +########################################################################### + +SMB_MODULE(pdb_ldap, passdb/pdb_ldap.o passdb/pdb_nds.o, "bin/ldapsam.$SHLIBEXT", PDB, + [ PASSDB_LIBS="$PASSDB_LIBS $LDAP_LIBS" ] ) +SMB_MODULE(pdb_smbpasswd, passdb/pdb_smbpasswd.o, "bin/smbpasswd.$SHLIBEXT", PDB) +SMB_MODULE(pdb_tdbsam, passdb/pdb_tdb.o, "bin/tdbsam.$SHLIBEXT", PDB) +SMB_MODULE(pdb_guest, passdb/pdb_guest.o, "bin/guest.$SHLIBEXT", PDB) +SMB_SUBSYSTEM(PDB,passdb/pdb_interface.o) + +SMB_MODULE(rpc_lsa, \$(RPC_LSA_OBJ), "bin/librpc_lsarpc.$SHLIBEXT", RPC) +SMB_MODULE(rpc_reg, \$(RPC_REG_OBJ), "bin/librpc_winreg.$SHLIBEXT", RPC) +SMB_MODULE(rpc_lsa_ds, \$(RPC_LSA_DS_OBJ), "bin/librpc_lsa_ds.$SHLIBEXT", RPC) +SMB_MODULE(rpc_wks, \$(RPC_WKS_OBJ), "bin/librpc_wkssvc.$SHLIBEXT", RPC) +SMB_MODULE(rpc_svcctl, \$(RPC_SVCCTL_OBJ), "bin/librpc_svcctl.$SHLIBEXT", RPC) +SMB_MODULE(rpc_net, \$(RPC_NETLOG_OBJ), "bin/librpc_NETLOGON.$SHLIBEXT", RPC) +SMB_MODULE(rpc_dfs, \$(RPC_DFS_OBJ), "bin/librpc_netdfs.$SHLIBEXT", RPC) +SMB_MODULE(rpc_srv, \$(RPC_SVC_OBJ), "bin/librpc_srvsvc.$SHLIBEXT", RPC) +SMB_MODULE(rpc_spoolss, \$(RPC_SPOOLSS_OBJ), "bin/librpc_spoolss.$SHLIBEXT", RPC) +SMB_MODULE(rpc_eventlog, \$(RPC_EVENTLOG_OBJ), "bin/librpc_eventlog.$SHLIBEXT", RPC) +SMB_MODULE(rpc_samr, \$(RPC_SAMR_OBJ), "bin/librpc_samr.$SHLIBEXT", RPC) +SMB_MODULE(rpc_echo, \$(RPC_ECHO_OBJ), "bin/librpc_echo.$SHLIBEXT", RPC) +SMB_SUBSYSTEM(RPC,smbd/server.o) + +SMB_MODULE(idmap_ldap, sam/idmap_ldap.o, "bin/idmap_ldap.$SHLIBEXT", IDMAP) +SMB_MODULE(idmap_tdb, sam/idmap_tdb.o, "bin/idmap_tdb.$SHLIBEXT", IDMAP) +SMB_MODULE(idmap_rid, sam/idmap_rid.o, "bin/idmap_rid.$SHLIBEXT", IDMAP) +SMB_MODULE(idmap_ad, sam/idmap_ad.o, "bin/idmap_ad.$SHLIBEXT", IDMAP) +SMB_SUBSYSTEM(IDMAP,sam/idmap.o) + +SMB_MODULE(charset_weird, modules/weird.o, "bin/weird.$SHLIBEXT", CHARSET) +SMB_MODULE(charset_CP850, modules/CP850.o, "bin/CP850.$SHLIBEXT", CHARSET) +SMB_MODULE(charset_CP437, modules/CP437.o, "bin/CP437.$SHLIBEXT", CHARSET) +SMB_MODULE(charset_macosxfs, modules/charset_macosxfs.o,"bin/macosxfs.$SHLIBEXT", CHARSET) +SMB_SUBSYSTEM(CHARSET,lib/iconv.o) + +SMB_MODULE(auth_rhosts, \$(AUTH_RHOSTS_OBJ), "bin/rhosts.$SHLIBEXT", AUTH) +SMB_MODULE(auth_sam, \$(AUTH_SAM_OBJ), "bin/sam.$SHLIBEXT", AUTH) +SMB_MODULE(auth_unix, \$(AUTH_UNIX_OBJ), "bin/unix.$SHLIBEXT", AUTH) +SMB_MODULE(auth_winbind, \$(AUTH_WINBIND_OBJ), "bin/winbind.$SHLIBEXT", AUTH) +SMB_MODULE(auth_server, \$(AUTH_SERVER_OBJ), "bin/smbserver.$SHLIBEXT", AUTH) +SMB_MODULE(auth_domain, \$(AUTH_DOMAIN_OBJ), "bin/domain.$SHLIBEXT", AUTH) +SMB_MODULE(auth_builtin, \$(AUTH_BUILTIN_OBJ), "bin/builtin.$SHLIBEXT", AUTH) +SMB_SUBSYSTEM(AUTH,auth/auth.o) + +SMB_MODULE(vfs_recycle, \$(VFS_RECYCLE_OBJ), "bin/recycle.$SHLIBEXT", VFS) +SMB_MODULE(vfs_audit, \$(VFS_AUDIT_OBJ), "bin/audit.$SHLIBEXT", VFS) +SMB_MODULE(vfs_extd_audit, \$(VFS_EXTD_AUDIT_OBJ), "bin/extd_audit.$SHLIBEXT", VFS) +SMB_MODULE(vfs_full_audit, \$(VFS_FULL_AUDIT_OBJ), "bin/full_audit.$SHLIBEXT", VFS) +SMB_MODULE(vfs_netatalk, \$(VFS_NETATALK_OBJ), "bin/netatalk.$SHLIBEXT", VFS) +SMB_MODULE(vfs_fake_perms, \$(VFS_FAKE_PERMS_OBJ), "bin/fake_perms.$SHLIBEXT", VFS) +SMB_MODULE(vfs_default_quota, \$(VFS_DEFAULT_QUOTA_OBJ), "bin/default_quota.$SHLIBEXT", VFS) +SMB_MODULE(vfs_readonly, \$(VFS_READONLY_OBJ), "bin/readonly.$SHLIBEXT", VFS) +SMB_MODULE(vfs_cap, \$(VFS_CAP_OBJ), "bin/cap.$SHLIBEXT", VFS) +SMB_MODULE(vfs_expand_msdfs, \$(VFS_EXPAND_MSDFS_OBJ), "bin/expand_msdfs.$SHLIBEXT", VFS) +SMB_MODULE(vfs_shadow_copy, \$(VFS_SHADOW_COPY_OBJ), "bin/shadow_copy.$SHLIBEXT", VFS) +SMB_MODULE(vfs_afsacl, \$(VFS_AFSACL_OBJ), "bin/afsacl.$SHLIBEXT", VFS) +SMB_MODULE(vfs_catia, \$(VFS_AFSACL_OBJ), "bin/catia.$SHLIBEXT", VFS) +SMB_SUBSYSTEM(VFS,smbd/vfs.o) + +AC_DEFINE_UNQUOTED(STRING_STATIC_MODULES, "$string_static_modules", [String list of builtin modules]) + +################################################# +# do extra things if we are running insure + +if test "${ac_cv_prog_CC}" = "insure"; then + CPPFLAGS="$CPPFLAGS -D__INSURE__" +fi + +################################################# +# Display summary of libraries detected + +AC_MSG_RESULT([Using libraries:]) +AC_MSG_RESULT([ LIBS = $LIBS]) +if test x"$with_ads_support" != x"no"; then + AC_MSG_RESULT([ KRB5_LIBS = $KRB5_LIBS]) +fi +if test x"$with_ldap_support" != x"no"; then + AC_MSG_RESULT([ LDAP_LIBS = $LDAP_LIBS]) +fi +AC_MSG_RESULT([ AUTH_LIBS = $AUTH_LIBS]) + +################################################# +# final configure stuff + +AC_MSG_CHECKING([configure summary]) +AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"], + AC_MSG_RESULT(yes), + AC_MSG_ERROR([summary failure. Aborting config]); exit 1;, + AC_MSG_WARN([cannot run when cross-compiling])) + +builddir=`pwd` +AC_SUBST(builddir) + +dnl Remove -L/usr/lib/? from LDFLAGS and LIBS +LIB_REMOVE_USR_LIB(LDFLAGS) +LIB_REMOVE_USR_LIB(LIBS) + +dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS +CFLAGS_REMOVE_USR_INCLUDE(CFLAGS) +CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS) + +AC_OUTPUT(include/stamp-h Makefile script/findsmb smbadduser script/gen-8bit-gap.sh) + +################################################# +# Print very concise instructions on building/use +if test "x$enable_dmalloc" = xyes +then + AC_MSG_RESULT([Note: The dmalloc debug library will be included. To turn it on use]) + AC_MSG_RESULT([ \$ eval \`dmalloc samba\`.]) +fi diff --git a/release-3-0-20b/source/include/smb.h b/release-3-0-20b/source/include/smb.h new file mode 100644 index 00000000000..47d65abfe7f --- /dev/null +++ b/release-3-0-20b/source/include/smb.h @@ -0,0 +1,1766 @@ +/* + Unix SMB/CIFS implementation. + SMB parameters and setup, plus a whole lot more. + + Copyright (C) Andrew Tridgell 1992-2000 + Copyright (C) John H Terpstra 1996-2002 + Copyright (C) Luke Kenneth Casson Leighton 1996-2000 + Copyright (C) Paul Ashton 1998-2000 + Copyright (C) Simo Sorce 2001-2002 + Copyright (C) Martin Pool 2002 + + 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _SMB_H +#define _SMB_H + +/* logged when starting the various Samba daemons */ +#define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2005" + + +#if defined(LARGE_SMB_OFF_T) +#define BUFFER_SIZE (128*1024) +#else /* no large readwrite possible */ +#define BUFFER_SIZE (0xFFFF) +#endif + +#define SAFETY_MARGIN 1024 +#define LARGE_WRITEX_HDR_SIZE 65 + +#define NMB_PORT 137 +#define DGRAM_PORT 138 +#define SMB_PORT1 445 +#define SMB_PORT2 139 +#define SMB_PORTS "445 139" + +#define Undefined (-1) +#define False (0) +#define True (1) +#define Auto (2) +#define Required (3) + +#ifndef _BOOL +typedef int BOOL; +#define _BOOL /* So we don't typedef BOOL again in vfs.h */ +#endif + +#define SIZEOFWORD 2 + +#ifndef DEF_CREATE_MASK +#define DEF_CREATE_MASK (0755) +#endif + +/* string manipulation flags - see clistr.c and srvstr.c */ +#define STR_TERMINATE 1 +#define STR_UPPER 2 +#define STR_ASCII 4 +#define STR_UNICODE 8 +#define STR_NOALIGN 16 +#define STR_TERMINATE_ASCII 128 + +/* how long to wait for secondary SMB packets (milli-seconds) */ +#define SMB_SECONDARY_WAIT (60*1000) + +/* Debugging stuff */ +#include "debug.h" + +/* this defines the error codes that receive_smb can put in smb_read_error */ +#define READ_TIMEOUT 1 +#define READ_EOF 2 +#define READ_ERROR 3 +#define WRITE_ERROR 4 /* This error code can go into the client smb_rw_error. */ +#define READ_BAD_SIG 5 +#define DO_NOT_DO_TDIS 6 /* cli_close_connection() check for this when smbfs wants to keep tree connected */ + +#define DIR_STRUCT_SIZE 43 + +/* these define the attribute byte as seen by DOS */ +#define aRONLY (1L<<0) /* 0x01 */ +#define aHIDDEN (1L<<1) /* 0x02 */ +#define aSYSTEM (1L<<2) /* 0x04 */ +#define aVOLID (1L<<3) /* 0x08 */ +#define aDIR (1L<<4) /* 0x10 */ +#define aARCH (1L<<5) /* 0x20 */ + +/* deny modes */ +#define DENY_DOS 0 +#define DENY_ALL 1 +#define DENY_WRITE 2 +#define DENY_READ 3 +#define DENY_NONE 4 +#define DENY_FCB 7 + +/* open modes */ +#define DOS_OPEN_RDONLY 0 +#define DOS_OPEN_WRONLY 1 +#define DOS_OPEN_RDWR 2 +#define DOS_OPEN_EXEC 3 +#define DOS_OPEN_FCB 0xF + +/* define shifts and masks for share and open modes. */ +#define OPENX_MODE_MASK 0xF +#define DENY_MODE_SHIFT 4 +#define DENY_MODE_MASK 0x7 +#define GET_OPENX_MODE(x) ((x) & OPENX_MODE_MASK) +#define SET_OPENX_MODE(x) ((x) & OPENX_MODE_MASK) +#define GET_DENY_MODE(x) (((x)>>DENY_MODE_SHIFT) & DENY_MODE_MASK) +#define SET_DENY_MODE(x) (((x) & DENY_MODE_MASK) <