diff options
-rw-r--r-- | libsmbclient.diff | 102 | ||||
-rwxr-xr-x | mktarball.sh | 30 | ||||
-rw-r--r-- | nmb.init | 114 | ||||
-rw-r--r-- | pam_winbind.conf | 38 | ||||
-rw-r--r-- | samba.log | 7 | ||||
-rw-r--r-- | samba.pamd | 6 | ||||
-rw-r--r-- | samba.sysconfig | 6 | ||||
-rw-r--r-- | samba.xinetd | 15 | ||||
-rw-r--r-- | samba40.spec | 880 | ||||
-rw-r--r-- | smb.conf.default | 315 | ||||
-rw-r--r-- | smb.init | 114 | ||||
-rw-r--r-- | swat.desktop | 8 | ||||
-rw-r--r-- | winbind.init | 102 |
13 files changed, 1737 insertions, 0 deletions
diff --git a/libsmbclient.diff b/libsmbclient.diff new file mode 100644 index 0000000..25b1bfa --- /dev/null +++ b/libsmbclient.diff @@ -0,0 +1,102 @@ + source3/wscript_build | 6 +++--- + source4/client/wscript_build | 13 ------------- + source4/torture/libsmbclient/wscript_build | 2 +- + source4/wscript_build | 13 +++++++++++++ + wscript_build | 2 +- + 5 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/source3/wscript_build b/source3/wscript_build +index bca1cdf..4bedbfe 100755 +--- a/source3/wscript_build ++++ b/source3/wscript_build +@@ -675,7 +675,7 @@ bld.SAMBA3_LIBRARY('netapi', + vnum='0', + vars=locals()) + +-bld.SAMBA3_LIBRARY('libsmb/smbclient', ++bld.SAMBA3_LIBRARY('smbclient', + source=LIBSMBCLIENT_SRC, + public_deps='''talloc tdb_compat wbclient cap param smbd_shim libsmb KRBCLIENT pdb SMBLDAP + LIBMSRPC_GEN msrpc3 libcli_lsa3 RPC_NDR_SRVSVC popt_samba3''', +@@ -1175,7 +1175,7 @@ bld.SAMBA3_BINARY('client/smbclient' + bld.env.suffix3, + source=CLIENT_SRC, + deps='''talloc tdb_compat cap popt_samba3 pdb libsmb smbd_shim + param wbclient param KRBCLIENT LIBMSRPC_GEN +- msrpc3 SMBREADLINE libsmb/smbclient RPC_NDR_SRVSVC INIT_LSA ++ msrpc3 SMBREADLINE smbclient RPC_NDR_SRVSVC INIT_LSA + cli_smb_common''', + vars=locals()) + +@@ -1252,7 +1252,7 @@ bld.SAMBA3_BINARY('pdbedit', + + bld.SAMBA3_BINARY('smbget', + source=SMBGET_SRC, +- deps='''talloc tdb_compat libsmb/smbclient popt_samba3''', ++ deps='''talloc tdb_compat smbclient popt_samba3''', + vars=locals()) + + bld.SAMBA3_BINARY('nmblookup' + bld.env.suffix3, +diff --git a/source4/client/wscript_build b/source4/client/wscript_build +deleted file mode 100644 +index d1622b3..0000000 +--- a/source4/client/wscript_build ++++ /dev/null +@@ -1,13 +0,0 @@ +-#!/usr/bin/env python +- +-bld.SAMBA_BINARY('smbclient', +- source='client.c', +- deps='samba-hostconfig SMBREADLINE samba-util LIBCLI_SMB RPC_NDR_SRVSVC LIBCLI_LSA popt POPT_SAMBA POPT_CREDENTIALS smbclient-raw' +- ) +- +- +-bld.SAMBA_BINARY('cifsdd', +- source='cifsdd.c cifsddio.c', +- deps='samba-hostconfig LIBCLI_SMB popt POPT_SAMBA POPT_CREDENTIALS' +- ) +- +diff --git a/source4/torture/libsmbclient/wscript_build b/source4/torture/libsmbclient/wscript_build +index 8b2c516..40c7932 100644 +--- a/source4/torture/libsmbclient/wscript_build ++++ b/source4/torture/libsmbclient/wscript_build +@@ -6,7 +6,7 @@ bld.SAMBA_MODULE('TORTURE_LIBSMBCLIENT', + autoproto='proto.h', + subsystem='smbtorture', + init_function='torture_libsmbclient_init', +- deps='POPT_CREDENTIALS libsmb/smbclient', ++ deps='POPT_CREDENTIALS smbclient', + internal_module=True + ) + +diff --git a/source4/wscript_build b/source4/wscript_build +new file mode 100644 +index 0000000..a7b8932 +--- /dev/null ++++ b/source4/wscript_build +@@ -0,0 +1,13 @@ ++#!/usr/bin/env python ++ ++bld.SAMBA_BINARY('client/smbclient', ++ source='client/client.c', ++ deps='samba-hostconfig SMBREADLINE samba-util LIBCLI_SMB RPC_NDR_SRVSVC LIBCLI_LSA popt POPT_SAMBA POPT_CREDENTIALS smbclient-raw' ++ ) ++ ++ ++bld.SAMBA_BINARY('client/cifsdd', ++ source='client/cifsdd.c client/cifsddio.c', ++ deps='samba-hostconfig LIBCLI_SMB popt POPT_SAMBA POPT_CREDENTIALS' ++ ) ++ +diff --git a/wscript_build b/wscript_build +index 1b6fb31..4f61820 100644 +--- a/wscript_build ++++ b/wscript_build +@@ -90,7 +90,7 @@ bld.RECURSE('source4/ntvfs') + bld.RECURSE('source4/ntptr') + bld.RECURSE('source4/torture') + bld.RECURSE('librpc') +-bld.RECURSE('source4/client') ++bld.RECURSE('source4') + bld.RECURSE('source4/libcli') + bld.RECURSE('libcli/smb') + bld.RECURSE('libcli/util') diff --git a/mktarball.sh b/mktarball.sh new file mode 100755 index 0000000..c69a8bd --- /dev/null +++ b/mktarball.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +dir="samba-4.0" +date=`date +%y%m%d%H%M%S` +hash="" + +rm -f samba-4.0*.tar.bz2 +rm -f ~/rpmbuild/SOURCES/samba-4.0*.tar.bz2 + +cd $dir +git fetch && git reset --hard origin/master || exit 0 +hash=`git show --abbrev-commit --pretty=format:"%h" | head -1` +cd .. + +version=$date$hash +tar cfj samba-4.0-$version.tar.bz2 --exclude=.git $dir + +sed --in-place s/^Version:.*/Version:\ $version/ samba40.spec + +cp samba-4.0-$version.tar.bz2 ~/rpmbuild/SOURCES + +talloc_version=`grep ^VERSION $dir/lib/talloc/wscript | cut -d "'" -f 2` +tevent_version=`grep ^VERSION $dir/lib/tevent/wscript | cut -d "'" -f 2` +tdb_version=`grep ^VERSION $dir/lib/tdb/wscript | cut -d "'" -f 2` +ldb_version=`grep ^VERSION $dir/lib/ldb/wscript | cut -d "'" -f 2` + +sed --in-place s/^%define\ talloc_version.*/%define\ talloc_version\ $talloc_version/ samba40.spec +sed --in-place s/^%define\ tevent_version.*/%define\ tevent_version\ $tevent_version/ samba40.spec +sed --in-place s/^%define\ tdb_version.*/%define\ tdb_version\ $tdb_version/ samba40.spec +sed --in-place s/^%define\ ldb_version.*/%define\ ldb_version\ $ldb_version/ samba40.spec diff --git a/nmb.init b/nmb.init new file mode 100644 index 0000000..6234ff9 --- /dev/null +++ b/nmb.init @@ -0,0 +1,114 @@ +#!/bin/sh +# +# chkconfig: - 91 35 +# description: Starts and stops the Samba smbd and nmbd daemons \ +# used to provide SMB network services. +# +# pidfile: /var/run/samba/nmbd.pid +# config: /etc/samba/smb.conf + + +# Source function library. +if [ -f /etc/init.d/functions ] ; then + . /etc/init.d/functions +elif [ -f /etc/rc.d/init.d/functions ] ; then + . /etc/rc.d/init.d/functions +else + exit 1 +fi + +# Avoid using root's TMPDIR +unset TMPDIR + +# Source networking configuration. +. /etc/sysconfig/network + +if [ -f /etc/sysconfig/samba ]; then + . /etc/sysconfig/samba +fi + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 1 + +# Check that smb.conf exists. +[ -f /etc/samba/smb.conf ] || exit 6 + +RETVAL=0 + + +start() { + KIND="NMB" + echo -n $"Starting $KIND services: " + daemon nmbd $NMBDOPTIONS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nmb || \ + RETVAL=1 + return $RETVAL +} + +stop() { + KIND="NMB" + echo -n $"Shutting down $KIND services: " + killproc nmbd + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/nmb + return $RETVAL +} + +restart() { + stop + start +} + +reload() { + echo -n $"Reloading smb.conf file: " + killproc nmbd -HUP + RETVAL=$? + echo + return $RETVAL +} + +rhstatus() { + status -l nmb nmbd + return $? +} + + +# Allow status as non-root. +if [ "$1" = status ]; then + rhstatus + exit $? +fi + +# Check that we can write to it... so non-root users stop here +[ -w /etc/samba/smb.conf ] || exit 4 + + + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + status) + rhstatus + ;; + condrestart) + [ -f /var/lock/subsys/nmb ] && restart || : + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}" + exit 2 +esac + +exit $? diff --git a/pam_winbind.conf b/pam_winbind.conf new file mode 100644 index 0000000..dd0b112 --- /dev/null +++ b/pam_winbind.conf @@ -0,0 +1,38 @@ +# +# pam_winbind configuration file +# +# /etc/security/pam_winbind.conf +# + +[global] + +# turn on debugging +;debug = no + +# turn on extended PAM state debugging +;debug_state = no + +# request a cached login if possible +# (needs "winbind offline logon = yes" in smb.conf) +;cached_login = no + +# authenticate using kerberos +;krb5_auth = no + +# when using kerberos, request a "FILE" krb5 credential cache type +# (leave empty to just do krb5 authentication but not have a ticket +# afterwards) +;krb5_ccache_type = + +# make successful authentication dependend on membership of one SID +# (can also take a name) +;require_membership_of = + +# password expiry warning period in days +;warn_pwd_expire = 14 + +# omit pam conversations +;silent = no + +# create homedirectory on the fly +;mkhomedir = no diff --git a/samba.log b/samba.log new file mode 100644 index 0000000..6ccd04d --- /dev/null +++ b/samba.log @@ -0,0 +1,7 @@ +/var/log/samba/* { + notifempty + olddir /var/log/samba/old + missingok + sharedscripts + copytruncate +} diff --git a/samba.pamd b/samba.pamd new file mode 100644 index 0000000..66cd2a9 --- /dev/null +++ b/samba.pamd @@ -0,0 +1,6 @@ +#%PAM-1.0 +auth required pam_nologin.so +auth include password-auth +account include password-auth +session include password-auth +password include password-auth diff --git a/samba.sysconfig b/samba.sysconfig new file mode 100644 index 0000000..944b72f --- /dev/null +++ b/samba.sysconfig @@ -0,0 +1,6 @@ +# Options to smbd +SMBDOPTIONS="-D" +# Options to nmbd +NMBDOPTIONS="-D" +# Options for winbindd +WINBINDOPTIONS="" diff --git a/samba.xinetd b/samba.xinetd new file mode 100644 index 0000000..8b62348 --- /dev/null +++ b/samba.xinetd @@ -0,0 +1,15 @@ +# default: off +# description: SWAT is the Samba Web Admin Tool. Use swat \ +# to configure your Samba server. To use SWAT, \ +# connect to port 901 with your favorite web browser. +service swat +{ + port = 901 + socket_type = stream + wait = no + only_from = 127.0.0.1 + user = root + server = /usr/sbin/swat + log_on_failure += USERID + disable = yes +} diff --git a/samba40.spec b/samba40.spec new file mode 100644 index 0000000..e6cc16f --- /dev/null +++ b/samba40.spec @@ -0,0 +1,880 @@ +%define talloc_version 2.0.6 +%define tdb_version 1.2.9 +%define tevent_version 0.9.14 +%define ldb_version 1.1.2 + +Name: samba-4.0 +Version: 11091310522185598e6 +Release: 1%{?dist} +Summary: Samba + +Group: System Environment/Daemons +License: GPLv3 +URL: http://www.samba.org/ +Source0: %{name}-%{version}.tar.bz2 + +# Red Hat specific replacement-files +Source1: samba.log +Source2: samba.xinetd +Source3: swat.desktop +Source4: samba.sysconfig +Source5: smb.init +Source6: samba.pamd +#Source7: smbprint +Source8: winbind.init +Source9: smb.conf.default +Source10: nmb.init +Source11: pam_winbind.conf + +Patch1: libsmbclient.diff + +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +Requires(pre): /usr/sbin/groupadd +Requires(post): /sbin/chkconfig, /sbin/service +Requires(preun): /sbin/chkconfig, /sbin/service +Requires(pre): %{name}-common = %{version}-%{release} +Requires: logrotate +Requires: pam +Requires: perl(Parse::Yapp) +BuildRequires: autoconf +BuildRequires: ctdb-devel +BuildRequires: cups-devel +BuildRequires: docbook-style-xsl +BuildRequires: e2fsprogs-devel +BuildRequires: gawk +BuildRequires: krb5-devel +BuildRequires: libacl-devel +BuildRequires: libaio-devel +BuildRequires: libattr-devel +BuildRequires: libcap-devel +BuildRequires: libuuid-devel +BuildRequires: libxslt +BuildRequires: ncurses-devel +BuildRequires: openldap-devel +BuildRequires: pam-devel +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(Parse::Yapp) +BuildRequires: popt-devel +BuildRequires: python-devel +BuildRequires: quota-devel +BuildRequires: readline-devel +BuildRequires: sed +BuildRequires: zlib-devel >= 1.2.3 + +#BuildRequires: libtalloc-devel >= %{talloc_version} +#BuildRequires: pytalloc-devel >= %{talloc_version} +BuildRequires: libtdb-devel >= %{tdb_version} +#BuildRequires: libtevent-devel >= %{tevent_version} +#BuildRequires: libldb-devel >= %{ldb_version} +#BuildRequires: pyldb-devel >= %{ldb_version} + +%description + +%package client +Summary: Samba client programs +Group: Applications/System +Requires: %{name}-common = %{version}-%{release} +Requires: %{name}-libs = %{version}-%{release} + +%description client +The %{name}-client package provides some SMB/CIFS clients to complement +the built-in SMB/CIFS filesystem in Linux. These clients allow access +of SMB/CIFS shares and printing to SMB/CIFS printers. + +%package libs +Summary: Samba libraries +Group: Applications/System +Requires: %{name}-common = %{version}-%{release} + +%description libs +The %{name}-libs package contains the libraries needed by programs that +link against the SMB, RPC and other protocols provided by the Samba suite. + +%package python +Summary: Samba Python libraries +Group: Applications/System +Requires: %{name}-libs = %{version}-%{release} + +%description python +The %{name}-python package contains the Python libraries needed by programs +that use SMB, RPC and other Samba provided protocols in Python programs. + +%package devel +Summary: Developer tools for Samba libraries +Group: Development/Libraries +Requires: %{name}-libs = %{version}-%{release} + +%description devel +The %{name}-devel package contains the header files for the libraries +needed to develop programs that link against the SMB, RPC and other +libraries in the Samba suite. + +%package pidl +Summary: Perl IDL compiler +Group: Development/Tools +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) + +%description pidl +The %{name}-pidl package contains the Perl IDL compiler used by Samba +and Wireshark to parse IDL and similar protocols + +%package common +Summary: Files used by both Samba servers and clients +Group: Applications/System +Requires: %{name}-libs = %{version}-%{release} + +%description common +%{Name}-common provides files necessary for both the server and client +packages of Samba. + +%package test +Summary: Testing tools for Samba servers and clients +Group: Applications/System + +%description test +%{Name}-test provides testing tools for both the server and client +packages of Samba. + +%package winbind +Summary: Samba winbind +Group: Applications/System +Requires: %{name} = %{version}-%{release} + +%description winbind +The samba-winbind package provides the winbind NSS library, and some +client tools. Winbind enables Linux to be a full member in Windows +domains and to use Windows user and group accounts on Linux. + +%package winbind-krb5-locator +Summary: Samba winbind krb5 locator +Requires: samba-winbind-clients = %{epoch}:%{samba_version}-%{release} +Group: Applications/System + +%description winbind-krb5-locator +The winbind krb5 locator is a plugin for the system kerberos library to allow +the local kerberos library to use the same KDC as samba and winbind use + +%package winbind-clients +Summary: Samba winbind clients +Group: Applications/System + +%description winbind-clients +The samba-winbind-clients package provides the NSS library and a PAM +module necessary to communicate to the Winbind Daemon + + +#%package winbind-devel +#Summary: Developer tools for the winbind library +#Group: Development +#Requires: samba-winbind = %{epoch}:%{samba_version}-%{release} + +#%description winbind-devel +#The samba-winbind package provides developer tools for the wbclient library. + +%package swat +Summary: The Samba SMB server Web configuration program +Group: Applications/System +Requires: samba = %{epoch}:%{samba_version}-%{release}, xinetd + +%description swat +The samba-swat package includes the new SWAT (Samba Web Administration +Tool), for remotely managing Samba's smb.conf file using your favorite +Web browser. + +%package -n libsmbclient +Summary: The SMB client library +Group: Applications/System + +%description -n libsmbclient +The libsmbclient contains the SMB client library from the Samba suite. + + +%package -n libsmbclient-devel +Summary: Developer tools for the SMB client library +Group: Development +Requires: libsmbclient = %{epoch}:%{samba_version}-%{release} + +%description -n libsmbclient-devel +The libsmbclient-devel package contains the header files and libraries needed to +develop programs that link against the SMB client library in the Samba suite. + +%package dc +Summary: Samba AD Domain Controller +Group: Applications/System + +%description dc +The samba-dc package provides AD Domain Controller functionality + +%prep +%setup -q -n %{name} + +# copy Red Hat specific scripts +mkdir packaging/Fedora +#cp packaging/RHEL/setup/smbusers packaging/Fedora/ +cp %{SOURCE5} packaging/Fedora/ +cp %{SOURCE6} packaging/Fedora/ +#cp %{SOURCE7} packaging/Fedora/ +cp %{SOURCE8} packaging/Fedora/winbind.init +cp %{SOURCE9} packaging/Fedora/ +cp %{SOURCE10} packaging/Fedora/ +cp %{SOURCE11} packaging/Fedora/ + +%patch1 -p1 -b .libsmbclient + +%build +%configure \ + --enable-fhs \ + --with-piddir=/var/run \ + --with-sockets-dir=/var/run \ + --with-modulesdir=%{_libdir} \ + --with-pammodulesdir=/%{_lib}/security \ + --with-lockdir=/var/lib/samba \ + --disable-gnutls \ + --disable-rpath-install \ + --with-shared-modules=idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2 \ + --builtin-libraries=ccan,wbclient \ + --bundled-libraries=heimdal,!tdb,!zlib +# --bundled-libraries=heimdal,!talloc,!tdb,!tevent,!ldb,!zlib + +# --with-modulesdir=%{_libdir}/{name} \ +# --with-lockdir=/var/lib/%{name} \ +# --with-privatedir=/var/lib/%{name}/private \ +# --sysconfdir=%{_sysconfdir}/%{name} \ +# --datadir=%{_datadir}/%{name} \ + +export WAFCACHE=/tmp/wafcache +mkdir -p $WAFCACHE +make %{?_smp_mflags} + +# Build PIDL for installation into vendor directories before +# 'make proto' gets to it. +(cd pidl && %{__perl} Makefile.PL INSTALLDIRS=vendor ) + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT + +mkdir -p $RPM_BUILD_ROOT/sbin +mkdir -p $RPM_BUILD_ROOT/usr/{sbin,bin} +mkdir -p $RPM_BUILD_ROOT/%{_initrddir} +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/{pam.d,logrotate.d,security} +mkdir -p $RPM_BUILD_ROOT/%{_lib}/security +mkdir -p $RPM_BUILD_ROOT/var/lib/samba +mkdir -p $RPM_BUILD_ROOT/var/lib/samba/private +mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged +mkdir -p $RPM_BUILD_ROOT/var/lib/samba/scripts +mkdir -p $RPM_BUILD_ROOT/var/lib/samba/sysvol +mkdir -p $RPM_BUILD_ROOT/var/log/samba/old +mkdir -p $RPM_BUILD_ROOT/var/spool/samba +mkdir -p $RPM_BUILD_ROOT/%{_datadir}/swat/using_samba +mkdir -p $RPM_BUILD_ROOT/var/run/winbindd +mkdir -p $RPM_BUILD_ROOT/%{_libdir}/samba +mkdir -p $RPM_BUILD_ROOT/%{_libdir}/pkgconfig + +# Undo the PIDL install, we want to try again with the right options. +rm -rf $RPM_BUILD_ROOT/%{_libdir}/perl5 +rm -rf $RPM_BUILD_ROOT/%{_datadir}/perl5 + +# Install PIDL. +( cd pidl && make install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT ) + +# winbind +mkdir -p $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT/%{_lib} +install -m 755 bin/shared/libnss_winbind.so.2 $RPM_BUILD_ROOT/%{_lib}/libnss_winbind.so.2 +ln -sf /%{_lib}/libnss_winbind.so.2 $RPM_BUILD_ROOT%{_libdir}/libnss_winbind.so +install -m 755 bin/shared/libnss_wins.so.2 $RPM_BUILD_ROOT/%{_lib}/libnss_wins.so.2 +ln -sf /%{_lib}/libnss_wins.so.2 $RPM_BUILD_ROOT%{_libdir}/libnss_wins.so +rm -f $RPM_BUILD_ROOT/%{_libdir}/libnss_winbind.so.2 +rm -f $RPM_BUILD_ROOT/%{_libdir}/libnss_wins.so.2 + +# Install other stuff +install -m644 packaging/Fedora/smb.conf.default $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf +#install -m755 %samba_source/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_bindir} +#install -m644 packaging/Fedora/smbusers $RPM_BUILD_ROOT%{_sysconfdir}/samba/smbusers +#install -m755 packaging/Fedora/smbprint $RPM_BUILD_ROOT%{_bindir} +install -m755 packaging/Fedora/smb.init $RPM_BUILD_ROOT%{_initrddir}/smb +install -m755 packaging/Fedora/nmb.init $RPM_BUILD_ROOT%{_initrddir}/nmb +install -m755 packaging/Fedora/winbind.init $RPM_BUILD_ROOT%{_initrddir}/winbind +install -m644 packaging/Fedora/pam_winbind.conf $RPM_BUILD_ROOT%{_sysconfdir}/security +#ln -s ../..%{_initrddir}/smb $RPM_BUILD_ROOT%{_sbindir}/samba +install -m644 packaging/Fedora/samba.pamd $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/samba +install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/samba +echo 127.0.0.1 localhost > $RPM_BUILD_ROOT%{_sysconfdir}/samba/lmhosts + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/openldap/schema +install -m644 examples/LDAP/samba.schema $RPM_BUILD_ROOT%{_sysconfdir}/openldap/schema/samba.schema + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d +install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/swat + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +install -m644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/samba + +# winbind krb5 locator +#mkdir -p $RPM_BUILD_ROOT%{_libdir}/krb5/plugins/libkrb5 +install -d -m 0755 %{buildroot}%{_libdir}/krb5/plugins/libkrb5 +install -m 755 bin/shared/winbind_krb5_locator.so $RPM_BUILD_ROOT/%{_libdir}/krb5/plugins/libkrb5/winbind_krb5_locator.so +rm -f $RPM_BUILD_ROOT/%{_libdir}/winbind_krb5_locator.so + +# cleanup stuff that does not belong here +rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/ldb.3* +rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/talloc.3* + +# Clean out crap left behind by the PIDL install. +find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \; +#find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \; + +# This makes the right links, as rpmlint requires that +# the ldconfig-created links be recorded in the RPM. +/sbin/ldconfig -N -n $RPM_BUILD_ROOT%{_libdir} + +# Fix up permission on perl install. +%{_fixperms} $RPM_BUILD_ROOT%{perl_vendorlib} + +# Fix up permissions for libraries +find $RPM_BUILD_ROOT%{_libdir} -name '*.so*' -type f |xargs chmod +x + +# Fix up permissions in source tree, for debuginfo. +find source4/heimdal -type f | xargs chmod -x + +%post +/sbin/chkconfig --add smb +/sbin/chkconfig --add nmb +if [ "$1" -ge "1" ]; then + /sbin/service smb condrestart >/dev/null 2>&1 || : + /sbin/service nmb condrestart >/dev/null 2>&1 || : +fi +exit 0 + +%preun +if [ $1 = 0 ] ; then + /sbin/service smb stop >/dev/null 2>&1 || : + /sbin/service nmb stop >/dev/null 2>&1 || : + /sbin/chkconfig --del smb + /sbin/chkconfig --del nmb +fi +exit 0 + +%post -n libsmbclient +/sbin/ldconfig + +%postun -n libsmbclient +/sbin/ldconfig + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%pre winbind +/usr/sbin/groupadd -g 88 wbpriv >/dev/null 2>&1 || : + +%post winbind +/sbin/chkconfig --add winbind + +if [ "$1" -ge "1" ]; then + /sbin/service winbind condrestart >/dev/null 2>&1 || : +fi + +%preun winbind +if [ $1 = 0 ] ; then + /sbin/service winbind stop >/dev/null 2>&1 || : + /sbin/chkconfig --del winbind +fi +exit 0 + +%post common +/sbin/ldconfig + +%postun common +/sbin/ldconfig + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%doc COPYING +%{_sbindir}/nmbd +%{_sbindir}/smbd +%{_mandir}/man8/samba.8.gz +%{_libdir}/samba/vfs +%attr(755,root,root) %{_initrddir}/smb +%attr(755,root,root) %{_initrddir}/nmb +%config(noreplace) %{_sysconfdir}/logrotate.d/samba +%config(noreplace) %{_sysconfdir}/pam.d/samba +%attr(0700,root,root) %dir /var/log/samba +%attr(0700,root,root) %dir /var/log/samba/old +%attr(1777,root,root) %dir /var/spool/samba +%dir %{_sysconfdir}/openldap/schema +%{_sysconfdir}/openldap/schema/samba.schema + +%files dc +%defattr(-,root,root) +%{_sbindir}/provision +%{_sbindir}/samba +%{_sbindir}/samba-tool +%{_sbindir}/upgradeprovision +%{_sbindir}/samba_dnsupdate +%{_sbindir}/samba_spnupdate +%{_libdir}/mit_samba.so +%dir /var/lib/samba/sysvol + +%files winbind +%defattr(-,root,root) +%{_bindir}/ntlm_auth3 +%{_bindir}/wbinfo3 +%{_libdir}/samba/idmap +%{_libdir}/samba/nss_info +%{_sbindir}/winbindd +%ghost %dir /var/run/winbindd +%attr(750,root,wbpriv) %dir /var/lib/samba/winbindd_privileged +%config(noreplace) %{_sysconfdir}/security/pam_winbind.conf +%{_initrddir}/winbind +#%{_mandir}/man1/ntlm_auth.1* +#%{_mandir}/man1/wbinfo.1* +#%{_mandir}/man5/pam_winbind.conf.5* +#%{_mandir}/man8/pam_winbind.8* +#%{_mandir}/man8/winbindd.8* +#%{_mandir}/man8/idmap_*.8* +#%{_datadir}/locale/*/LC_MESSAGES/pam_winbind.mo + +%files winbind-krb5-locator +%defattr(-,root,root) +#%{_mandir}/man7/winbind_krb5_locator.7* +%{_libdir}/krb5/plugins/libkrb5/winbind_krb5_locator.so + +%files winbind-clients +%defattr(-,root,root) +%{_libdir}/libnss_winbind.so +/%{_lib}/libnss_winbind.so.2 +%{_libdir}/libnss_wins.so +/%{_lib}/libnss_wins.so.2 +/%{_lib}/security/pam_winbind.so +#%attr(755,root,root) %{_libdir}/libwbclient.so.* + +#%files winbind-devel +#%defattr(-,root,root) +#%{_includedir}/wbclient.h +#%{_libdir}/libwbclient.so +#%{_libdir}/pkgconfig/wbclient.pc + +%files client +%defattr(-,root,root) +%{_bindir}/cifsdd +%{_bindir}/dbwrap_tool +%{_bindir}/debug2html +%{_bindir}/eventlogadm +%{_bindir}/ldbadd +%{_bindir}/ldbdel +%{_bindir}/ldbedit +%{_bindir}/ldbmodify +%{_bindir}/ldbrename +%{_bindir}/ldbsearch +%{_bindir}/log2pcap +%{_bindir}/net +%{_bindir}/nmblookup +%{_bindir}/nmblookup3 +%{_bindir}/ntlm_auth +%{_bindir}/ntlm_auth3 +%{_bindir}/oLschema2ldif +%{_bindir}/pdbedit +%{_bindir}/profiles +%{_bindir}/regdiff +%{_bindir}/regpatch +%{_bindir}/regshell +%{_bindir}/regtree +%{_bindir}/rpcclient +%{_bindir}/sharesec +%{_bindir}/smbcacls +%{_bindir}/smbclient +%{_bindir}/smbclient3 +%{_bindir}/smbcontrol +%{_bindir}/smbcquotas +%{_bindir}/smbfilter +%{_bindir}/smbget +%{_bindir}/smbiconv +%{_bindir}/smbpasswd +%{_bindir}/smbspool +%{_bindir}/smbstatus +%{_bindir}/smbta-util +%{_bindir}/smbtree +%{_bindir}/split_tokens +%{_bindir}/testparm +%{_bindir}/wbinfo +%{_bindir}/wbinfo3 +%{_mandir}/man1/ldbadd.1.gz +%{_mandir}/man1/ldbdel.1.gz +%{_mandir}/man1/ldbedit.1.gz +%{_mandir}/man1/ldbmodify.1.gz +%{_mandir}/man1/ldbrename.1.gz +%{_mandir}/man1/ldbsearch.1.gz +%{_mandir}/man1/nmblookup.1.gz +%{_mandir}/man1/ntlm_auth.1.gz +%{_mandir}/man1/oLschema2ldif.1.gz +%{_mandir}/man1/regdiff.1.gz +%{_mandir}/man1/regpatch.1.gz +%{_mandir}/man1/regshell.1.gz +%{_mandir}/man1/regtree.1.gz + +%files test +%defattr(-,root,root) +%{_bindir}/dbwrap_torture +%{_bindir}/gentest +%{_bindir}/locktest +%{_bindir}/locktest2 +%{_bindir}/locktest3 +%{_bindir}/masktest +%{_bindir}/masktest3 +%{_bindir}/msgtest +%{_bindir}/ndrdump +%{_bindir}/nsstest +%{_bindir}/pdbtest +%{_bindir}/pthreadpooltest +%{_bindir}/rpc_open_tcp +%{_bindir}/smbconftort +%{_bindir}/smbtorture +%{_bindir}/smbtorture3 +%{_bindir}/test_lp_load +%{_bindir}/timelimit +%{_bindir}/versiontest +%{_bindir}/vfstest +%{_bindir}/vlp +%{_mandir}/man1/gentest.1.gz +%{_mandir}/man1/locktest.1.gz +%{_mandir}/man1/masktest.1.gz +%{_mandir}/man1/ndrdump.1.gz +%{_mandir}/man1/smbtorture.1.gz + +%files devel +%defattr(-,root,root) +%{_includedir}/%{name}/charset.h +%{_includedir}/%{name}/core/doserr.h +%{_includedir}/%{name}/core/error.h +%{_includedir}/%{name}/core/ntstatus.h +%{_includedir}/%{name}/core/werror.h +%{_includedir}/%{name}/credentials.h +%{_includedir}/%{name}/dcerpc.h +%{_includedir}/%{name}/dcerpc_server.h +%{_includedir}/%{name}/dlinklist.h +%{_includedir}/%{name}/domain_credentials.h +%{_includedir}/%{name}/gen_ndr/atsvc.h +%{_includedir}/%{name}/gen_ndr/auth.h +%{_includedir}/%{name}/gen_ndr/dcerpc.h +%{_includedir}/%{name}/gen_ndr/epmapper.h +%{_includedir}/%{name}/gen_ndr/krb5pac.h +%{_includedir}/%{name}/gen_ndr/lsa.h +%{_includedir}/%{name}/gen_ndr/mgmt.h +%{_includedir}/%{name}/gen_ndr/misc.h +%{_includedir}/%{name}/gen_ndr/nbt.h +%{_includedir}/%{name}/gen_ndr/ndr_atsvc.h +%{_includedir}/%{name}/gen_ndr/ndr_atsvc_c.h +%{_includedir}/%{name}/gen_ndr/ndr_dcerpc.h +%{_includedir}/%{name}/gen_ndr/ndr_epmapper.h +%{_includedir}/%{name}/gen_ndr/ndr_epmapper_c.h +%{_includedir}/%{name}/gen_ndr/ndr_krb5pac.h +%{_includedir}/%{name}/gen_ndr/ndr_mgmt.h +%{_includedir}/%{name}/gen_ndr/ndr_mgmt_c.h +%{_includedir}/%{name}/gen_ndr/ndr_misc.h +%{_includedir}/%{name}/gen_ndr/ndr_samr.h +%{_includedir}/%{name}/gen_ndr/ndr_samr_c.h +%{_includedir}/%{name}/gen_ndr/ndr_svcctl.h +%{_includedir}/%{name}/gen_ndr/ndr_svcctl_c.h +%{_includedir}/%{name}/gen_ndr/netlogon.h +%{_includedir}/%{name}/gen_ndr/samr.h +%{_includedir}/%{name}/gen_ndr/security.h +%{_includedir}/%{name}/gen_ndr/server_id.h +%{_includedir}/%{name}/gen_ndr/svcctl.h +%{_includedir}/%{name}/gensec.h +%{_includedir}/%{name}/ldap-util.h +%{_includedir}/%{name}/ldap_errors.h +%{_includedir}/%{name}/ldap_message.h +%{_includedir}/%{name}/ldap_ndr.h +%{_includedir}/%{name}/ldb_wrap.h +#%{_includedir}/%{name}/libsmbclient.h +%{_includedir}/%{name}/ndr.h +%{_includedir}/%{name}/ndr/ndr_svcctl.h +%{_includedir}/%{name}/netapi.h +%{_includedir}/%{name}/param.h +%{_includedir}/%{name}/policy.h +%{_includedir}/%{name}/pytalloc.h +%{_includedir}/%{name}/registry.h +%{_includedir}/%{name}/roles.h +%{_includedir}/%{name}/rpc_common.h +%{_includedir}/%{name}/samba/popt.h +%{_includedir}/%{name}/samba/session.h +%{_includedir}/%{name}/samba/version.h +%{_includedir}/%{name}/share.h +%{_includedir}/%{name}/smb2_constants.h +%{_includedir}/%{name}/smb2_create_blob.h +%{_includedir}/%{name}/smb_cliraw.h +%{_includedir}/%{name}/smb_common.h +%{_includedir}/%{name}/smb_raw.h +%{_includedir}/%{name}/smb_raw_interfaces.h +%{_includedir}/%{name}/smb_raw_trans2.h +%{_includedir}/%{name}/smb_request.h +#%{_includedir}/%{name}/smb_share_modes.h +%{_includedir}/%{name}/smb_signing.h +%{_includedir}/%{name}/smb2_signing.h +%{_includedir}/%{name}/smbconf.h +%{_includedir}/%{name}/tdr.h +%{_includedir}/%{name}/torture.h +%{_includedir}/%{name}/tsocket.h +%{_includedir}/%{name}/tsocket_internal.h +%{_includedir}/%{name}/util.h +%{_includedir}/%{name}/util/attr.h +%{_includedir}/%{name}/util/byteorder.h +%{_includedir}/%{name}/util/data_blob.h +%{_includedir}/%{name}/util/debug.h +%{_includedir}/%{name}/util/memory.h +%{_includedir}/%{name}/util/safe_string.h +%{_includedir}/%{name}/util/string_wrappers.h +%{_includedir}/%{name}/util/talloc_stack.h +%{_includedir}/%{name}/util/tevent_ntstatus.h +%{_includedir}/%{name}/util/tevent_unix.h +%{_includedir}/%{name}/util/tevent_werror.h +%{_includedir}/%{name}/util/time.h +%{_includedir}/%{name}/util/xfile.h +%{_includedir}/%{name}/util_ldb.h +%{_includedir}/%{name}/wbclient.h +%{_libdir}/libdcerpc-atsvc.so +%{_libdir}/libdcerpc-binding.so +%{_libdir}/libdcerpc-samr.so +%{_libdir}/libdcerpc-server.so +%{_libdir}/libdcerpc.so +%{_libdir}/libgensec.so +%{_libdir}/libndr-krb5pac.so +%{_libdir}/libndr-standard.so +%{_libdir}/libndr.so +%{_libdir}/libnetapi.so +%{_libdir}/libregistry.so +%{_libdir}/libsamba-credentials.so +%{_libdir}/libsamba-hostconfig.so +%{_libdir}/libsamba-policy.so +%{_libdir}/libsamba-util.so +%{_libdir}/libsamdb.so +#%{_libdir}/libsmb/libsmbclient.so +%{_libdir}/libsmbclient-raw.so +%{_libdir}/libsmbconf.so +#%{_libdir}/libsmbsharemodes.so +%{_libdir}/libtevent-util.so +%{_libdir}/libtorture.so +%{_libdir}/pkgconfig/dcerpc.pc +%{_libdir}/pkgconfig/dcerpc_atsvc.pc +%{_libdir}/pkgconfig/dcerpc_samr.pc +%{_libdir}/pkgconfig/dcerpc_server.pc +%{_libdir}/pkgconfig/gensec.pc +%{_libdir}/pkgconfig/ndr.pc +%{_libdir}/pkgconfig/ndr_krb5pac.pc +%{_libdir}/pkgconfig/ndr_standard.pc +%{_libdir}/pkgconfig/registry.pc +%{_libdir}/pkgconfig/samba-credentials.pc +%{_libdir}/pkgconfig/samba-hostconfig.pc +%{_libdir}/pkgconfig/samba-policy.pc +%{_libdir}/pkgconfig/samba-util.pc +%{_libdir}/pkgconfig/samdb.pc +%{_libdir}/pkgconfig/smbclient-raw.pc +%{_libdir}/pkgconfig/torture.pc +#%{_libdir}/pkgconfig/wbclient.pc + +%files libs +%defattr(-,root,root) +%{_libdir}/libdcerpc-atsvc.so.* +%{_libdir}/libdcerpc-binding.so.* +%{_libdir}/libdcerpc-samr.so.* +%{_libdir}/libdcerpc-server.so.* +%{_libdir}/libdcerpc.so.* +%{_libdir}/libgensec.so.* +%{_libdir}/libndr-krb5pac.so.* +%{_libdir}/libndr-standard.so.* +%{_libdir}/libndr.so.* +%{_libdir}/libnetapi.so.* +#%{_libdir}/libnss_winbind.so.2 +#%{_libdir}/libnss_wins.so.2 +%{_libdir}/libregistry.so.* +%{_libdir}/libsamba-credentials.so.* +%{_libdir}/libsamba-hostconfig.so.* +%{_libdir}/libsamba-policy.so.* +%{_libdir}/libsamba-util.so.* +%{_libdir}/libsamdb.so.* +#%{_libdir}/libsmb/libsmbclient.so.* +%{_libdir}/libsmbclient-raw.so.* +%{_libdir}/libsmbconf.so.* +#%{_libdir}/libsmbsharemodes.so.* +%{_libdir}/libtevent-util.so.* +%{_libdir}/libtorture.so.* +#%{_libdir}/libwbclient.so +#%{_libdir}/libwbclient.so.0 +#%{_libdir}/mit_samba.so +/%{_lib}/security/pam_smbpass.so + +%{_libdir}/samba/libCHARSET3.so +%{_libdir}/samba/libUTIL_TDB.so +%{_libdir}/samba/libaddns.so +%{_libdir}/samba/libads.so +%{_libdir}/samba/libadt_tree.so +%{_libdir}/samba/libasn1-samba4.so.8 +%{_libdir}/samba/libasn1-samba4.so.8.0.0 +%{_libdir}/samba/libasn1util.so +%{_libdir}/samba/libauth.so +%{_libdir}/samba/libauth4.so +%{_libdir}/samba/libauth_sam_reply.so +%{_libdir}/samba/libauth_unix_token.so +%{_libdir}/samba/libauthkrb5.so +%{_libdir}/samba/libcli-ldap-common.so +%{_libdir}/samba/libcli-ldap.so +%{_libdir}/samba/libcli-nbt.so +%{_libdir}/samba/libcli_cldap.so +%{_libdir}/samba/libcli_smb_common.so +%{_libdir}/samba/libcli_spoolss.so +%{_libdir}/samba/libcliauth.so +%{_libdir}/samba/libcluster.so +%{_libdir}/samba/libcmdline-credentials.so +%{_libdir}/samba/libdb-glue.so +%{_libdir}/samba/libdbwrap.so +%{_libdir}/samba/libdcerpc-samba.so +%{_libdir}/samba/libdcerpc-samba4.so +%{_libdir}/samba/libdlz_bind9.so +%{_libdir}/samba/libdsdb-module.so +%{_libdir}/samba/liberrors.so +%{_libdir}/samba/libevents.so +%{_libdir}/samba/libflag_mapping.so +%{_libdir}/samba/libgssapi-samba4.so.2 +%{_libdir}/samba/libgssapi-samba4.so.2.0.0 +%{_libdir}/samba/libhcrypto-samba4.so.5 +%{_libdir}/samba/libhcrypto-samba4.so.5.0.1 +%{_libdir}/samba/libhdb-samba4.so.11 +%{_libdir}/samba/libhdb-samba4.so.11.0.2 +%{_libdir}/samba/libheimbase-samba4.so.1 +%{_libdir}/samba/libheimbase-samba4.so.1.0.0 +%{_libdir}/samba/libheimntlm-samba4.so.1 +%{_libdir}/samba/libheimntlm-samba4.so.1.0.1 +%{_libdir}/samba/libhx509-samba4.so.5 +%{_libdir}/samba/libhx509-samba4.so.5.0.0 +%{_libdir}/samba/libidmap.so +%{_libdir}/samba/libinterfaces.so +%{_libdir}/samba/libkdc-policy.so +%{_libdir}/samba/libkdc-samba4.so.2 +%{_libdir}/samba/libkdc-samba4.so.2.0.0 +%{_libdir}/samba/libkrb5-samba4.so.26 +%{_libdir}/samba/libkrb5-samba4.so.26.0.0 +%{_libdir}/samba/libldb-cmdline.so +%{_libdir}/samba/libldb.so.1 +%{_libdir}/samba/libldb.so.1.1.2 +%{_libdir}/samba/libldbsamba.so +%{_libdir}/samba/liblibcli_lsa3.so +%{_libdir}/samba/liblibgpo.so +%{_libdir}/samba/liblibsmb.so +%{_libdir}/samba/libmemcache.so +%{_libdir}/samba/libmsrpc3.so +%{_libdir}/samba/libnamearray.so +%{_libdir}/samba/libndr-samba.so +%{_libdir}/samba/libndr-samba4.so +%{_libdir}/samba/libnetif.so +%{_libdir}/samba/libnpa_tstream.so +%{_libdir}/samba/libnss_info.so +%{_libdir}/samba/libntvfs.so +%{_libdir}/samba/libpac.so +%{_libdir}/samba/libpdb.so +%{_libdir}/samba/libpopt_samba3.so +%{_libdir}/samba/libprinting_migrate.so +%{_libdir}/samba/libprocess_model.so +%{_libdir}/samba/libpyldb-util.so.1 +%{_libdir}/samba/libpyldb-util.so.1.1.2 +%{_libdir}/samba/libpytalloc-util.so.2 +%{_libdir}/samba/libpytalloc-util.so.2.0.6 +%{_libdir}/samba/libreplace.so +%{_libdir}/samba/libroken-samba4.so.19 +%{_libdir}/samba/libroken-samba4.so.19.0.1 +%{_libdir}/samba/libsamba-net.so +%{_libdir}/samba/libsamba-sockets.so +%{_libdir}/samba/libsamba_python.so +%{_libdir}/samba/libsamdb-common.so +%{_libdir}/samba/libsecurity.so +%{_libdir}/samba/libservice.so +%{_libdir}/samba/libshares.so +%{_libdir}/samba/libsmbd_base.so +%{_libdir}/samba/libsmbd_conn.so +%{_libdir}/samba/libsmbd_shim.so +%{_libdir}/samba/libsmbpasswdparser.so +%{_libdir}/samba/libsmbregistry.so +%{_libdir}/samba/libstring_init.so +%{_libdir}/samba/libsubunit.so +%{_libdir}/samba/libtalloc.so.2 +%{_libdir}/samba/libtalloc.so.2.0.6 +%{_libdir}/samba/libtdb-wrap.so +%{_libdir}/samba/libtdb_compat.so +%{_libdir}/samba/libtevent.so.0 +%{_libdir}/samba/libtevent.so.0.9.14 +%{_libdir}/samba/libutil_cmdline.so +%{_libdir}/samba/libutil_malloc.so +%{_libdir}/samba/libutil_reg.so +%{_libdir}/samba/libutil_sec.so +%{_libdir}/samba/libutil_str.so +%{_libdir}/samba/libLIBWBCLIENT_OLD.so +%{_libdir}/samba/libwinbind-client.so +%{_libdir}/samba/libwind-samba4.so.0 +%{_libdir}/samba/libwind-samba4.so.0.0.0 +%{_libdir}/samba/libwrap_xattr.so + +#%{_libdir}/winbind_krb5_locator.so + +%{_libdir}/samba/auth +#%{_libdir}/samba/idmap +%{_libdir}/samba/gensec +%{_libdir}/samba/ldb +%{_libdir}/samba/process_model +%{_libdir}/samba/service +%{_datadir}/samba/setup + +%files python +%defattr(-,root,root,-) +%{python_sitearch}/* + +%files pidl +%defattr(-,root,root,-) +%{perl_vendorlib}/* +%{_mandir}/man1/pidl* +%{_mandir}/man3/Parse* +%attr(755,root,root) %{_bindir}/pidl + +%files common +%defattr(-,root,root) +#%{_libdir}/samba/charset ??? +%{_datadir}/samba/codepages +%config(noreplace) %{_sysconfdir}/samba/smb.conf +%config(noreplace) %{_sysconfdir}/samba/lmhosts +%config(noreplace) %{_sysconfdir}/sysconfig/samba + +%files swat +%defattr(-,root,root) +%config(noreplace) %{_sysconfdir}/xinetd.d/swat +%{_datadir}/samba/swat +%{_sbindir}/swat +#%{_mandir}/man8/swat.8* +#%attr(755,root,root) %{_libdir}/samba/*.msg + +%files -n libsmbclient +%defattr(-,root,root) +#FIXME +#%attr(755,root,root) %{_libdir}/libsmbclient.so.* +%attr(755,root,root) %{_libdir}/libsmb/libsmbclient.so.* +%attr(755,root,root) %{_libdir}/libsmbsharemodes.so.* + +%files -n libsmbclient-devel +%defattr(-,root,root) +#%{_includedir}/libsmbclient.h +%{_includedir}/%{name}/libsmbclient.h +#%{_includedir}/smb_share_modes.h +%{_includedir}/%{name}/smb_share_modes.h +#FIXME +#%{_libdir}/libsmbclient.so +%{_libdir}/libsmb/libsmbclient.so +%{_libdir}/libsmbsharemodes.so +#%{_libdir}/pkgconfig/smbclient.pc +#%{_libdir}/pkgconfig/smbsharemodes.pc +#%{_mandir}/man7/libsmbclient.7* + +%changelog +* Wed Aug 24 2011 Guenther Deschner <gdeschner@redhat.com> - 4.0-1 +- initial package diff --git a/smb.conf.default b/smb.conf.default new file mode 100644 index 0000000..5c2d217 --- /dev/null +++ b/smb.conf.default @@ -0,0 +1,315 @@ +# This is the main Samba configuration file. For detailed information about the +# options listed here, refer to the smb.conf(5) manual page. Samba has a huge +# number of configurable options, most of which are not shown in this example. +# +# The Official Samba 3.2.x HOWTO and Reference Guide contains step-by-step +# guides for installing, configuring, and using Samba: +# http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf +# +# The Samba-3 by Example guide has working examples for smb.conf. This guide is +# generated daily: http://www.samba.org/samba/docs/Samba-Guide.pdf +# +# In this file, lines starting with a semicolon (;) or a hash (#) are +# comments and are ignored. This file uses hashes to denote commentary and +# semicolons for parts of the file you may wish to configure. +# +# Note: Run the "testparm" command after modifying this file to check for basic +# syntax errors. +# +#--------------- +# Security-Enhanced Linux (SELinux) Notes: +# +# Turn the samba_domain_controller Boolean on to allow Samba to use the useradd +# and groupadd family of binaries. Run the following command as the root user to +# turn this Boolean on: +# setsebool -P samba_domain_controller on +# +# Turn the samba_enable_home_dirs Boolean on if you want to share home +# directories via Samba. Run the following command as the root user to turn this +# Boolean on: +# setsebool -P samba_enable_home_dirs on +# +# If you create a new directory, such as a new top-level directory, label it +# with samba_share_t so that SELinux allows Samba to read and write to it. Do +# not label system directories, such as /etc/ and /home/, with samba_share_t, as +# such directories should already have an SELinux label. +# +# Run the "ls -ldZ /path/to/directory" command to view the current SELinux +# label for a given directory. +# +# Set SELinux labels only on files and directories you have created. Use the +# chcon command to temporarily change a label: +# chcon -t samba_share_t /path/to/directory +# +# Changes made via chcon are lost when the file system is relabeled or commands +# such as restorecon are run. +# +# Use the samba_export_all_ro or samba_export_all_rw Boolean to share system +# directories. To share such directories and only allow read-only permissions: +# setsebool -P samba_export_all_ro on +# To share such directories and allow read and write permissions: +# setsebool -P samba_export_all_rw on +# +# To run scripts (preexec/root prexec/print command/...), copy them to the +# /var/lib/samba/scripts/ directory so that SELinux will allow smbd to run them. +# Note that if you move the scripts to /var/lib/samba/scripts/, they retain +# their existing SELinux labels, which may be labels that SELinux does not allow +# smbd to run. Copying the scripts will result in the correct SELinux labels. +# Run the "restorecon -R -v /var/lib/samba/scripts" command as the root user to +# apply the correct SELinux labels to these files. +# +#-------------- +# +#======================= Global Settings ===================================== + +[global] + +# ----------------------- Network-Related Options ------------------------- +# +# workgroup = the Windows NT domain name or workgroup name, for example, MYGROUP. +# +# server string = the equivalent of the Windows NT Description field. +# +# netbios name = used to specify a server name that is not tied to the hostname. +# +# interfaces = used to configure Samba to listen on multiple network interfaces. +# If you have multiple interfaces, you can use the "interfaces =" option to +# configure which of those interfaces Samba listens on. Never omit the localhost +# interface (lo). +# +# hosts allow = the hosts allowed to connect. This option can also be used on a +# per-share basis. + +# hosts deny = the hosts not allowed to connect. This option can also be used on +# a per-share basis. +# + workgroup = MYGROUP + server string = Samba Server Version %v + +; netbios name = MYSERVER + +; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 +; hosts allow = 127. 192.168.12. 192.168.13. + +# --------------------------- Logging Options ----------------------------- +# +# log file = specify where log files are written to and how they are split. +# +# max log size = specify the maximum size log files are allowed to reach. Log +# files are rotated when they reach the size specified with "max log size". +# + + # log files split per-machine: + log file = /var/log/samba/log.%m + # maximum size of 50KB per log file, then rotate: + max log size = 50 + +# ----------------------- Standalone Server Options ------------------------ +# +# security = the mode Samba runs in. This can be set to user, share +# (deprecated), or server (deprecated). +# +# passdb backend = the backend used to store user information in. New +# installations should use either tdbsam or ldapsam. No additional configuration +# is required for tdbsam. The "smbpasswd" utility is available for backwards +# compatibility. +# + + security = user + passdb backend = tdbsam + + +# ----------------------- Domain Members Options ------------------------ +# +# security = must be set to domain or ads. +# +# passdb backend = the backend used to store user information in. New +# installations should use either tdbsam or ldapsam. No additional configuration +# is required for tdbsam. The "smbpasswd" utility is available for backwards +# compatibility. +# +# realm = only use the realm option when the "security = ads" option is set. +# The realm option specifies the Active Directory realm the host is a part of. +# +# password server = only use this option when the "security = server" +# option is set, or if you cannot use DNS to locate a Domain Controller. The +# argument list can include My_PDC_Name, [My_BDC_Name], and [My_Next_BDC_Name]: +# +# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name] +# +# Use "password server = *" to automatically locate Domain Controllers. + +; security = domain +; passdb backend = tdbsam +; realm = MY_REALM + +; password server = <NT-Server-Name> + +# ----------------------- Domain Controller Options ------------------------ +# +# security = must be set to user for domain controllers. +# +# passdb backend = the backend used to store user information in. New +# installations should use either tdbsam or ldapsam. No additional configuration +# is required for tdbsam. The "smbpasswd" utility is available for backwards +# compatibility. +# +# domain master = specifies Samba to be the Domain Master Browser, allowing +# Samba to collate browse lists between subnets. Do not use the "domain master" +# option if you already have a Windows NT domain controller performing this task. +# +# domain logons = allows Samba to provide a network logon service for Windows +# workstations. +# +# logon script = specifies a script to run at login time on the client. These +# scripts must be provided in a share named NETLOGON. +# +# logon path = specifies (with a UNC path) where user profiles are stored. +# +# +; security = user +; passdb backend = tdbsam + +; domain master = yes +; domain logons = yes + + # the following login script name is determined by the machine name + # (%m): +; logon script = %m.bat + # the following login script name is determined by the UNIX user used: +; logon script = %u.bat +; logon path = \\%L\Profiles\%u + # use an empty path to disable profile support: +; logon path = + + # various scripts can be used on a domain controller or a stand-alone + # machine to add or delete corresponding UNIX accounts: + +; add user script = /usr/sbin/useradd "%u" -n -g users +; add group script = /usr/sbin/groupadd "%g" +; add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s /bin/false "%u" +; delete user script = /usr/sbin/userdel "%u" +; delete user from group script = /usr/sbin/userdel "%u" "%g" +; delete group script = /usr/sbin/groupdel "%g" + + +# ----------------------- Browser Control Options ---------------------------- +# +# local master = when set to no, Samba does not become the master browser on +# your network. When set to yes, normal election rules apply. +# +# os level = determines the precedence the server has in master browser +# elections. The default value should be reasonable. +# +# preferred master = when set to yes, Samba forces a local browser election at +# start up (and gives itself a slightly higher chance of winning the election). +# +; local master = no +; os level = 33 +; preferred master = yes + +#----------------------------- Name Resolution ------------------------------- +# +# This section details the support for the Windows Internet Name Service (WINS). +# +# Note: Samba can be either a WINS server or a WINS client, but not both. +# +# wins support = when set to yes, the NMBD component of Samba enables its WINS +# server. +# +# wins server = tells the NMBD component of Samba to be a WINS client. +# +# wins proxy = when set to yes, Samba answers name resolution queries on behalf +# of a non WINS capable client. For this to work, there must be at least one +# WINS server on the network. The default is no. +# +# dns proxy = when set to yes, Samba attempts to resolve NetBIOS names via DNS +# nslookups. + +; wins support = yes +; wins server = w.x.y.z +; wins proxy = yes + +; dns proxy = yes + +# --------------------------- Printing Options ----------------------------- +# +# The options in this section allow you to configure a non-default printing +# system. +# +# load printers = when set you yes, the list of printers is automatically +# loaded, rather than setting them up individually. +# +# cups options = allows you to pass options to the CUPS library. Setting this +# option to raw, for example, allows you to use drivers on your Windows clients. +# +# printcap name = used to specify an alternative printcap file. +# + + load printers = yes + cups options = raw + +; printcap name = /etc/printcap + # obtain a list of printers automatically on UNIX System V systems: +; printcap name = lpstat +; printing = cups + +# --------------------------- File System Options --------------------------- +# +# The options in this section can be un-commented if the file system supports +# extended attributes, and those attributes are enabled (usually via the +# "user_xattr" mount option). These options allow the administrator to specify +# that DOS attributes are stored in extended attributes and also make sure that +# Samba does not change the permission bits. +# +# Note: These options can be used on a per-share basis. Setting them globally +# (in the [global] section) makes them the default for all shares. + +; map archive = no +; map hidden = no +; map read only = no +; map system = no +; store dos attributes = yes + + +#============================ Share Definitions ============================== + +[homes] + comment = Home Directories + browseable = no + writable = yes +; valid users = %S +; valid users = MYDOMAIN\%S + +[printers] + comment = All Printers + path = /var/spool/samba + browseable = no + guest ok = no + writable = no + printable = yes + +# Un-comment the following and create the netlogon directory for Domain Logons: +; [netlogon] +; comment = Network Logon Service +; path = /var/lib/samba/netlogon +; guest ok = yes +; writable = no +; share modes = no + +# Un-comment the following to provide a specific roving profile share. +# The default is to use the user's home directory: +; [Profiles] +; path = /var/lib/samba/profiles +; browseable = no +; guest ok = yes + +# A publicly accessible directory that is read only, except for users in the +# "staff" group (which have write permissions): +; [public] +; comment = Public Stuff +; path = /home/samba +; public = yes +; writable = yes +; printable = no +; write list = +staff diff --git a/smb.init b/smb.init new file mode 100644 index 0000000..f9fec26 --- /dev/null +++ b/smb.init @@ -0,0 +1,114 @@ +#!/bin/sh +# +# chkconfig: - 91 35 +# description: Starts and stops the Samba smbd daemon \ +# used to provide SMB network services. +# +# pidfile: /var/run/samba/smbd.pid +# config: /etc/samba/smb.conf + + +# Source function library. +if [ -f /etc/init.d/functions ] ; then + . /etc/init.d/functions +elif [ -f /etc/rc.d/init.d/functions ] ; then + . /etc/rc.d/init.d/functions +else + exit 1 +fi + +# Avoid using root's TMPDIR +unset TMPDIR + +# Source networking configuration. +. /etc/sysconfig/network + +if [ -f /etc/sysconfig/samba ]; then + . /etc/sysconfig/samba +fi + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 1 + +# Check that smb.conf exists. +[ -f /etc/samba/smb.conf ] || exit 6 + +RETVAL=0 + + +start() { + KIND="SMB" + echo -n $"Starting $KIND services: " + daemon smbd $SMBDOPTIONS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/smb || \ + RETVAL=1 + return $RETVAL +} + +stop() { + KIND="SMB" + echo -n $"Shutting down $KIND services: " + killproc smbd + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/smb + return $RETVAL +} + +restart() { + stop + start +} + +reload() { + echo -n $"Reloading smb.conf file: " + killproc smbd -HUP + RETVAL=$? + echo + return $RETVAL +} + +rhstatus() { + status -l smb smbd + return $? +} + + +# Allow status as non-root. +if [ "$1" = status ]; then + rhstatus + exit $? +fi + +# Check that we can write to it... so non-root users stop here +[ -w /etc/samba/smb.conf ] || exit 4 + + + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + status) + rhstatus + ;; + condrestart) + [ -f /var/lock/subsys/smb ] && restart || : + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}" + exit 2 +esac + +exit $? diff --git a/swat.desktop b/swat.desktop new file mode 100644 index 0000000..0d7b4b5 --- /dev/null +++ b/swat.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Samba Configuration +Name[de]=Samba Konfiguration +Type=Application +Comment=Configure Samba with a web based interface +Exec=htmlview http://127.0.0.1:901/ +Terminal=false +Categories=X-Red-Hat-Extra;Application;System;X-Red-Hat-ServerConfig; diff --git a/winbind.init b/winbind.init new file mode 100644 index 0000000..88ce028 --- /dev/null +++ b/winbind.init @@ -0,0 +1,102 @@ +#!/bin/sh +# +# chkconfig: - 27 73 +# description: Starts and stops the Samba winbind daemon +# # +# pidfile: /var/run/winbindd.pid +# config: /etc/samba/smb.conf + + +# Source function library. +. /etc/rc.d/init.d/functions + +# Avoid using root's TMPDIR +unset TMPDIR + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 1 + +# Check that smb.conf exists. +[ -f /etc/samba/smb.conf ] || exit 6 + +[ -f /etc/sysconfig/samba ] && . /etc/sysconfig/samba + +RETVAL=0 + + +start() { + KIND="Winbind" + echo -n $"Starting $KIND services: " + daemon winbindd "$WINBINDOPTIONS" + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/winbindd || RETVAL=1 + return $RETVAL +} + +stop() { + echo + KIND="Winbind" + echo -n $"Shutting down $KIND services: " + killproc winbindd + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/winbindd + echo "" + return $RETVAL +} + +restart() { + stop + start +} + +reload() { + echo -n $"Reloading smb.conf file: " + killproc winbindd -HUP + RETVAL=$? + echo + return $RETVAL +} + +rhstatus() { + status winbindd + return $? +} + +# Allow status as non-root. +if [ "$1" = status ]; then + rhstatus + exit $? +fi + +# Check that we can write to it... so non-root users stop here +[ -w /etc/samba/smb.conf ] || exit 4 + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + status) + rhstatus + ;; + condrestart) + [ -f /var/lock/subsys/winbindd ] && restart || : + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}" + exit 2 +esac + +exit $? |