Date: Mon, 22 Oct 2012 09:20:05 +0000 (UTC) From: "Timur I. Bakeyev" <timur@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r306263 - in head/net/samba36: . files Message-ID: <201210220920.q9M9K5GX078253@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: timur Date: Mon Oct 22 09:20:05 2012 New Revision: 306263 URL: http://svn.freebsd.org/changeset/ports/306263 Log: Update Samba 3.6 to the 3.6.8 revision. Feature safe: yes Added: head/net/samba36/files/patch-source3__auth__user_util.c (contents, props changed) head/net/samba36/files/patch-source3__modules__vfs_shadow_copy2.c (contents, props changed) Modified: head/net/samba36/Makefile head/net/samba36/distinfo head/net/samba36/files/patch-source3__configure.in head/net/samba36/files/patch-source3__m4__aclocal.m4 head/net/samba36/files/samba.in head/net/samba36/pkg-plist.swat Modified: head/net/samba36/Makefile ============================================================================== --- head/net/samba36/Makefile Mon Oct 22 09:17:51 2012 (r306262) +++ head/net/samba36/Makefile Mon Oct 22 09:20:05 2012 (r306263) @@ -6,11 +6,11 @@ # PORTNAME= ${SAMBA_BASENAME}36 -PORTVERSION= 3.6.7 +PORTVERSION= 3.6.8 PORTREVISION?= 0 CATEGORIES?= net MASTER_SITES= ${MASTER_SITE_SAMBA} -MASTER_SITE_SUBDIR= . old-versions rc pre +MASTER_SITE_SUBDIR= samba samba/old-versions samba/rc samba/pre DISTNAME= ${SAMBA_BASENAME}-${PORTVERSION:S|.p|pre|:S|.r|rc|:S|.t|tp|:S|.a|alpha|} MAINTAINER?= timur@FreeBSD.org @@ -37,11 +37,14 @@ AUTOCONF_ARGS= ${IPATHS} USE_GMAKE= yes USE_ICONV= yes GNU_CONFIGURE= yes +USE_PKGCONFIG= build USE_AUTOTOOLS= autoconf autoheader USE_LDCONFIG= ${SAMBA_LIBDIR} - +# pkg-config is used to find talloc +PKGCONFIGDIR?= ${PREFIX}/libdata/pkgconfig +PKGCONFIGDIR_REL?= ${PKGCONFIGDIR:S|^${PREFIX}/||} # directories -VARDIR?= /var +VARDIR?= ${DESTDIR}/var SAMBA_SPOOL?= ${VARDIR}/spool/${SAMBA_BASENAME} SAMBA_LOGDIR= ${VARDIR}/log/${SAMBA_BASENAME} SAMBA_RUNDIR= ${VARDIR}/run/${SAMBA_BASENAME} @@ -67,6 +70,7 @@ CONFIGURE_ARGS+= --exec-prefix="${PREFIX --localstatedir="${VARDIR}" \ --with-piddir="${SAMBA_RUNDIR}" \ --with-ncalrpcdir="${SAMBA_RUNDIR}/ncalrpc" \ + --with-nmbdsocketdir="${SAMBA_RUNDIR}/nmbd" \ --with-lockdir="${SAMBA_LOCKDIR}" \ --with-statedir="${SAMBA_LOCKDIR}" \ --with-cachedir="${SAMBA_LOCKDIR}" \ @@ -79,11 +83,10 @@ LDFLAGS+= -L${LOCALBASE}/lib CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}" \ PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \ PTHREAD_LDFLAGS="${PTHREAD_LIBS}" -# pkg-config is used to find talloc -PKGCONFIGDIR?= ${PREFIX}/libdata/pkgconfig -PKGCONFIGDIR_REL?= ${PKGCONFIGDIR:S|^${PREFIX}/||} - -USE_PKGCONFIG= yes +# XXX: Temporary hack for RELENG6 +CONFIGURE_ENV+= ac_cv_header_sys_mount_h=yes +# XXX: readdir test fails on ZFS, bringing unusable replacement code +CONFIGURE_ENV+= libreplace_cv_READDIR_NEEDED=no # Let process generate meaningful backtrace on a core dump LIB_DEPENDS+= execinfo.1:${PORTSDIR}/devel/libexecinfo # tdb @@ -95,7 +98,8 @@ BUILD_DEPENDS+= talloc>=2.0.1:${PORTSDI RUN_DEPENDS+= talloc>=2.0.1:${PORTSDIR}/devel/talloc CONFIGURE_ARGS+= --without-libtalloc --enable-external-libtalloc # These options are common for all (sub)ports -CONFIGURE_ARGS+= --with-libiconv="${LOCALBASE}" +CONFIGURE_ARGS+= --with-libiconv="${LOCALBASE}" \ + --disable-as-needed .if !defined(SAMBA_SUBPORT) OPTIONS= LDAP "With LDAP support" on \ @@ -103,8 +107,8 @@ OPTIONS= LDAP "With LDAP support" on \ CUPS "With CUPS printing support" on \ WINBIND "With WinBIND support" on \ SWAT "With SWAT WebGUI" off \ - ACL_SUPPORT "With ACL support" off \ - AIO_SUPPORT "With Asyncronous IO support" off \ + ACL_SUPPORT "With ACL support" on \ + AIO_SUPPORT "With Asyncronous IO support" on \ FAM_SUPPORT "With File Alteration Monitor" off \ SYSLOG "With Syslog support" off \ QUOTAS "With Disk quota support" off \ @@ -112,6 +116,7 @@ OPTIONS= LDAP "With LDAP support" on \ PAM_SMBPASS "With PAM authentication vs passdb backends" off \ DNSUPDATE "With dynamic DNS update(require ADS)" off \ AVAHI "With Bonjour service discovery support" off \ + PTHREADPOOL "With pthread pool" off \ EXP_MODULES "With experimental modules" off \ POPT "With system-wide POPT library" on \ IPV6 "With IPv6 support" on \ @@ -158,8 +163,6 @@ CONFIGURE_ARGS+= --with-pam --with-readl --without-libnetapi \ --without-libsmbsharemodes -# XXX: Temporary hack for RELENG6 -CONFIGURE_ENV+= ac_cv_header_sys_mount_h=yes .if !defined(WITH_IPV6) CONFIGURE_ENV+= libreplace_cv_HAVE_IPV6=no .endif @@ -288,14 +291,20 @@ CONFIGURE_ARGS+= --without-dnsupdate .endif .if defined(WITH_AVAHI) -CPPFLAGS+= `${PKG_CONFIG} --cflags avahi-client` -DNSSD_LIBS= `${PKG_CONFIG} --libs avahi-client` +CPPFLAGS+= `pkg-config --cflags avahi-client` +CONFIGURE_ENV+= DNSSD_LIBS="`pkg-config --libs avahi-client`" LIB_DEPENDS+= avahi-client.3:${PORTSDIR}/net/avahi-app CONFIGURE_ARGS+= --enable-avahi .else CONFIGURE_ARGS+= --disable-avahi .endif +.if defined(WITH_PTHREADPOOL) +CONFIGURE_ARGS+= --enable-pthreadpool +.else +CONFIGURE_ARGS+= --disable-pthreadpool +.endif + .if !defined(WITHOUT_POPT) LIB_DEPENDS+= popt.0:${PORTSDIR}/devel/popt CONFIGURE_ARGS+= --without-included-popt @@ -303,8 +312,6 @@ CONFIGURE_ARGS+= --without-included-popt CONFIGURE_ARGS+= --with-included-popt .endif -#--enable-pthreadpool - .if defined(WITH_SMBTORTURE) PLIST_SUB+= SMBTORTURE="" .else @@ -356,6 +363,8 @@ CONFIGURE_ARGS+= --with-shared-modules=" post-patch: @${REINPLACE_CMD} -e 's|%%SAMBA_CONFIG%%|${SAMBA_CONFIG}|g' \ ${WRKSRC}/Makefile.in + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + ${WRKSRC}/configure.in ${WRKSRC}/m4/aclocal.m4 ### ### end of common part ### @@ -393,6 +402,10 @@ MAN8+= swat.8 MAN8+= vfs_notify_fam.8 .endif +.if defined(WITH_PTHREADPOOL) +MAN8+= vfs_aio_pthread.8 +.endif + .if defined(SAMBA_WANT_LDAP) MAN8+= idmap_ldap.8 .endif Modified: head/net/samba36/distinfo ============================================================================== --- head/net/samba36/distinfo Mon Oct 22 09:17:51 2012 (r306262) +++ head/net/samba36/distinfo Mon Oct 22 09:20:05 2012 (r306263) @@ -1,2 +1,2 @@ -SHA256 (samba-3.6.7.tar.gz) = b858a0f011ba7fe554881b9c7e6cb1c9cb7face22ed86860f560fcaecc4ed4ca -SIZE (samba-3.6.7.tar.gz) = 34067900 +SHA256 (samba-3.6.8.tar.gz) = 4f5a171a8d902c6b4f822ed875c51eb8339196d9ccf0ecd7f6521c966b3514de +SIZE (samba-3.6.8.tar.gz) = 34070798 Added: head/net/samba36/files/patch-source3__auth__user_util.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/samba36/files/patch-source3__auth__user_util.c Mon Oct 22 09:20:05 2012 (r306263) @@ -0,0 +1,22 @@ +--- ./source3/auth/user_util.c.orig 2012-09-14 08:12:09.000000000 +0000 ++++ ./source3/auth/user_util.c 2012-10-18 20:58:57.065810414 +0000 +@@ -425,12 +425,14 @@ + x_fclose(f); + + /* +- * Setup the last_from and last_to as an optimization so +- * that we don't scan the file again for the same user. ++ * If mapping failed setup the last_from and last_to as ++ * an optimization so that we don't scan the file again ++ * for the same user. + */ +- +- set_last_from_to(user_in, user_in); +- store_map_in_gencache(ctx, user_in, user_in); ++ if(!mapped_user) { ++ set_last_from_to(user_in, user_in); ++ store_map_in_gencache(ctx, user_in, user_in); ++ } + + return mapped_user; + } Modified: head/net/samba36/files/patch-source3__configure.in ============================================================================== --- head/net/samba36/files/patch-source3__configure.in Mon Oct 22 09:17:51 2012 (r306262) +++ head/net/samba36/files/patch-source3__configure.in Mon Oct 22 09:20:05 2012 (r306263) @@ -1,18 +1,6 @@ ---- ./source3/configure.in.orig 2011-08-09 13:17:47.000000000 +0200 -+++ ./source3/configure.in 2011-10-13 23:29:28.000000000 +0200 -@@ -756,9 +756,9 @@ - if test x"$ac_cv_header_md5_h" = x"yes"; then - AC_DEFINE(HAVE_MD5_H, 1, - [Whether md5.h is available.]) -- AC_CHECK_LIB(md5, MD5Update, -+ AC_CHECK_LIB(md, MD5Update, - [ -- LIBS="${LIBS} -lmd5" -+ LIBS="${LIBS} -lmd" - CRYPTO_MD5_OBJ= - AC_DEFINE(HAVE_LIBMD5, 1, - [Whether libmd5 conformant to rfc1321 is available.])], -@@ -852,9 +852,13 @@ +--- ./source3/configure.in.orig 2012-09-14 08:12:09.000000000 +0000 ++++ ./source3/configure.in 2012-10-20 15:02:17.725815685 +0000 +@@ -868,9 +868,13 @@ AC_PATH_PROG(CUPS_CONFIG, cups-config) if test "x$CUPS_CONFIG" != x; then @@ -27,7 +15,7 @@ AC_CHECK_HEADERS(cups/cups.h cups/language.h) if test x"$ac_cv_header_cups_cups_h" = xyes -a \ -@@ -863,7 +867,7 @@ +@@ -879,7 +883,7 @@ # underlinked. With cups-config --libs we pull in unwanted and unneeded # dendencies including thread libraries - use cups-config only if really # required. @@ -36,7 +24,7 @@ [PRINT_LIBS="$ac_save_PRINT_LIBS -lcups"], [AC_MSG_WARN([your cups library doesn't link with -lcups alone, it might be underlinked.]) ; PRINT_LIBS="$ac_save_PRINT_LIBS `$CUPS_CONFIG --libs`"]) -@@ -873,10 +877,10 @@ +@@ -889,10 +893,10 @@ AC_CHECK_LIB_EXT(cups, PRINT_LIBS, httpConnectEncrypt) else AC_MSG_WARN([cups-config around but cups-devel not installed]) @@ -49,7 +37,16 @@ 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.) -@@ -1964,9 +1968,6 @@ +@@ -1849,7 +1853,7 @@ + fi + + if test x"$BLDSHARED" = x"true" ; then +- LDFLAGS="$LDFLAGS -L./bin" ++ LDFLAGS="-L./bin $LDFLAGS" + fi + + AC_MSG_RESULT($BLDSHARED) +@@ -1980,9 +1984,6 @@ AC_MSG_CHECKING([PICFLAG]) AC_MSG_RESULT([$PICFLAG]) @@ -59,7 +56,7 @@ AC_CACHE_CHECK([whether building shared libraries actually works], [ac_cv_shlib_works],[ # try building a trivial shared library -@@ -4624,15 +4625,51 @@ +@@ -4639,15 +4640,51 @@ x"$ac_cv_header_pam_pam_modules_h" = x"no" ; then if test x"${try_pam}" = x"yes";then AC_MSG_ERROR([--with-pam=yes but pam_modules.h not found]) @@ -115,7 +112,7 @@ if test x"$create_pam_modules" = x"yes"; then AC_DEFINE(WITH_PAM_MODULES,1,[Whether to include PAM MODULES support]) -@@ -4642,7 +4679,7 @@ +@@ -4657,7 +4694,7 @@ AC_CHECK_HEADERS(pam/pam_ext.h pam/_pam_macros.h) AC_CHECK_FUNC_EXT(pam_vsyslog,$PAM_LIBS) else @@ -124,7 +121,7 @@ fi fi AC_MSG_CHECKING(whether to use PAM support) -@@ -5844,9 +5881,17 @@ +@@ -5859,9 +5896,17 @@ [AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for aio_suspend) @@ -145,7 +142,7 @@ [AC_MSG_RESULT(no)]) fi -@@ -6299,12 +6344,13 @@ +@@ -6314,12 +6359,13 @@ NSSSONAMEVERSIONSUFFIX=".2" WINBIND_NSS_EXTRA_OBJS="../nsswitch/winbind_nss_linux.o" ;; @@ -160,7 +157,7 @@ WINBIND_NSS="../nsswitch/nss_winbind.$SHLIBEXT" WINBIND_WINS_NSS="../nsswitch/nss_wins.$SHLIBEXT" ;; -@@ -6451,10 +6497,14 @@ +@@ -6466,10 +6512,14 @@ AC_MSG_RESULT(no$winbind_no_reason) fi @@ -175,7 +172,7 @@ AC_SUBST(NSSSONAMEVERSIONSUFFIX) AC_SUBST(WINBIND_KRB5_LOCATOR) -@@ -6773,13 +6823,21 @@ +@@ -6788,13 +6838,21 @@ # Start AC_CHECK_FUNC(getmntent) @@ -198,7 +195,7 @@ int main(void) { struct statfs fsd; -@@ -7079,6 +7137,16 @@ +@@ -7094,6 +7152,16 @@ LIBS="$LIBS -ldmalloc" fi @@ -215,3 +212,11 @@ dnl Remove -L/usr/lib/? from LDFLAGS and LIBS LIB_REMOVE_USR_LIB(LDFLAGS) LIB_REMOVE_USR_LIB(LIBS) +@@ -7142,6 +7210,7 @@ + AC_SUBST(SMBD_LIBS) + + CFLAGS="${CFLAGS} \$(FLAGS)" ++CFLAGS="${CFLAGS} -I%%LOCALBASE%%/include" + CFLAGS="${CFLAGS} -D_SAMBA_BUILD_=3" + + # If we had to expand the includes, make tsure the output file is moved back Modified: head/net/samba36/files/patch-source3__m4__aclocal.m4 ============================================================================== --- head/net/samba36/files/patch-source3__m4__aclocal.m4 Mon Oct 22 09:17:51 2012 (r306262) +++ head/net/samba36/files/patch-source3__m4__aclocal.m4 Mon Oct 22 09:20:05 2012 (r306263) @@ -1,24 +1,15 @@ ---- ./source3/m4/aclocal.m4.orig 2011-08-09 13:17:47.000000000 +0200 -+++ ./source3/m4/aclocal.m4 2011-10-05 22:59:19.000000000 +0200 -@@ -385,11 +385,15 @@ +--- ./source3/m4/aclocal.m4.orig 2012-09-14 08:12:09.000000000 +0000 ++++ ./source3/m4/aclocal.m4 2012-10-20 13:13:36.975802862 +0000 +@@ -385,7 +385,7 @@ ac_new_flags="" for i in [$]$1; do case [$]i in - -I/usr/include|-I/usr/include/) ;; -+ -I/usr/include|-I/usr/include/|-I/usr/local/include/|-I/usr/local/include) f=1;; ++ -I/usr/include|-I/usr/include/|-I%%LOCALBASE%%/include/|-I%%LOCALBASE%%/include) f=1;; *) ac_new_flags="[$]ac_new_flags [$]i" ;; esac done -- $1=[$]ac_new_flags -+ if test [$]f; then -+ $1="[$]ac_new_flags -I/usr/local/include" -+ else -+ $1=[$]ac_new_flags -+ fi - ]) - - dnl Removes '-L/usr/lib[/]', '-Wl,-rpath,/usr/lib[/]' -@@ -437,104 +441,81 @@ +@@ -437,104 +437,81 @@ dnl those with the standalone portable libiconv installed). AC_MSG_CHECKING(for iconv in $1) jm_cv_func_iconv="no" Added: head/net/samba36/files/patch-source3__modules__vfs_shadow_copy2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/samba36/files/patch-source3__modules__vfs_shadow_copy2.c Mon Oct 22 09:20:05 2012 (r306263) @@ -0,0 +1,127 @@ +--- ./source3/modules/vfs_shadow_copy2.c.orig 2012-10-19 03:37:47.475803452 +0000 ++++ ./source3/modules/vfs_shadow_copy2.c 2012-10-19 03:39:42.665808023 +0000 +@@ -237,7 +237,7 @@ + if (shadow_copy2_match_name(fname, &gmt_start)) { \ + char *name2; \ + rtype ret; \ +- name2 = convert_shadow2_name(handle, fname, gmt_start); \ ++ name2 = convert_shadow2_name(handle, fname, gmt_start, True); \ + if (name2 == NULL) { \ + errno = EINVAL; \ + return eret; \ +@@ -258,7 +258,7 @@ + char *name2; \ + char *smb_base_name_tmp = NULL; \ + rtype ret; \ +- name2 = convert_shadow2_name(handle, smb_fname->base_name, gmt_start); \ ++ name2 = convert_shadow2_name(handle, smb_fname->base_name, gmt_start, True); \ + if (name2 == NULL) { \ + errno = EINVAL; \ + return eret; \ +@@ -285,7 +285,7 @@ + if (shadow_copy2_match_name(fname, &gmt_start)) { \ + char *name2; \ + NTSTATUS ret; \ +- name2 = convert_shadow2_name(handle, fname, gmt_start); \ ++ name2 = convert_shadow2_name(handle, fname, gmt_start, True); \ + if (name2 == NULL) { \ + errno = EINVAL; \ + return eret; \ +@@ -409,7 +409,8 @@ + convert a filename from a share relative path, to a path in the + snapshot directory + */ +-static char *convert_shadow2_name(vfs_handle_struct *handle, const char *fname, const char *gmt_path) ++static char *convert_shadow2_name(vfs_handle_struct *handle, const char *fname, ++ const char *gmt_path, const bool incl_rel) + { + TALLOC_CTX *tmp_ctx = talloc_new(handle->data); + const char *snapdir, *relpath, *baseoffset, *basedir; +@@ -486,11 +487,13 @@ + if (*relpath == '/') relpath++; + if (*baseoffset == '/') baseoffset++; + +- ret = talloc_asprintf(handle->data, "%s/%s/%s/%s", ++ ret = talloc_asprintf(handle->data, "%s/%s%s%s%s%s", + snapdir, + snapshot, ++ *baseoffset ? "/" : "", + baseoffset, +- relpath); ++ *relpath ? "/" : "", ++ incl_rel ? relpath : ""); + DEBUG(6,("convert_shadow2_name: '%s' -> '%s'\n", fname, ret)); + talloc_free(tmp_ctx); + return ret; +@@ -687,68 +690,17 @@ + static const char *shadow_copy2_connectpath(struct vfs_handle_struct *handle, + const char *fname) + { +- TALLOC_CTX *tmp_ctx; +- const char *snapdir, *baseoffset, *basedir, *gmt_start; +- size_t baselen; ++ const char *gmt_start; + char *ret; + + DEBUG(10, ("shadow_copy2_connectpath called with %s\n", fname)); + + if (!shadow_copy2_match_name(fname, &gmt_start)) { +- return handle->conn->connectpath; +- } +- +- /* +- * We have to create a real temporary context because we have +- * to put our result on talloc_tos(). Thus we can't use a +- * talloc_stackframe() here. +- */ +- tmp_ctx = talloc_new(talloc_tos()); +- +- fname = shadow_copy2_normalise_path(tmp_ctx, fname, gmt_start); +- if (fname == NULL) { +- TALLOC_FREE(tmp_ctx); +- return NULL; +- } +- +- snapdir = shadow_copy2_find_snapdir(tmp_ctx, handle); +- if (snapdir == NULL) { +- DEBUG(2,("no snapdir found for share at %s\n", +- handle->conn->connectpath)); +- TALLOC_FREE(tmp_ctx); +- return NULL; ++ return SMB_VFS_NEXT_CONNECTPATH(handle, fname); + } + +- basedir = shadow_copy2_find_basedir(tmp_ctx, handle); +- if (basedir == NULL) { +- DEBUG(2,("no basedir found for share at %s\n", +- handle->conn->connectpath)); +- TALLOC_FREE(tmp_ctx); +- return NULL; +- } +- +- baselen = strlen(basedir); +- baseoffset = handle->conn->connectpath + baselen; +- +- /* some sanity checks */ +- if (strncmp(basedir, handle->conn->connectpath, baselen) != 0 || +- (handle->conn->connectpath[baselen] != 0 +- && handle->conn->connectpath[baselen] != '/')) { +- DEBUG(0,("shadow_copy2_connectpath: basedir %s is not a " +- "parent of %s\n", basedir, +- handle->conn->connectpath)); +- TALLOC_FREE(tmp_ctx); +- return NULL; +- } +- +- if (*baseoffset == '/') baseoffset++; +- +- ret = talloc_asprintf(talloc_tos(), "%s/%.*s/%s", +- snapdir, +- GMT_NAME_LEN, fname, +- baseoffset); ++ ret = convert_shadow2_name(handle, fname, gmt_start, False); + DEBUG(6,("shadow_copy2_connectpath: '%s' -> '%s'\n", fname, ret)); +- TALLOC_FREE(tmp_ctx); + return ret; + } + Modified: head/net/samba36/files/samba.in ============================================================================== --- head/net/samba36/files/samba.in Mon Oct 22 09:17:51 2012 (r306262) +++ head/net/samba36/files/samba.in Mon Oct 22 09:20:05 2012 (r306263) @@ -21,50 +21,13 @@ %%WINBIND%%#winbindd_enable="YES" # # Configuration file can be set with: -#samba_config="%%SAMBA_CONFDIR%%/%%SAMBA_CONFIG%%" +#samba_config="/usr/local/etc/smb.conf" # . /etc/rc.subr name="samba" rcvar=samba_enable - -# Defaults -samba_enable=${samba_enable:=NO} -samba_config_default="%%SAMBA_CONFDIR%%/%%SAMBA_CONFIG%%" -samba_config=${samba_config="${samba_config_default}"} -command_args=${samba_config:+-s "${samba_config}"} -# Fetch parameters from configuration file -testparm_command="%%PREFIX%%/bin/testparm" -smbcontrol_command="%%PREFIX%%/bin/smbcontrol" -samba_parm="${testparm_command} -s -v --parameter-name" -samba_idmap=$(${samba_parm} 'idmap uid' "${samba_config}" 2>/dev/null) -samba_lockdir=$(${samba_parm} 'lock directory' "${samba_config}" 2>/dev/null) -# Load configuration -load_rc_config "${name}" -# Setup dependent variables -if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then - nmbd_enable=${nmbd_enable=YES} - smbd_enable=${smbd_enable=YES} -%%WINBIND%% # Check that winbindd is actually configured -%%WINBIND%% if [ -n "${samba_idmap}" ]; then -%%WINBIND%% winbindd_enable=${winbindd_enable=YES} -%%WINBIND%% fi -fi -# XXX: Hack to enable check of the dependent variables -eval real_${rcvar}="\${${rcvar}:=NO}" ${rcvar}=YES -%%WINBIND%%# winbindd -%%WINBIND%%rcvar=winbindd_enable -%%WINBIND%%winbindd_enable=${winbindd_enable:=NO} -%%WINBIND%%winbindd_flags=${winbindd_flags=''} -# nmbd -rcvar=nmbd_enable -nmbd_enable=${nmbd_enable:=NO} -nmbd_flags=${nmbd_flags="-D"} -# smbd -rcvar=smbd_enable -smbd_enable=${smbd_enable:=NO} -smbd_flags=${smbd_flags="-D"} # Custom commands extra_commands="reload status" start_precmd="samba_start_precmd" @@ -75,16 +38,19 @@ restart_precmd="samba_checkconfig" reload_precmd="samba_checkconfig" reload_cmd="samba_reload_cmd" rcvar_cmd="samba_rcvar_cmd" +# Defaults +samba_config_default="/usr/local/etc/smb.conf" +testparm_command="/usr/local/bin/testparm" +smbcontrol_command="/usr/local/bin/smbcontrol" +samba_parm="${testparm_command} -s -v --parameter-name" +pid_extra= # samba_daemons="nmbd smbd" %%WINBIND%%samba_daemons="${samba_daemons} winbindd" -# Requirements -required_files="${samba_config}" -required_dirs="${samba_lockdir}" samba_checkconfig() { echo -n "Performing sanity check on Samba configuration: " - if ${testparm_command} -s ${samba_config:+"${samba_config}"} >/dev/null 2>&1; then + if ${testparm_command} -s ${samba_config:+"${samba_config}"} >/dev/null 2>&1; then #" echo "OK" else echo "FAILED" @@ -94,6 +60,10 @@ samba_checkconfig() { } samba_start_precmd() { + # Make sure rundir exists + if [ ! -d "%%SAMBA_RUNDIR%%" -a ! -e "%%SAMBA_RUNDIR%%" ]; then + install -m 0755 -d "%%SAMBA_RUNDIR%%" + fi # XXX: Never delete winbindd_idmap, winbindd_cache and group_mapping if [ -n "${samba_lockdir}" -a -d "${samba_lockdir}" ]; then echo -n "Removing stale Samba tdb files: " @@ -108,13 +78,19 @@ samba_start_precmd() { } samba_rcvar_cmd() { - local rcvar + local name rcvar rcvar=${name}_enable - eval ${rcvar}=\${real_${rcvar}} # Prevent recursive calling unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd" # Check master variable run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args} + # Check dependent variables + for name in ${samba_daemons}; do + # XXX + rcvars=''; v='' + rcvar=${name}_enable + run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args} + done } samba_reload_cmd() { @@ -123,7 +99,7 @@ samba_reload_cmd() { unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd" # Apply to all daemons for name in ${samba_daemons}; do - rcvar=${name}_enable + rcvar=${name}_enable command="%%PREFIX%%/sbin/${name}" pidfile="%%SAMBA_RUNDIR%%/${name}${pid_extra}.pid" # Daemon should be enabled and running @@ -150,9 +126,9 @@ samba_cmd() { result=0 # Apply to all daemons for name in ${samba_daemons}; do - rcvar=${name}_enable # XXX rcvars=''; v='' + rcvar=${name}_enable command="%%PREFIX%%/sbin/${name}" pidfile="%%SAMBA_RUNDIR%%/${name}${pid_extra}.pid" # Daemon should be enabled and running @@ -165,4 +141,50 @@ samba_cmd() { return ${result} } +samba_config_init() { + local name + # Load configuration + load_rc_config "${name}" + for name in ${samba_daemons}; do + load_rc_config "${name}" + done + # Location of the config + samba_config=${samba_config="${samba_config_default}"} #" + # XXX: Hack to work around name change of pid file with non-default config + if [ -n "${samba_config}" -a "${samba_config}" != "${samba_config_default}" ]; then + pid_extra="-$(basename "${samba_config}")" + fi + # Setup dependent variables + if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then + nmbd_enable=${nmbd_enable=YES} + smbd_enable=${smbd_enable=YES} + fi + # Defaults + samba_enable=${samba_enable:=NO} + nmbd_enable=${nmbd_enable:=NO} + smbd_enable=${smbd_enable:=NO} +%%WINBIND%% # Winbindd +%%WINBIND%% if [ -z "${winbind_enable}" ]; then +%%WINBIND%% samba_idmap=$(${samba_parm} 'idmap uid' "${samba_config}" 2>/dev/null) +%%WINBIND%% # Check that winbindd is actually configured +%%WINBIND%% if [ -n "${samba_idmap}" ]; then +%%WINBIND%% winbindd_enable="YES" +%%WINBIND%% fi +%%WINBIND%% winbindd_enable=${winbindd_enable:=NO} +%%WINBIND%% fi +} + +# Load configuration variables +samba_config_init +# Where is lockdir +samba_lockdir=$(${samba_parm} 'lock directory' "${samba_config}" 2>/dev/null) +# Common flags +command_args=${samba_config:+-s "${samba_config}"} #" +nmbd_flags=${nmbd_flags="-D"} +smbd_flags=${smbd_flags="-D"} +%%WINBIND%%winbindd_flags=${winbindd_flags=''} +# Requirements +required_files="${samba_config}" +required_dirs="${samba_lockdir}" + run_rc_command "$1" Modified: head/net/samba36/pkg-plist.swat ============================================================================== --- head/net/samba36/pkg-plist.swat Mon Oct 22 09:17:51 2012 (r306262) +++ head/net/samba36/pkg-plist.swat Mon Oct 22 09:20:05 2012 (r306263) @@ -1,4 +1,3 @@ -share/swat/help/Samba3-ByExample/net2000users.html share/swat/help/Samba3-ByExample/Big500users.html share/swat/help/Samba3-ByExample/DMSMig.html share/swat/help/Samba3-ByExample/DomApps.html @@ -10,48 +9,64 @@ share/swat/help/Samba3-ByExample/appendi share/swat/help/Samba3-ByExample/ch14.html share/swat/help/Samba3-ByExample/go01.html share/swat/help/Samba3-ByExample/happy.html -@comment share/swat/help/Samba3-ByExample/images/AccountingNetwork.png -@comment share/swat/help/Samba3-ByExample/images/Charity-Network.png -@comment share/swat/help/Samba3-ByExample/images/HostAnnouncment.png -@comment share/swat/help/Samba3-ByExample/images/NullConnect.png -@comment share/swat/help/Samba3-ByExample/images/UNIX-Samba-and-LDAP.png -@comment share/swat/help/Samba3-ByExample/images/UserConnect.png -@comment share/swat/help/Samba3-ByExample/images/UserMgrNT4.png -@comment share/swat/help/Samba3-ByExample/images/WINREPRESSME-Capture.png -@comment share/swat/help/Samba3-ByExample/images/WINREPRESSME-Capture2.png -@comment share/swat/help/Samba3-ByExample/images/WindowsXP-NullConnection.png -@comment share/swat/help/Samba3-ByExample/images/WindowsXP-UserConnection.png -@comment share/swat/help/Samba3-ByExample/images/XP-screen001.png -@comment share/swat/help/Samba3-ByExample/images/acct2net.png -@comment share/swat/help/Samba3-ByExample/images/ch7-dual-additive-LDAP-Ok.png -@comment share/swat/help/Samba3-ByExample/images/ch7-dual-additive-LDAP.png -@comment share/swat/help/Samba3-ByExample/images/ch7-fail-overLDAP.png -@comment share/swat/help/Samba3-ByExample/images/ch7-singleLDAP.png -@comment share/swat/help/Samba3-ByExample/images/ch8-migration.png -@comment share/swat/help/Samba3-ByExample/images/chap4-net.png -@comment share/swat/help/Samba3-ByExample/images/chap5-net.png -@comment share/swat/help/Samba3-ByExample/images/chap6-net.png -@comment share/swat/help/Samba3-ByExample/images/chap7-idresol.png -@comment share/swat/help/Samba3-ByExample/images/chap7-net-Ar.png -@comment share/swat/help/Samba3-ByExample/images/chap7-net2-Br.png -@comment share/swat/help/Samba3-ByExample/images/chap9-ADSDC.png -@comment share/swat/help/Samba3-ByExample/images/chap9-SambaDC.png -@comment share/swat/help/Samba3-ByExample/images/imc-usermanager2.png -@comment share/swat/help/Samba3-ByExample/images/lam-config.png -@comment share/swat/help/Samba3-ByExample/images/lam-group-members.png -@comment share/swat/help/Samba3-ByExample/images/lam-groups.png -@comment share/swat/help/Samba3-ByExample/images/lam-hosts.png -@comment share/swat/help/Samba3-ByExample/images/lam-login.png -@comment share/swat/help/Samba3-ByExample/images/lam-users.png -@comment share/swat/help/Samba3-ByExample/images/openmag.png -@comment share/swat/help/Samba3-ByExample/images/wxpp001.png -@comment share/swat/help/Samba3-ByExample/images/wxpp004.png -@comment share/swat/help/Samba3-ByExample/images/wxpp006.png -@comment share/swat/help/Samba3-ByExample/images/wxpp007.png -@comment share/swat/help/Samba3-ByExample/images/wxpp008.png +share/swat/help/Samba3-ByExample/images/AccountingNetwork.png +share/swat/help/Samba3-ByExample/images/Charity-Network.png +share/swat/help/Samba3-ByExample/images/Domain-WorkgroupAnnouncement.png +share/swat/help/Samba3-ByExample/images/HostAnnouncment.png +share/swat/help/Samba3-ByExample/images/LocalMasterAnnouncement.png +share/swat/help/Samba3-ByExample/images/NullConnect.png +share/swat/help/Samba3-ByExample/images/UNIX-Samba-and-LDAP.png +share/swat/help/Samba3-ByExample/images/UserConnect.png +share/swat/help/Samba3-ByExample/images/UserMgrNT4.png +share/swat/help/Samba3-ByExample/images/WINREPRESSME-Capture.png +share/swat/help/Samba3-ByExample/images/WINREPRESSME-Capture2.png +share/swat/help/Samba3-ByExample/images/Windows-ME-WINEPRESSME-Startup-30min-ProtocolStats.png +share/swat/help/Samba3-ByExample/images/Windows-ME-WINEPRESSME-Startup-30min-TraceStats.png +share/swat/help/Samba3-ByExample/images/WindowsXP-NullConnection.png +share/swat/help/Samba3-ByExample/images/WindowsXP-UserConnection.png +share/swat/help/Samba3-ByExample/images/XP-screen001.png +share/swat/help/Samba3-ByExample/images/acct2net.png +share/swat/help/Samba3-ByExample/images/ch7-dual-additive-LDAP-Ok.png +share/swat/help/Samba3-ByExample/images/ch7-dual-additive-LDAP.png +share/swat/help/Samba3-ByExample/images/ch7-fail-overLDAP.png +share/swat/help/Samba3-ByExample/images/ch7-singleLDAP.png +share/swat/help/Samba3-ByExample/images/ch8-migration.png +share/swat/help/Samba3-ByExample/images/chap4-net.png +share/swat/help/Samba3-ByExample/images/chap5-net.png +share/swat/help/Samba3-ByExample/images/chap6-net.png +share/swat/help/Samba3-ByExample/images/chap7-idresol.png +share/swat/help/Samba3-ByExample/images/chap7-net-A.png +share/swat/help/Samba3-ByExample/images/chap7-net-Ar.png +share/swat/help/Samba3-ByExample/images/chap7-net.png +share/swat/help/Samba3-ByExample/images/chap7-net2-B.png +share/swat/help/Samba3-ByExample/images/chap7-net2-Br.png +share/swat/help/Samba3-ByExample/images/chap7-net2.png +share/swat/help/Samba3-ByExample/images/chap7-net2r.png +share/swat/help/Samba3-ByExample/images/chap7-netr.png +share/swat/help/Samba3-ByExample/images/chap9-ADSDC.png +share/swat/help/Samba3-ByExample/images/chap9-SambaDC.png +share/swat/help/Samba3-ByExample/images/imc-usermanager2.png +share/swat/help/Samba3-ByExample/images/lam-config.png +share/swat/help/Samba3-ByExample/images/lam-group-members.png +share/swat/help/Samba3-ByExample/images/lam-groups.png +share/swat/help/Samba3-ByExample/images/lam-hosts.png +share/swat/help/Samba3-ByExample/images/lam-login.png +share/swat/help/Samba3-ByExample/images/lam-users.png +share/swat/help/Samba3-ByExample/images/openmag.png +share/swat/help/Samba3-ByExample/images/wxpp001.png +share/swat/help/Samba3-ByExample/images/wxpp004.png +share/swat/help/Samba3-ByExample/images/wxpp006.png +share/swat/help/Samba3-ByExample/images/wxpp007.png +share/swat/help/Samba3-ByExample/images/wxpp008.png +share/swat/help/Samba3-ByExample/images/wxpp010.png +share/swat/help/Samba3-ByExample/images/wxpp011.png +share/swat/help/Samba3-ByExample/images/wxpp012.png +share/swat/help/Samba3-ByExample/images/wxpp013.png +share/swat/help/Samba3-ByExample/images/wxpp015.png share/swat/help/Samba3-ByExample/index.html share/swat/help/Samba3-ByExample/ix01.html share/swat/help/Samba3-ByExample/kerberos.html +share/swat/help/Samba3-ByExample/net2000users.html share/swat/help/Samba3-ByExample/ntmigration.html share/swat/help/Samba3-ByExample/nw4migration.html share/swat/help/Samba3-ByExample/pr01.html @@ -123,60 +138,74 @@ share/swat/help/Samba3-HOWTO/domain-memb share/swat/help/Samba3-HOWTO/go01.html share/swat/help/Samba3-HOWTO/groupmapping.html share/swat/help/Samba3-HOWTO/idmapper.html -@comment share/swat/help/Samba3-HOWTO/images/10small.png -@comment share/swat/help/Samba3-HOWTO/images/11small.png -@comment share/swat/help/Samba3-HOWTO/images/12small.png -@comment share/swat/help/Samba3-HOWTO/images/13small.png -@comment share/swat/help/Samba3-HOWTO/images/14small.png -@comment share/swat/help/Samba3-HOWTO/images/1small.png -@comment share/swat/help/Samba3-HOWTO/images/2small.png -@comment share/swat/help/Samba3-HOWTO/images/3small.png -@comment share/swat/help/Samba3-HOWTO/images/4small.png -@comment share/swat/help/Samba3-HOWTO/images/5small.png -@comment share/swat/help/Samba3-HOWTO/images/6small.png -@comment share/swat/help/Samba3-HOWTO/images/7small.png -@comment share/swat/help/Samba3-HOWTO/images/8small.png -@comment share/swat/help/Samba3-HOWTO/images/9small.png -@comment share/swat/help/Samba3-HOWTO/images/WME001.png -@comment share/swat/help/Samba3-HOWTO/images/WME002.png -@comment share/swat/help/Samba3-HOWTO/images/WME003.png -@comment share/swat/help/Samba3-HOWTO/images/WME005.png -@comment share/swat/help/Samba3-HOWTO/images/WME009.png -@comment share/swat/help/Samba3-HOWTO/images/WME010.png -@comment share/swat/help/Samba3-HOWTO/images/WME013.png -@comment share/swat/help/Samba3-HOWTO/images/WME014.png -@comment share/swat/help/Samba3-HOWTO/images/WXPP002.png -@comment share/swat/help/Samba3-HOWTO/images/WXPP003.png -@comment share/swat/help/Samba3-HOWTO/images/WXPP005.png -@comment share/swat/help/Samba3-HOWTO/images/WXPP009.png -@comment share/swat/help/Samba3-HOWTO/images/WXPP014.png -@comment share/swat/help/Samba3-HOWTO/images/a_small.png -@comment share/swat/help/Samba3-HOWTO/images/access1.png -@comment share/swat/help/Samba3-HOWTO/images/browsing1.png -@comment share/swat/help/Samba3-HOWTO/images/cups1.png -@comment share/swat/help/Samba3-HOWTO/images/cups2.png -@comment share/swat/help/Samba3-HOWTO/images/domain.png -@comment share/swat/help/Samba3-HOWTO/images/ethereal1.png -@comment share/swat/help/Samba3-HOWTO/images/ethereal2.png -@comment share/swat/help/Samba3-HOWTO/images/idmap-gid2sid.png -@comment share/swat/help/Samba3-HOWTO/images/idmap-sid2gid.png -@comment share/swat/help/Samba3-HOWTO/images/idmap-sid2uid.png -@comment share/swat/help/Samba3-HOWTO/images/idmap-store-gid2sid.png -@comment share/swat/help/Samba3-HOWTO/images/idmap-uid2sid.png -@comment share/swat/help/Samba3-HOWTO/images/idmap_winbind_no_loop.png -@comment share/swat/help/Samba3-HOWTO/images/pdftoepsonusb.png -@comment share/swat/help/Samba3-HOWTO/images/pdftosocket.png -@comment share/swat/help/Samba3-HOWTO/images/trusts1.png -@comment share/swat/help/Samba3-HOWTO/images/w2kp001.png -@comment share/swat/help/Samba3-HOWTO/images/w2kp002.png -@comment share/swat/help/Samba3-HOWTO/images/w2kp003.png -@comment share/swat/help/Samba3-HOWTO/images/w2kp004.png -@comment share/swat/help/Samba3-HOWTO/images/w2kp005.png -@comment share/swat/help/Samba3-HOWTO/images/wxpp001.png -@comment share/swat/help/Samba3-HOWTO/images/wxpp004.png -@comment share/swat/help/Samba3-HOWTO/images/wxpp006.png -@comment share/swat/help/Samba3-HOWTO/images/wxpp007.png -@comment share/swat/help/Samba3-HOWTO/images/wxpp008.png +share/swat/help/Samba3-HOWTO/images/10small.png +share/swat/help/Samba3-HOWTO/images/11small.png +share/swat/help/Samba3-HOWTO/images/12small.png +share/swat/help/Samba3-HOWTO/images/13small.png +share/swat/help/Samba3-HOWTO/images/14small.png +share/swat/help/Samba3-HOWTO/images/1small.png +share/swat/help/Samba3-HOWTO/images/2small.png +share/swat/help/Samba3-HOWTO/images/3small.png +share/swat/help/Samba3-HOWTO/images/4small.png +share/swat/help/Samba3-HOWTO/images/5small.png +share/swat/help/Samba3-HOWTO/images/6small.png +share/swat/help/Samba3-HOWTO/images/7small.png +share/swat/help/Samba3-HOWTO/images/8small.png +share/swat/help/Samba3-HOWTO/images/9small.png +share/swat/help/Samba3-HOWTO/images/WME001.png +share/swat/help/Samba3-HOWTO/images/WME002.png +share/swat/help/Samba3-HOWTO/images/WME003.png +share/swat/help/Samba3-HOWTO/images/WME004.png +share/swat/help/Samba3-HOWTO/images/WME005.png +share/swat/help/Samba3-HOWTO/images/WME006.png +share/swat/help/Samba3-HOWTO/images/WME007.png +share/swat/help/Samba3-HOWTO/images/WME008.png +share/swat/help/Samba3-HOWTO/images/WME009.png +share/swat/help/Samba3-HOWTO/images/WME010.png +share/swat/help/Samba3-HOWTO/images/WME011.png +share/swat/help/Samba3-HOWTO/images/WME012.png +share/swat/help/Samba3-HOWTO/images/WME013.png +share/swat/help/Samba3-HOWTO/images/WME014.png +share/swat/help/Samba3-HOWTO/images/WXPP002.png +share/swat/help/Samba3-HOWTO/images/WXPP003.png +share/swat/help/Samba3-HOWTO/images/WXPP005.png +share/swat/help/Samba3-HOWTO/images/WXPP009.png +share/swat/help/Samba3-HOWTO/images/WXPP014.png +share/swat/help/Samba3-HOWTO/images/a_small.png +share/swat/help/Samba3-HOWTO/images/access1.png +share/swat/help/Samba3-HOWTO/images/browsing1.png +share/swat/help/Samba3-HOWTO/images/cups1.png +share/swat/help/Samba3-HOWTO/images/cups2.png +share/swat/help/Samba3-HOWTO/images/domain.png +share/swat/help/Samba3-HOWTO/images/ethereal1.png +share/swat/help/Samba3-HOWTO/images/ethereal2.png +share/swat/help/Samba3-HOWTO/images/idmap-gid2sid.png +share/swat/help/Samba3-HOWTO/images/idmap-groups.png +share/swat/help/Samba3-HOWTO/images/idmap-sid2gid.png +share/swat/help/Samba3-HOWTO/images/idmap-sid2uid.png +share/swat/help/Samba3-HOWTO/images/idmap-store-gid2sid.png +share/swat/help/Samba3-HOWTO/images/idmap-uid2sid.png +share/swat/help/Samba3-HOWTO/images/idmap.png +share/swat/help/Samba3-HOWTO/images/idmap_winbind_no_loop.png +share/swat/help/Samba3-HOWTO/images/pdftoepsonusb.png +share/swat/help/Samba3-HOWTO/images/pdftosocket.png +share/swat/help/Samba3-HOWTO/images/trusts1.png +share/swat/help/Samba3-HOWTO/images/w2kp001.png +share/swat/help/Samba3-HOWTO/images/w2kp002.png +share/swat/help/Samba3-HOWTO/images/w2kp003.png +share/swat/help/Samba3-HOWTO/images/w2kp004.png +share/swat/help/Samba3-HOWTO/images/w2kp005.png +share/swat/help/Samba3-HOWTO/images/w2kp006.png +share/swat/help/Samba3-HOWTO/images/wxpp001.png +share/swat/help/Samba3-HOWTO/images/wxpp004.png +share/swat/help/Samba3-HOWTO/images/wxpp006.png +share/swat/help/Samba3-HOWTO/images/wxpp007.png +share/swat/help/Samba3-HOWTO/images/wxpp008.png +share/swat/help/Samba3-HOWTO/images/wxpp010.png +share/swat/help/Samba3-HOWTO/images/wxpp011.png +share/swat/help/Samba3-HOWTO/images/wxpp012.png +share/swat/help/Samba3-HOWTO/images/wxpp013.png +share/swat/help/Samba3-HOWTO/images/wxpp015.png share/swat/help/Samba3-HOWTO/index.html share/swat/help/Samba3-HOWTO/install.html share/swat/help/Samba3-HOWTO/integrate-ms-networks.html @@ -252,6 +281,7 @@ share/swat/help/manpages/testparm.1.html share/swat/help/manpages/vfs_acl_tdb.8.html share/swat/help/manpages/vfs_acl_xattr.8.html share/swat/help/manpages/vfs_aio_fork.8.html +share/swat/help/manpages/vfs_aio_pthread.8.html share/swat/help/manpages/vfs_audit.8.html share/swat/help/manpages/vfs_cacheprime.8.html share/swat/help/manpages/vfs_cap.8.html @@ -322,10 +352,10 @@ share/swat/lang/tr/images/viewconfig.gif @dirrm share/swat/include @dirrm share/swat/images @dirrm share/swat/help/manpages -@comment @dirrm share/swat/help/Samba3-HOWTO/images +@dirrm share/swat/help/Samba3-HOWTO/images @dirrm share/swat/help/Samba3-HOWTO @dirrm share/swat/help/Samba3-Developers-Guide -@comment @dirrm share/swat/help/Samba3-ByExample/images +@dirrm share/swat/help/Samba3-ByExample/images @dirrm share/swat/help/Samba3-ByExample @dirrm share/swat/help @dirrm share/swat
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210220920.q9M9K5GX078253>