remove samba4 package

This commit is contained in:
coolsnowwolf 2018-05-13 23:48:46 +08:00
parent 29f2ced3e6
commit f963411269
32 changed files with 141 additions and 2096 deletions

View File

@ -1,11 +0,0 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI for Samba4
LUCI_DEPENDS:=+samba4x-server
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -1,28 +0,0 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
module("luci.controller.samba4", package.seeall)
function index()
if not nixio.fs.access("/etc/config/samba4") then
return
end
local page
entry({"admin", "nas"}, firstchild(), "NAS", 45).dependent = false
page = entry({"admin", "nas", "samba4"}, cbi("samba4"), _("Network Shares"))
page.dependent = true
end

View File

@ -1,85 +0,0 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
m = Map("samba4", translate("Network Shares"))
s = m:section(TypedSection, "samba", "Samba")
s.anonymous = true
s:tab("general", translate("General Settings"))
s:tab("template", translate("Edit Template"))
s:taboption("general", Flag, "enabled", translate("Enabled"))
s:taboption("general", Value, "name", translate("Hostname"))
s:taboption("general", Value, "description", translate("Description"))
s:taboption("general", Value, "workgroup", translate("Workgroup"))
s:taboption("general", Flag, "homes", translate("Share home-directories"))
s:taboption("general", Flag, "disablenb", translate("Disable netbios"))
s:taboption("general", Flag, "hotplug", translate("Hotplug"), translate("Automatically add to shares when new drives attached."))
tmpl = s:taboption("template", Value, "_tmpl",
translate("Edit the template that is used for generating the samba configuration."),
translate("This is the content of the file '/etc/samba/smb.conf.template' from which your samba configuration will be generated. " ..
"Values enclosed by pipe symbols ('|') should not be changed. They get their values from the 'General Settings' tab."))
tmpl.template = "cbi/tvalue"
tmpl.rows = 20
function tmpl.cfgvalue(self, section)
return nixio.fs.readfile("/etc/samba/smb.conf.template")
end
function tmpl.write(self, section, value)
value = value:gsub("\r\n?", "\n")
nixio.fs.writefile("//etc/samba/smb.conf.template", value)
end
s = m:section(TypedSection, "sambashare", translate("Shared Directories"))
s.anonymous = true
s.addremove = true
s.template = "cbi/tblsection"
s:option(Value, "name", translate("Name"))
pth = s:option(Value, "path", translate("Path"))
if nixio.fs.access("/etc/config/fstab") then
pth.titleref = luci.dispatcher.build_url("admin", "system", "fstab")
end
s:option(Value, "users", translate("Allowed users")).rmempty = true
ro = s:option(Flag, "read_only", translate("Read-only"))
ro.rmempty = false
ro.enabled = "yes"
ro.disabled = "no"
go = s:option(Flag, "guest_ok", translate("Allow guests"))
go.rmempty = false
go.enabled = "yes"
go.disabled = "no"
cm = s:option(Value, "create_mask", translate("Create mask"))
cm.rmempty = true
cm.size = 4
dm = s:option(Value, "dir_mask", translate("Directory mask"))
dm.rmempty = true
dm.size = 4
function m.on_commit(self,map)
require("luci.sys").call('/sbin/reload_config')
end
return m

View File

@ -1,57 +0,0 @@
#!/bin/sh
# Samba自动配置脚本参考PandoraBox的脚本框架并重写。以下为原脚本作者信息
#===================================================================================
#
# D-Team Technology Co.,Ltd. ShenZhen
# 作者:Vic
#
#
# 警告:对着屏幕的哥们,我们允许你使用此脚本,但不允许你抹去作者的信息,请保留这段话。
#===================================================================================
. /lib/functions.sh
set_samba(){
section=$(echo $get_uuid | sed 's/-//g')
uci set samba4.${section}="sambashare"
uci set samba4.${section}.name="Disk_${device}"
uci set samba4.${section}.path="${mountpoint}"
uci set samba4.${section}.read_only="no"
uci set samba4.${section}.guest_ok="yes"
uci commit samba4
}
set_samba_path(){
section=$(echo $get_uuid | sed 's/-//g')
uci set samba4.${section}.path="${mountpoint}"
uci commit samba4
}
device=`basename $DEVPATH`
case "$ACTION" in
add)
if [ z$(uci get samba4.@samba[0].hotplug) == z1 ]
then
case "$device" in
sd*) ;;
md*) ;;
hd*);;
mmcblk*);;
*) return;;
esac
sleep 2
mountpoint=`sed -ne "s|^[^ ]*/$device ||; T; s/ .*//p" /proc/self/mounts`
get_uuid=`block info | grep "/dev/${device}" | awk -F "UUID=" '{print $2}'| awk -F "\"" '{print $2}'`
have_uuid=$(uci show samba4 | grep -c "$get_uuid")
[ "$have_uuid" = "0" ] && set_samba
[ "$have_uuid" -gt "0" ] && set_samba_path
/etc/init.d/samba4 restart
fi
;;
remove)
;;
esac

View File

@ -0,0 +1,141 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=qemu
PKG_VERSION:=2.11.1
PKG_RELEASE:=2
PKG_SOURCE_URL:=https://download.qemu.org/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=8a5145d1f8bd2eadc6776f3e13c68cd28d01349e30639bdbcb26ac588d668686
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
HOST_BUILD_PARALLEL:=1
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
HOST_BUILD_DEPENDS:=glib2/host
define Package/qemu-userspace
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=Virtualization
TITLE:=qemu $(PKG_VERSION) (Linux/BSD User space emulation)
URL:=https://www.qemu.org
DEPENDS:=+glib2 +zlib +libpthread @BROKEN
endef
define Package/qemu-userspace/description
QEMU is a generic and open source machine emulator and virtualizer.
(This package version is for user space emulation only, not full system.)
endef
HOST_CONFIGURE_ARGS += \
--audio-drv-list='' \
--disable-debug-info \
--disable-modules \
--disable-sdl \
--disable-qom-cast-debug \
--disable-virtfs \
--disable-vnc \
--disable-debug-tcg \
--disable-sparse \
--disable-strip \
--disable-vnc-sasl \
--disable-vnc-jpeg \
--disable-vnc-png \
--disable-vde \
--disable-netmap \
--disable-xen \
--disable-xen-pci-passthrough \
--disable-xen-pv-domain-build \
--disable-brlapi \
--disable-bluez \
--disable-tcg-interpreter \
--disable-cap-ng \
--disable-spice \
--disable-libiscsi \
--disable-libnfs \
--disable-cocoa \
--disable-werror \
--disable-stack-protector \
--disable-curl \
--disable-linux-aio \
--disable-attr \
--disable-crypto-afalg \
--disable-docs \
--disable-vhost-net \
--disable-vhost-scsi \
--disable-vhost-vsock \
--disable-opengl \
--disable-rbd \
--disable-xfsctl \
--disable-smartcard \
--disable-libusb \
--disable-usb-redir \
--disable-zlib-test \
--disable-lzo \
--disable-snappy \
--disable-bzip2 \
--disable-guest-agent-msi \
--without-vss-sdk \
--without-win-sdk \
--disable-tools \
--disable-seccomp \
--disable-glusterfs \
--disable-gtk \
--disable-gnutls \
--disable-nettle \
--disable-gcrypt \
--disable-rdma \
--disable-vte \
--disable-virglrenderer \
--disable-tpm \
--disable-libssh2 \
--disable-tcmalloc \
--disable-jemalloc \
--disable-strip \
--disable-replication \
--disable-vxhs \
--disable-system \
--disable-guest-agent \
--disable-pie \
--disable-live-block-migration \
--disable-numa \
--disable-capstone \
--disable-git-update \
--disable-hax \
--disable-kvm \
--disable-blobs
# --disable-tcg
# --disable-bsd-user
# QEMU configure script does not recognize these options
HOST_CONFIGURE_ARGS:=$(filter-out \
--target=% \
--host=% \
--build=% \
--program-prefix=% \
--program-suffix=% \
--exec-prefix=% \
--disable-nls \
, $(HOST_CONFIGURE_ARGS))
# does this do anything in usermode?
CONFIGURE_ARGS:=$(filter-out \
--disable-hax \
--disable-kvm \
--disable-blobs \
, $(HOST_CONFIGURE_ARGS))
CONFIGURE_ARGS += \
--cross-prefix=$(TARGET_CROSS) \
--host-cc="$(HOSTCC)"
$(eval $(call HostBuild))
$(eval $(call BuildPackage,qemu-userspace))

View File

@ -1,283 +0,0 @@
#
# Copyright (C) 2007-2015 wongsyrone
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=samba4x
PKG_VERSION:=4.4.2
PKG_RELEASE:=1
PKG_SOURCE_URL:= \
http://download.samba.org/pub/samba/stable \
http://ftp.samba.org/pub/samba \
http://ftp.samba.org/pub/samba/old-versions
PKG_SOURCE:=samba-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/samba-$(PKG_VERSION)
PKG_MD5SUM:=03a65a3adf08ceb1636ad59d234d7f9d
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DEPENDS:=heimdal
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
# for "uname release type" check
include $(INCLUDE_DIR)/kernel.mk
define Package/samba4x-server
SECTION:=net
CATEGORY:=Network
TITLE:=Samba $(PKG_VERSION) SMB/CIFS server
URL:=http://www.samba.org/
DEPENDS:=+zlib +libpthread +libpopt +libcap +python-light
#DEPENDS+= +libreadline +libuuid +libtirpc libtirpc
endef
define Package/samba4x-server/description
The Samba software suite is a collection of programs that implements the
SMB protocol for UNIX systems, allowing you to serve files and printers to
Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred
to as the LanManager or Netbios protocol.
endef
# fix include "dbwrap/dbwrap_open.h" not found in auth/credentials/credentials_secrets.c -I$(PKG_BUILD_DIR)/source3/lib
EXTRA_CFLAGS += \
-ffunction-sections -fdata-sections \
-Wno-deprecated-declarations
EXTRA_LDFLAGS += -Wl,--gc-sections
# Use host compiled python2 as interpreter
# Use target python2-config to retrive cflags, ldflags, libs, etc.
# Must have python2 patched to make python2-config works
# _python_sysroot="$(STAGING_DIR)" \
_python_prefix="/usr" \
_python_exec_prefix="/usr/bin" \
PYTHON="$(STAGING_DIR_HOST)/bin/python2"
CONFIGURE_VARS += \
PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python2-config" \
python_LDFLAGS="" \
python_LIBDIR=""
# XXX: Be sure to take care of commas(,) or you will get 'out of range' error when waf configuring settings.
SAMBA4_IDMAP_MODULES_SHARED := idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2,
SAMBA4_IDMAP_MODULES_STATIC :=
SAMBA4_PDB_MODULES_SHARED := pdb_wbc_sam,pdb_samba4,
SAMBA4_PDB_MODULES_STATIC := pdb_smbpasswd,pdb_tdbsam,
SAMBA4_AUTH_MODULES_SHARED := auth_wbc,auth_script,auth_samba4
SAMBA4_AUTH_MODULES_STATIC := auth_sam,auth_unix,
SAMBA4_VFS_MODULES_STATIC := vfs_default,vfs_aio_pthread
SAMBA4_MODULES_SHARED = "${SAMBA4_IDMAP_MODULES_SHARED}${SAMBA4_PDB_MODULES_SHARED}${SAMBA4_AUTH_MODULES_SHARED}"
SAMBA4_MODULES_STATIC = "${SAMBA4_IDMAP_MODULES_STATIC}${SAMBA4_PDB_MODULES_STATIC}${SAMBA4_AUTH_MODULES_STATIC}${SAMBA4_VFS_MODULES_STATIC}"
# Taken from package-defaults.mk
SAMBA_CONFIGURE_ARGS += \
--target=$(GNU_TARGET_NAME) \
--program-prefix="" \
--prefix=$(CONFIGURE_PREFIX) \
--exec-prefix=$(CONFIGURE_PREFIX) \
--bindir=$(CONFIGURE_PREFIX)/bin \
--sbindir=$(CONFIGURE_PREFIX)/sbin \
--libexecdir=$(CONFIGURE_PREFIX)/lib \
--sysconfdir=/etc \
--datadir=$(CONFIGURE_PREFIX)/share \
--localstatedir=/var \
--mandir=$(CONFIGURE_PREFIX)/man \
--infodir=$(CONFIGURE_PREFIX)/info
# Should have a look before compiling.
SAMBA43_CACHE := " \
\nChecking simple C program: OK \
\nrpath library support: OK \
\n-Wl,--version-script support: OK \
\nChecking getconf LFS_CFLAGS: NO \
\nChecking for large file support without additional flags: OK \
\nChecking for -D_LARGE_FILES: OK \
\nChecking correct behavior of strtoll: NO \
\nChecking for working strptime: OK \
\nChecking for C99 vsnprintf: OK \
\nChecking for HAVE_SHARED_MMAP: OK \
\nChecking for HAVE_MREMAP: OK \
\nChecking for HAVE_INCOHERENT_MMAP: NO \
\nChecking for HAVE_SECURE_MKSTEMP: OK \
\nChecking for HAVE_IFACE_GETIFADDRS: OK \
\nChecking for kernel change notify support: OK \
\nChecking for Linux kernel oplocks: OK \
\nChecking for kernel share modes: OK \
\nChecking if can we convert from CP850 to UCS-2LE: OK \
\nChecking if can we convert from UTF-8 to UCS-2LE: OK \
\nChecking whether we can use Linux thread-specific credentials with 32-bit system calls: OK \
\nChecking whether we can use Linux thread-specific credentials: OK \
\nChecking whether setreuid is available: OK \
\nChecking whether setresuid is available: OK \
\nChecking whether seteuid is available: OK \
\nChecking whether fcntl locking is available: OK \
\nChecking whether the realpath function allows a NULL argument: OK \
\nChecking whether POSIX capabilities are available: OK \
\nChecking for the maximum value of the 'time_t' type: NO \
\nChecking for ftruncate extend: OK \
\nvfs_fileid checking for statfs() and struct statfs.f_fsid: OK \
\ngetcwd takes a NULL argument: OK \
\nChecking value of NSIG: \"65\" \
\nChecking value of _NSIG: \"65\" \
\nChecking value of SIGRTMAX: \"64\" \
\nChecking value of SIGRTMIN: \"34\" \
\n"
# \nChecking for the maximum value of the 'time_t' type: OK <<-- check it, not for sure. It seems musl-libc don't have max time_t
# do the renaming trick
define Build/Prepare
$(call Build/Prepare/Default)
$(SED) 's#__OPENWRT_SAMBA_MULTICALL__#$(PKG_NAME)_multicall#g' $(PKG_BUILD_DIR)/source3/wscript_build
$(CP) ./files/python2-config "$(STAGING_DIR)/usr/bin/python2-config"
endef
define Build/Configure
(cd $(PKG_BUILD_DIR); \
echo -e >cache.txt $(SAMBA43_CACHE) " \
\nChecking uname release type: \"$(LINUX_VERSION)\" \
\nChecking uname machine type: \"$(ARCH)\" \
\nChecking uname version type: \"#1 Tue Nov 1 12:34:56 UTC 2013\" \
\nChecking uname sysname type: \"Linux\" \
\n" ; \
$(CONFIGURE_VARS) \
./buildtools/bin/waf configure -j$(shell nproc) \
--cross-compile \
--cross-answers=$(PKG_BUILD_DIR)/cache.txt \
--hostcc="$(HOSTCC)" \
$(SAMBA_CONFIGURE_ARGS) \
--with-lockdir=/var/lock \
--with-logfilebase=/var/log \
--with-piddir=/var/run \
--with-privatedir=/etc/samba \
--enable-fhs \
--without-dmapi \
--disable-glusterfs \
--disable-rpath \
--disable-rpath-install \
--disable-avahi \
--disable-cups \
--disable-iprint \
--disable-gnutls \
--with-relro \
--with-sendfile-support \
--without-acl-support \
--without-ads \
--without-ad-dc \
--without-automount \
--without-cluster-support \
--without-dnsupdate \
--without-fam \
--without-gettext \
--without-iconv \
--without-ldap \
--without-pam \
--without-pie \
--without-regedit \
--without-systemd \
--without-utmp \
--without-winbind \
--enable-auto-reconfigure \
--nonshared-binary=$(PKG_NAME)_multicall \
--with-static-modules=${SAMBA4_MODULES_STATIC} \
--with-shared-modules=${SAMBA4_MODULES_SHARED} \
--bundled-libraries='heimdal,!asn1_compile,!compile_et,!zlib,popt,talloc,pytalloc,pytalloc-util' \
--without-quotas \
--with-syslog \
--nopyc \
--nopyo \
)
endef
# leftovers of samba 4.0: --with-shared-modules=pdb_tdbsam,pdb_wbc_sam,idmap_nss,nss_info_template,auth_wbc
# simple file server: --bundled-libraries=NONE --builtin-libraries=NONE
# --bundled-libraries=ALL ---> do not find libs from system, use integrated libs
# '--nonshared-binary' works like '--disable-shared-libs' in samba 4.0.26
# or use '--builtin-libraries' to specify which library to build into.
# --nonshared-binary=smbd/smbd,nmbd/nmbd,smbpasswd,smbcontrol,smbtree,smbstatus,smbcquotas,smbcacls,nmblookup,testparm,$(PKG_NAME)_multicall
# 'builtin-libraries'
# smbd_base samba-util tdb talloc param pdb
# seems don't need: krb5samba
# Some important options:
#
# --with-static-modules=STATIC_MODULES
# Comma-separated list of names of modules to statically link in
# --with-shared-modules=SHARED_MODULES
# Comma-separated list of names of modules to build shared
# --private-libraries=PRIVATE_LIBS
# comma separated list of normally public libraries to build instead as private libraries. May include !LIBNAME to disable making a library private. Can be 'NONE' or 'ALL' [auto]
# --builtin-libraries=BUILTIN_LIBRARIES
# command separated list of libraries to build directly into binaries [NONE]
# --nonshared-binary=NONSHARED_BINARIES
# Disable use of shared libs for the listed binaries
#
# Disable some libs
# --without-libtdb \ bld.SAMBA_LIBRARY('tdb',
# --without-libtalloc \
# --without-libnetapi \ bld.SAMBA3_LIBRARY('netapi',
# --without-libsmbclient \
# --without-libsmbsharemodes \
#
# speed up
# $(shell nproc)
define Build/Compile
(cd $(PKG_BUILD_DIR); \
./buildtools/bin/waf build \
--targets=$(PKG_NAME)_multicall \
-j$(shell nproc) \
)
endef
# Do NOT run 'make install' since we only need the multicall binary
define Build/Install
$(RSTRIP) $(PKG_BUILD_DIR)/bin/default/source3/$(PKG_NAME)_multicall
endef
# XXX: Make sure the name of multicall binary matches name in 111-multicall-wscript-build.patch
define Package/samba4x-server/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/samba4
$(INSTALL_DIR) $(1)/etc/samba
$(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/samba
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/samba4
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/default/source3/$(PKG_NAME)_multicall $(1)/usr/sbin
$(LN) $(PKG_NAME)_multicall $(1)/usr/sbin/smbd
$(LN) $(PKG_NAME)_multicall $(1)/usr/sbin/nmbd
$(LN) $(PKG_NAME)_multicall $(1)/usr/sbin/smbpasswd
$(LN) $(PKG_NAME)_multicall $(1)/usr/sbin/pdbedit
$(INSTALL_DIR) $(1)/usr/bin
$(LN) ../sbin/$(PKG_NAME)_multicall $(1)/usr/bin/smbcontrol
$(LN) ../sbin/$(PKG_NAME)_multicall $(1)/usr/bin/smbtree
$(LN) ../sbin/$(PKG_NAME)_multicall $(1)/usr/bin/smbstatus
$(LN) ../sbin/$(PKG_NAME)_multicall $(1)/usr/bin/smbcquotas
$(LN) ../sbin/$(PKG_NAME)_multicall $(1)/usr/bin/smbcacls
$(LN) ../sbin/$(PKG_NAME)_multicall $(1)/usr/bin/nmblookup
$(LN) ../sbin/$(PKG_NAME)_multicall $(1)/usr/bin/testparm
endef
define Package/samba4x-server/conffiles
/etc/config/samba4
/etc/samba/smb.conf.template
/etc/samba/smbpasswd
endef
$(eval $(call BuildPackage,$(PKG_NAME)-server))

View File

@ -1,26 +0,0 @@
#!/bin/sh
# /tree-lede/staging_dir/target-powerpc_464fp_musl-1.1.15/usr/bin/python2-config
BASEDIR=$(cd `dirname $0`;cd ..;pwd)
case "$1" in
--prefix)
echo $BASEDIR
;;
--exec-prefix)
echo $BASEDIR
;;
--includes)
echo -I$BASEDIR/include/python2.7 -I$BASEDIR/include/python2.7
;;
--libs)
echo -lpython2.7 -lpthread -ldl -lutil -lm
;;
--cflags)
echo -I$BASEDIR/include/python2.7 -I$BASEDIR/include/python2.7
;;
--ldflags)
echo -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic
;;
*)
echo 'Usage: python2-config [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--help]'
;;
esac

View File

@ -1,7 +0,0 @@
config samba
option 'enabled' '0'
option 'name' 'OpenWrt-SMB'
option 'workgroup' 'WORKGROUP'
option 'description' 'Samba on OpenWrt'
option 'charset' 'UTF-8'
option 'homes' '1'

View File

@ -1,162 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2012 OpenWrt.org
# Copyright (C) 2015 wongsyrone
START=60
USE_PROCD=1
smb_header() {
local interface
config_get interface $1 interface "loopback lan"
# resolve interfaces
. /lib/functions/network.sh
local interfaces=$(
local net
for net in $interface; do
local device
network_get_device device "$net" && {
local subnet
network_get_subnet subnet "$net" && echo -n "$subnet "
network_get_subnet6 subnet "$net" && echo -n "$subnet "
}
echo -n "${device:-$net} "
done
)
local name workgroup description charset domain
local hostname="$(uci_get system.@system[0].hostname)"
config_get enabled $1 enabled "0"
config_get name $1 name "${hostname:-OpenWrt}"
config_get workgroup $1 workgroup "${hostname:-WORKGROUP}"
config_get description $1 description "Samba on ${hostname:-OpenWrt}"
config_get charset $1 charset "UTF-8"
config_get DISABLENB $1 disablenb "0"
mkdir -p /var/etc
sed -e "s#|NAME|#$name#g" \
-e "s#|WORKGROUP|#$workgroup#g" \
-e "s#|DESCRIPTION|#$description#g" \
-e "s#|INTERFACES|#$interfaces#g" \
-e "s#|CHARSET|#$charset#g" \
/etc/samba/smb.conf.template > /var/etc/smb.conf
[ "$DISABLENB" == "1" ] && echo >>/var/etc/smb.conf -e "\tdisable netbios = yes"
[ -f /etc/krb5.keytab ] && {
KLIST=`klist -k /etc/krb5.keytab`
REALM=${KLIST##*@}
echo >>/var/etc/smb.conf -e "\tkerberos method = dedicated keytab"
echo >>/var/etc/smb.conf -e "\tdedicated keytab file = /etc/krb5.keytab"
echo >>/var/etc/smb.conf -e "\trealm = $REALM"
sed -i -e "s#workgroup = \(.*\)#workgroup = $REALM#g" /var/etc/smb.conf
workgroup=$REALM
}
[ -S /var/run/ldapi ] && {
echo >>/var/etc/smb.conf -e "\tldapsam:trusted = yes"
echo >>/var/etc/smb.conf -e "\tldapsam:editposix = yes"
echo >>/var/etc/smb.conf -e "\tldap ssl = off"
echo >>/var/etc/smb.conf -e "\tdomain logons = yes"
sed -i -e "s#passdb backend = \(.*\)#passdb backend = ldapsam:ldapi:///#g" \
/var/etc/smb.conf
}
local homes
config_get_bool homes $1 homes 0
[ $homes -gt 0 ] && {
cat <<EOT >> /var/etc/smb.conf
[homes]
comment = Home Directories
browseable = no
writable = yes
read only = no
create mask = 0750
EOT
}
[ -L /etc/samba/smb.conf ] || ln -nsf /var/etc/smb.conf /etc/samba/smb.conf
}
smb_add_share() {
local name
local path
local users
#local public
local writable
local printable
local create_mask
local guest_ok
config_get name $1 name
config_get path $1 path
config_get users $1 users
#config_get public $1 public
config_get writable $1 writable
config_get printable $1 printable
config_get create_mask $1 create_mask
config_get guest_ok $1 guest_ok
[ -z "$name" -o -z "$path" ] && return
echo -e "\n[$name]\n\tpath = $path" >> /var/etc/smb.conf
[ -n "$users" ] && echo -e "\tvalid users = $users" >> /var/etc/smb.conf
[ -n "$public" ] && echo -e "\tpublic = $public" >> /var/etc/smb.conf
[ -n "$writable" ] && echo -e "\twritable = $writable" >> /var/etc/smb.conf
[ -n "$printable" ] && echo -e "\tprintable = $printable" >> /var/etc/smb.conf
[ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /var/etc/smb.conf
[ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok\n\tpublic = $guest_ok" >> /var/etc/smb.conf
}
init_config() {
# Create samba dirs
[ -d /var/lib/samba ] || mkdir -p /var/lib/samba
[ -d /var/cache/samba ] || mkdir -p /var/cache/samba
[ -d /var/run/samba ] || mkdir -p /var/run/samba
[ -d /var/lock ] || mkdir -p /var/lock
chmod 0755 /var/lock
config_load samba4
config_foreach smb_header samba
config_foreach smb_add_share sambashare
}
reload_service() {
init_config
killall -HUP smbd
}
service_triggers() {
procd_add_reload_trigger samba4
}
start_service() {
init_config
if [ "1" = "$enabled" ] || [ "on" = "$enabled" ] || [ "true" = "$enabled" ]; then
procd_open_instance
procd_set_param command /usr/sbin/smbd -F
procd_set_param respawn
procd_close_instance
# lower priority using renice in busybox
renice -n 2 $(pidof smbd)
[ "$DISABLENB" != "1" ] && {
procd_open_instance
procd_set_param command /usr/sbin/nmbd -F
procd_set_param respawn
procd_close_instance
# lower priority using renice in busybox
renice -n 2 $(pidof nmbd)
}
else
echo "samba4 is disabled"
fi
}

View File

@ -1,42 +0,0 @@
[global]
netbios name = |NAME|
interfaces = |INTERFACES|
server string = |DESCRIPTION|
hosts allow = 192.168.1. 127.
unix charset = |CHARSET|
workgroup = |WORKGROUP|
passdb backend = smbpasswd
# passdb backend = tdbsam:/etc/samba/passdb.tdb
inherit owner = yes
create mask = 0777
directory mask = 0777
force create mode = 0777
force directory mode = 0777
security = user
smb encrypt = disabled
smb passwd file = /etc/samba/smbpasswd
lock directory = /var/lock
browseable = yes
domain master = yes
encrypt passwords = yes
enable core files = no
guest account = nobody
invalid users = root
local master = yes
load printers = no
map to guest = Bad User
os level = 20
preferred master = yes
printable = no
writeable = yes
strict allocate = yes
strict locking = no
socket options = TCP_NODELAY IPTOS_LOWDELAY
use sendfile = yes
max xmit = 65535
max connections = 8
deadtime = 30
dns proxy = no
aio read size = 0
aio write size = 0

View File

@ -1,25 +0,0 @@
Disable libbsd support, samba4 uses a global config.h for its own
codebase and that of heimdal (when building with builtin).
This causes redefinition conflicts for link(2) when both standard unistd.h
and bsd/unistd.h get included.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -256,15 +256,6 @@ def configure(conf):
conf.CHECK_FUNCS('prctl dirname basename')
- # libbsd on some platforms provides strlcpy and strlcat
- if not conf.CHECK_FUNCS('strlcpy strlcat'):
- conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
- checklibc=True)
- if not conf.CHECK_FUNCS('getpeereid'):
- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
-
conf.CHECK_CODE('''
struct ucred cred;
socklen_t cred_len;

View File

@ -1,11 +0,0 @@
--- a/python/pyglue.c
+++ b/python/pyglue.c
@@ -112,7 +112,7 @@ static PyObject *py_set_debug_level(PyOb
unsigned level;
if (!PyArg_ParseTuple(args, "I", &level))
return NULL;
- (DEBUGLEVEL) = level;
+// (DEBUGLEVEL) = level;
Py_RETURN_NONE;
}

View File

@ -1,22 +0,0 @@
waf trys to get package's configuration by native ncurses6-config.
it will make native header files and library be used.
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
--- a/source3/wscript_configure_system_ncurses
+++ b/source3/wscript_configure_system_ncurses
@@ -2,14 +2,6 @@ import Logs, Options, sys
Logs.info("Looking for ncurses features")
-conf.find_program('ncurses5-config', var='NCURSES_CONFIG')
-if not conf.env.NCURSES_CONFIG:
- conf.find_program('ncurses6-config', var='NCURSES_CONFIG')
-
-if conf.env.NCURSES_CONFIG:
- conf.CHECK_CFG(path=conf.env.NCURSES_CONFIG, args="--cflags --libs",
- package="", uselib_store="NCURSES")
-
conf.CHECK_HEADERS('ncurses.h menu.h panel.h form.h', lib='ncurses')
conf.CHECK_FUNCS_IN('initscr', 'ncurses')

View File

@ -1,91 +0,0 @@
From d78eafdbd5ae00f77ce11f80ad142eb3c109278b Mon Sep 17 00:00:00 2001
From: Lior Amsalem <alior@marvell.com>
Date: Mon, 2 Dec 2013 11:04:56 +0200
Subject: [PATCH 1/4] samba 4.0.9 splice support
Signed-off-by: Lior Amsalem <alior@marvell.com>
---
source3/lib/recvfile.c | 46 ++++++++++++++++++++--------------------------
1 file changed, 20 insertions(+), 26 deletions(-)
--- a/source3/lib/recvfile.c
+++ b/source3/lib/recvfile.c
@@ -43,6 +43,10 @@
#define TRANSFER_BUF_SIZE (128*1024)
#endif
+#define SPLICE_F_COPY 0
+#define MAX_ITERATIONS 4
+#define RECEIVE_BUF_SIZE 131072
+
static ssize_t default_sys_recvfile(int fromfd,
int tofd,
off_t offset,
@@ -158,10 +162,10 @@ ssize_t sys_recvfile(int fromfd,
off_t offset,
size_t count)
{
- static int pipefd[2] = { -1, -1 };
- static bool try_splice_call = false;
+ static bool try_splice_call = true;
size_t total_written = 0;
loff_t splice_offset = offset;
+ size_t current_count;
DEBUG(10,("sys_recvfile: from = %d, to = %d, "
"offset=%.0f, count = %lu\n",
@@ -186,20 +190,22 @@ ssize_t sys_recvfile(int fromfd,
count);
}
- if ((pipefd[0] == -1) && (pipe(pipefd) == -1)) {
- try_splice_call = false;
- return default_sys_recvfile(fromfd, tofd, offset, count);
- }
-
while (count > 0) {
- int nread, to_write;
+ int nread, try_again;
+
+ if (count > RECEIVE_BUF_SIZE){
+ current_count=RECEIVE_BUF_SIZE;
+ } else {
+ current_count=count;
+ }
+ try_again = MAX_ITERATIONS;
+ do {
+ nread = splice(fromfd, NULL, tofd, &offset, current_count, SPLICE_F_COPY);
+ if (nread == -1)
+ try_again--;
+ } while(nread ==-1 && try_again);
- nread = splice(fromfd, NULL, pipefd[1], NULL,
- MIN(count, 16384), SPLICE_F_MOVE);
if (nread == -1) {
- if (errno == EINTR) {
- continue;
- }
if (total_written == 0 &&
(errno == EBADF || errno == EINVAL)) {
try_splice_call = false;
@@ -221,19 +227,7 @@ ssize_t sys_recvfile(int fromfd,
}
break;
}
-
- to_write = nread;
- while (to_write > 0) {
- int thistime;
- thistime = splice(pipefd[0], NULL, tofd,
- &splice_offset, to_write,
- SPLICE_F_MOVE);
- if (thistime == -1) {
- goto done;
- }
- to_write -= thistime;
- }
-
+
total_written += nread;
count -= nread;
}

View File

@ -1,15 +0,0 @@
--- a/source3/wscript
+++ b/source3/wscript
@@ -68,6 +68,12 @@ def set_options(opt):
help=("Directory under which libcephfs is installed"),
action="store", dest='libcephfs_dir', default=None)
+ opt.add_option('--program-suffix',
+ help=("Directory under which libcephfs is installed"))
+
+ opt.add_option('--disable-nls',
+ help=("Directory under which libcephfs is installed"))
+
opt.SAMBA3_ADD_OPTION('glusterfs', with_name="enable", without_name="disable", default=True)
opt.add_option('--enable-vxfs',

View File

@ -1,26 +0,0 @@
From: Andrew Bartlett <abartlet@samba.org>
Date: Wed, 26 Oct 2016 00:06:12 +0000 (+1300)
Subject: build: Fix build with perl on debian sid.
X-Git-Url: http://git.catalyst.net.nz/gw?p=samba.git;a=commitdiff_plain;h=edb109f6
build: Fix build with perl on debian sid.
It appears that "." is no longer in perl_inc
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
---
diff --git a/buildtools/wafsamba/samba_perl.py b/buildtools/wafsamba/samba_perl.py
index f2f176d..2e9a53a 100644
--- a/buildtools/wafsamba/samba_perl.py
+++ b/buildtools/wafsamba/samba_perl.py
@@ -49,7 +49,8 @@ def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5,0,0)):
conf.env.PERL_LIB_INSTALL_DIR = perl_lib_install_dir
perl_inc = read_perl_config_var('print "@INC"')
- perl_inc.remove('.')
+ if '.' in perl_inc:
+ perl_inc.remove('.')
conf.start_msg("PERL_INC: ")
conf.end_msg("%s" % (perl_inc), 'GREEN')
conf.env.PERL_INC = perl_inc

View File

@ -1,77 +0,0 @@
--- /dev/null
+++ b/source3/multicall.c
@@ -0,0 +1,74 @@
+#include <stdio.h>
+#include <string.h>
+#include <syslog.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <limits.h>
+#include <stdlib.h>
+
+extern int smbd_main(int argc, char **argv);
+extern int nmbd_main(int argc, char **argv);
+extern int smbpasswd_main(int argc, char **argv);
+extern int smbcontrol_main(int argc, char **argv);
+extern int smbtree_main(int argc, char **argv);
+extern int smbstatus_main(int argc, char **argv);
+extern int smbcquotas_main(int argc, char **argv);
+extern int smbcacls_main(int argc, char **argv);
+extern int nmblookup_main(int argc, char **argv);
+extern int testparm_main(int argc, char **argv);
+extern int pdbedit_main(int argc, char **argv);
+
+static struct {
+ const char *name;
+ int (*func_main)(int argc, char **argv);
+} multicall[] = {
+ { "smbd", smbd_main },
+ { "nmbd", nmbd_main },
+ { "smbpasswd", smbpasswd_main },
+ { "smbcontrol", smbcontrol_main },
+ { "smbtree", smbtree_main },
+ { "smbstatus", smbstatus_main },
+ { "smbcquotas", smbcquotas_main },
+ { "smbcacls", smbcacls_main },
+ { "nmblookup", nmblookup_main },
+ { "testparm", testparm_main },
+ { "pdbedit", pdbedit_main },
+};
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+
+int main(int argc, char **argv)
+{
+ unsigned int i, len;
+ extern char *__progname;
+ char path[PATH_MAX], *self;
+
+ len = readlink("/proc/self/exe", path, sizeof(path));
+ path[len] = 0;
+ for (i=len-2; i>0 && path[i] != '/'; --i);
+ self = path + i + 1;
+
+ if (0 == strcmp(__progname, self)) {
+ if (argc == 1) goto usage;
+ argv++;
+ --argc;
+ __progname = argv[0];
+ }
+
+ for (i = 0; i < ARRAY_SIZE(multicall); i++) {
+ if (0 == strcmp(__progname, multicall[i].name)) {
+ return multicall[i].func_main(argc, argv);
+ }
+ }
+
+usage:
+ fprintf(stderr, "%s multicall binary\nAvailable commands:\n\n", self);
+ for (i = 0; i < ARRAY_SIZE(multicall); i++) {
+ fprintf(stderr, "%s", multicall[i].name);
+ if (i != 0 && i != ARRAY_SIZE(multicall)-1)
+ fprintf(stderr, ", ");
+ }
+ fprintf(stderr, "\n");
+
+ return 1;
+}

View File

@ -1,84 +0,0 @@
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -1196,7 +1196,7 @@ bld.SAMBA3_BINARY('testparm',
param
popt_samba3''')
-smbstatus_source = 'utils/status.c smbd/notify_msg.c'
+smbstatus_source = 'utils/status.c'
if bld.CONFIG_GET("WITH_PROFILE"):
smbstatus_source += ' utils/status_profile.c'
@@ -1512,6 +1512,72 @@ bld.SAMBA3_BINARY('spotlight2sparql',
enabled=bld.env.with_spotlight,
install=False)
+
+bld.SAMBA3_SUBSYSTEM('SMBD_MULTI',
+ source='smbd/server.c',
+ cflags='-Dmain=smbd_main')
+
+bld.SAMBA3_SUBSYSTEM('NMBD_MULTI',
+ source='nmbd/nmbd.c',
+ cflags='-Dmain=nmbd_main')
+
+bld.SAMBA3_SUBSYSTEM('SMBPASSWD_MULTI',
+ source='utils/smbpasswd.c',
+ cflags='-Dmain=smbpasswd_main')
+
+bld.SAMBA3_SUBSYSTEM('SMBCONTROL_MULTI',
+ source='utils/smbcontrol.c',
+ cflags='-Dmain=smbcontrol_main')
+
+bld.SAMBA3_SUBSYSTEM('SMBTREE_MULTI',
+ source='utils/smbtree.c',
+ cflags='-Dmain=smbtree_main')
+
+bld.SAMBA3_SUBSYSTEM('SMBSTATUS_MULTI',
+ source=smbstatus_source,
+ cflags='-Dmain=smbstatus_main')
+
+bld.SAMBA3_SUBSYSTEM('SMBCQUOTAS_MULTI',
+ source='utils/smbcquotas.c',
+ cflags='-Dmain=smbcquotas_main')
+
+bld.SAMBA3_SUBSYSTEM('SMBCACLS_MULTI',
+ source='utils/smbcacls.c lib/util_sd.c',
+ cflags='-Dmain=smbcacls_main')
+
+bld.SAMBA3_SUBSYSTEM('NMBLOOKUP_MULTI',
+ source='utils/nmblookup.c',
+ cflags='-Dmain=nmblookup_main')
+
+bld.SAMBA3_SUBSYSTEM('TESTPARM_MULTI',
+ source='utils/testparm.c',
+ cflags='-Dmain=testparm_main')
+
+bld.SAMBA3_SUBSYSTEM('PDBEDIT_MULTI',
+ source='utils/pdbedit.c',
+ cflags='-Dmain=pdbedit_main')
+
+bld.SAMBA3_BINARY('__OPENWRT_SAMBA_MULTICALL__',
+ source='''multicall.c smbd/smbd_cleanupd.c
+ nmbd/asyncdns.c nmbd/nmbd_become_dmb.c
+ nmbd/nmbd_become_lmb.c nmbd/nmbd_browserdb.c
+ nmbd/nmbd_browsesync.c nmbd/nmbd_elections.c
+ nmbd/nmbd_incomingdgrams.c nmbd/nmbd_incomingrequests.c
+ nmbd/nmbd_lmhosts.c nmbd/nmbd_logonnames.c nmbd/nmbd_mynames.c
+ nmbd/nmbd_namelistdb.c nmbd/nmbd_namequery.c
+ nmbd/nmbd_nameregister.c nmbd/nmbd_namerelease.c
+ nmbd/nmbd_nodestatus.c nmbd/nmbd_packets.c
+ nmbd/nmbd_processlogon.c nmbd/nmbd_responserecordsdb.c
+ nmbd/nmbd_sendannounce.c nmbd/nmbd_serverlistdb.c
+ nmbd/nmbd_subnetdb.c nmbd/nmbd_winsproxy.c nmbd/nmbd_winsserver.c
+ nmbd/nmbd_workgroupdb.c nmbd/nmbd_synclists.c''',
+ deps='''smbd_base SMBD_MULTI NMBD_MULTI SMBPASSWD_MULTI
+ SMBCONTROL_MULTI SMBTREE_MULTI SMBSTATUS_MULTI
+ SMBCQUOTAS_MULTI SMBCACLS_MULTI NMBLOOKUP_MULTI PDBEDIT_MULTI
+ PASSWD_UTIL PASSCHANGE TESTPARM_MULTI EPMD LSASD FSSD
+ param''',
+ install_path='${SBINDIR}')
+
########################## INCLUDES #################################
bld.RECURSE('auth')

View File

@ -1,26 +0,0 @@
#--- a/source3/librpc/rpc/rpc_common.c
#+++ b/source3/librpc/rpc/rpc_common.c
#@@ -120,9 +120,11 @@ static bool initialize_interfaces(void)
# if (!smb_register_ndr_interface(&ndr_table_netdfs)) {
# return false;
# }
#+#ifdef DEVELOPER
# if (!smb_register_ndr_interface(&ndr_table_rpcecho)) {
# return false;
# }
#+#endif
# if (!smb_register_ndr_interface(&ndr_table_initshutdown)) {
# return false;
# }
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -622,7 +622,9 @@ static struct cmd_set *rpcclient_command
netlogon_commands,
srvsvc_commands,
dfs_commands,
+#ifdef DEVELOPER
echo_commands,
+#endif
epmapper_commands,
shutdown_commands,
test_commands,

View File

@ -1,355 +0,0 @@
--- a/source3/rpc_server/rpc_service_setup.c
+++ b/source3/rpc_server/rpc_service_setup.c
@@ -553,10 +553,12 @@ bool dcesrv_ep_setup(struct tevent_conte
goto done;
}
+#ifdef PRINTER_SUPPORT
ok = rpc_setup_spoolss(ev_ctx, msg_ctx);
if (!ok) {
goto done;
}
+#endif
ok = rpc_setup_svcctl(ev_ctx, msg_ctx);
if (!ok) {
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -618,7 +618,9 @@ static struct cmd_set *rpcclient_command
lsarpc_commands,
ds_commands,
samr_commands,
+#ifdef PRINTER_SUPPORT
spoolss_commands,
+#endif
netlogon_commands,
srvsvc_commands,
dfs_commands,
--- a/source3/rpc_server/svcctl/srv_svcctl_nt.c
+++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c
@@ -86,9 +86,11 @@ bool init_service_op_table( void )
/* add builtin services */
+#ifdef PRINTER_SUPPORT
svcctl_ops[i].name = talloc_strdup( svcctl_ops, "Spooler" );
svcctl_ops[i].ops = &spoolss_svc_ops;
i++;
+#endif
svcctl_ops[i].name = talloc_strdup( svcctl_ops, "NETLOGON" );
svcctl_ops[i].ops = &netlogon_svc_ops;
--- a/source3/printing/spoolssd.c
+++ b/source3/printing/spoolssd.c
@@ -614,6 +614,10 @@ pid_t start_spoolssd(struct tevent_conte
int ret;
bool ok;
+#ifndef PRINTER_SUPPORT
+ return;
+#endif
+
DEBUG(1, ("Forking SPOOLSS Daemon\n"));
/*
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -7987,6 +7987,10 @@ static int rpc_printer_publish(struct ne
{NULL, NULL, 0, NULL, NULL}
};
+#ifndef PRINTER_SUPPORT
+ return 0;
+#endif
+
if (argc == 0) {
if (c->display_usage) {
d_printf(_("Usage:\n"));
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -5765,7 +5765,11 @@ void reply_printopen(struct smb_request
return;
}
- if (!CAN_PRINT(conn)) {
+
+#ifdef PRINTER_SUPPORT
+ if (!CAN_PRINT(conn))
+#endif
+ {
reply_nterror(req, NT_STATUS_ACCESS_DENIED);
END_PROFILE(SMBsplopen);
return;
@@ -5871,7 +5875,10 @@ void reply_printqueue(struct smb_request
is really quite gross and only worked when there was only
one printer - I think we should now only accept it if they
get it right (tridge) */
- if (!CAN_PRINT(conn)) {
+#ifdef PRINTER_SUPPORT
+ if (!CAN_PRINT(conn))
+#endif
+ {
reply_nterror(req, NT_STATUS_ACCESS_DENIED);
END_PROFILE(SMBsplretq);
return;
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -784,6 +784,10 @@ static bool api_DosPrintQGetInfo(struct
union spoolss_JobInfo *job_info = NULL;
union spoolss_PrinterInfo printer_info;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
@@ -999,6 +1003,10 @@ static bool api_DosPrintQEnum(struct smb
union spoolss_DriverInfo *driver_info;
union spoolss_JobInfo **job_info;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!param_format || !output_format1 || !p) {
return False;
}
@@ -3114,6 +3122,10 @@ static bool api_RDosPrintJobDel(struct s
struct spoolss_DevmodeContainer devmode_ctr;
enum spoolss_JobControl command;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
@@ -3247,6 +3259,10 @@ static bool api_WPrintQueueCtrl(struct s
struct sec_desc_buf secdesc_ctr;
enum spoolss_PrinterControl command;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !QueueName) {
return False;
}
@@ -3413,6 +3429,10 @@ static bool api_PrintJobInfo(struct smbd
union spoolss_JobInfo info;
struct spoolss_SetJobInfo1 info1;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
@@ -4567,6 +4587,10 @@ static bool api_WPrintJobGetInfo(struct
struct spoolss_DevmodeContainer devmode_ctr;
union spoolss_JobInfo info;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
@@ -4705,6 +4729,10 @@ static bool api_WPrintJobEnumerate(struc
uint32_t count = 0;
union spoolss_JobInfo *info;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
@@ -4910,6 +4938,10 @@ static bool api_WPrintDestGetInfo(struct
struct spoolss_DevmodeContainer devmode_ctr;
union spoolss_PrinterInfo info;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
@@ -5046,6 +5078,10 @@ static bool api_WPrintDestEnum(struct sm
union spoolss_PrinterInfo *info;
uint32_t count;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
@@ -5149,6 +5185,10 @@ static bool api_WPrintDriverEnum(struct
int succnt;
struct pack_desc desc;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
@@ -5213,6 +5253,10 @@ static bool api_WPrintQProcEnum(struct s
int succnt;
struct pack_desc desc;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
@@ -5277,6 +5321,10 @@ static bool api_WPrintPortEnum(struct sm
int succnt;
struct pack_desc desc;
+#ifndef PRINTER_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
--- a/source3/smbd/server_exit.c
+++ b/source3/smbd/server_exit.c
@@ -198,7 +198,9 @@ static void exit_server_common(enum serv
rpc_eventlog_shutdown();
rpc_ntsvcs_shutdown();
rpc_svcctl_shutdown();
+#ifdef PRINTER_SUPPORT
rpc_spoolss_shutdown();
+#endif
rpc_srvsvc_shutdown();
rpc_winreg_shutdown();
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2430,6 +2430,9 @@ static NTSTATUS open_file_ntcreate(conne
* Most of the passed parameters are ignored.
*/
+#ifndef PRINTER_SUPPORT
+ return NT_STATUS_ACCESS_DENIED;
+#endif
if (pinfo) {
*pinfo = FILE_WAS_CREATED;
}
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -727,6 +727,9 @@ static NTSTATUS close_normal_file(struct
}
if (fsp->print_file) {
+#ifndef PRINTER_SUPPORT
+ return NT_STATUS_OK;
+#endif
/* FIXME: return spool errors */
print_spool_end(fsp, close_type);
file_free(req, fsp);
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -318,6 +318,10 @@ ssize_t write_file(struct smb_request *r
uint32_t t;
int ret;
+#ifndef PRINTER_SUPPORT
+ return -1;
+#endif
+
ret = print_spool_write(fsp, data, n, pos, &t);
if (ret) {
errno = ret;
--- a/source3/smbd/smb2_create.c
+++ b/source3/smbd/smb2_create.c
@@ -633,7 +633,10 @@ static struct tevent_req *smbd_smb2_crea
}
status = file_new(smb1req, smb1req->conn, &result);
- if(!NT_STATUS_IS_OK(status)) {
+#ifdef PRINTER_SUPPORT
+ if(!NT_STATUS_IS_OK(status))
+#endif
+ {
tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -2895,8 +2895,10 @@ static bool housekeeping_fn(const struct
change_to_root_user();
+#ifdef PRINTER_SUPPORT
/* update printer queue caches if necessary */
update_monitored_printq_cache(sconn->msg_ctx);
+#endif
/* check if we need to reload services */
check_reload(sconn, time_mono(NULL));
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1679,6 +1679,7 @@ extern void build_options(bool screen);
start_fssd(ev_ctx, msg_ctx);
}
+#ifdef PRINTER_SUPPORT
if (!lp__disable_spoolss() &&
(rpc_spoolss_daemon() != RPC_DAEMON_DISABLED)) {
bool bgq = lp_parm_bool(-1, "smbd", "backgroundqueue", true);
@@ -1699,6 +1700,7 @@ extern void build_options(bool screen);
if (!printing_subsystem_init(ev_ctx, msg_ctx, false, false)) {
exit(1);
}
+#endif
}
if (!is_daemon) {
@@ -1731,12 +1733,14 @@ extern void build_options(bool screen);
if (!open_sockets_smbd(parent, ev_ctx, msg_ctx, ports))
exit_server("open_sockets_smbd() failed");
+#ifdef PRINTER_SUPPORT
/* do a printer update now that all messaging has been set up,
* before we allow clients to start connecting */
if (!lp__disable_spoolss() &&
(rpc_spoolss_daemon() != RPC_DAEMON_DISABLED)) {
printing_subsystem_update(ev_ctx, msg_ctx, false);
}
+#endif
TALLOC_FREE(frame);
/* make sure we always have a valid stackframe */
--- a/source3/printing/pcap.c
+++ b/source3/printing/pcap.c
@@ -132,6 +132,7 @@ void pcap_cache_reload(struct tevent_con
void (*post_cache_fill_fn)(struct tevent_context *,
struct messaging_context *))
{
+#ifdef PRINTER_SUPPORT
const char *pcap_name = lp_printcapname();
bool pcap_reloaded = False;
bool post_cache_fill_fn_handled = false;
@@ -204,6 +205,7 @@ done:
pcap_cache_destroy_specific(&pcache);
return;
+#endif
}

View File

@ -1,46 +0,0 @@
--- a/source3/rpc_server/rpc_service_setup.c
+++ b/source3/rpc_server/rpc_service_setup.c
@@ -560,6 +560,7 @@ bool dcesrv_ep_setup(struct tevent_conte
}
#endif
+#ifdef EXTRA_SERVICES
ok = rpc_setup_svcctl(ev_ctx, msg_ctx);
if (!ok) {
goto done;
@@ -574,6 +575,7 @@ bool dcesrv_ep_setup(struct tevent_conte
if (!ok) {
goto done;
}
+#endif
ok = rpc_setup_initshutdown(ev_ctx, msg_ctx);
if (!ok) {
--- a/source3/smbd/server_exit.c
+++ b/source3/smbd/server_exit.c
@@ -195,9 +195,11 @@ static void exit_server_common(enum serv
#endif
rpc_netdfs_shutdown();
rpc_initshutdown_shutdown();
+#ifdef EXTRA_SERVICES
rpc_eventlog_shutdown();
rpc_ntsvcs_shutdown();
rpc_svcctl_shutdown();
+#endif
#ifdef PRINTER_SUPPORT
rpc_spoolss_shutdown();
#endif
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -631,9 +631,11 @@ static struct cmd_set *rpcclient_command
shutdown_commands,
test_commands,
wkssvc_commands,
+#ifdef EXTRA_SERVICES
ntsvcs_commands,
drsuapi_commands,
eventlog_commands,
+#endif
winreg_commands,
fss_commands,
witness_commands,

View File

@ -1,101 +0,0 @@
--- a/source3/rpc_server/rpc_service_setup.c
+++ b/source3/rpc_server/rpc_service_setup.c
@@ -396,10 +396,12 @@ static bool eventlog_init_cb(void *ptr)
talloc_get_type_abort(ptr, struct messaging_context);
bool ok;
+#ifdef WINREG_SUPPORT
ok = eventlog_init_winreg(msg_ctx);
if (!ok) {
return false;
}
+#endif
return true;
}
@@ -506,10 +508,12 @@ bool dcesrv_ep_setup(struct tevent_conte
return false;
}
+#ifdef WINREG_SUPPORT
ok = rpc_setup_winreg(ev_ctx, msg_ctx);
if (!ok) {
goto done;
}
+#endif
ok = rpc_setup_srvsvc(ev_ctx, msg_ctx);
if (!ok) {
--- a/source3/smbd/server_exit.c
+++ b/source3/smbd/server_exit.c
@@ -205,7 +205,9 @@ static void exit_server_common(enum serv
#endif
rpc_srvsvc_shutdown();
+#ifdef WINREG_SUPPORT
rpc_winreg_shutdown();
+#endif
rpc_netlogon_shutdown();
rpc_samr_shutdown();
--- a/source3/rpc_server/svcctl/srv_svcctl_nt.c
+++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c
@@ -96,9 +96,11 @@ bool init_service_op_table( void )
svcctl_ops[i].ops = &netlogon_svc_ops;
i++;
+#ifdef WINREG_SUPPORT
svcctl_ops[i].name = talloc_strdup( svcctl_ops, "RemoteRegistry" );
svcctl_ops[i].ops = &winreg_svc_ops;
i++;
+#endif
svcctl_ops[i].name = talloc_strdup( svcctl_ops, "WINS" );
svcctl_ops[i].ops = &wins_svc_ops;
--- a/source3/services/svc_winreg_glue.c
+++ b/source3/services/svc_winreg_glue.c
@@ -88,6 +88,10 @@ struct security_descriptor *svcctl_get_s
NTSTATUS status;
WERROR result = WERR_OK;
+#ifndef WINREG_SUPPORT
+ return NULL;
+#endif
+
key = talloc_asprintf(mem_ctx,
"%s\\%s\\Security",
TOP_LEVEL_SERVICES_KEY, name);
@@ -161,6 +165,10 @@ bool svcctl_set_secdesc(struct messaging
NTSTATUS status;
WERROR result = WERR_OK;
+#ifndef WINREG_SUPPORT
+ return false;
+#endif
+
tmp_ctx = talloc_stackframe();
if (tmp_ctx == NULL) {
return false;
@@ -272,6 +280,10 @@ const char *svcctl_get_string_value(TALL
NTSTATUS status;
WERROR result = WERR_OK;
+#ifndef WINREG_SUPPORT
+ return NULL;
+#endif
+
tmp_ctx = talloc_stackframe();
if (tmp_ctx == NULL) {
return NULL;
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -636,7 +636,9 @@ static struct cmd_set *rpcclient_command
drsuapi_commands,
eventlog_commands,
#endif
+#ifdef WINREG_SUPPORT
winreg_commands,
+#endif
fss_commands,
witness_commands,
clusapi_commands,

View File

@ -1,43 +0,0 @@
--- a/source3/lib/smbconf/smbconf_init.c
+++ b/source3/lib/smbconf/smbconf_init.c
@@ -68,9 +68,12 @@ sbcErr smbconf_init(TALLOC_CTX *mem_ctx,
}
}
+#ifdef REGISTRY_BACKEND
if (strequal(backend, "registry") || strequal(backend, "reg")) {
err = smbconf_init_reg(mem_ctx, conf_ctx, path);
- } else if (strequal(backend, "file") || strequal(backend, "txt")) {
+ } else
+#endif
+ if (strequal(backend, "file") || strequal(backend, "txt")) {
err = smbconf_init_txt(mem_ctx, conf_ctx, path);
} else if (sep == NULL) {
/*
--- a/source3/lib/netapi/serverinfo.c
+++ b/source3/lib/netapi/serverinfo.c
@@ -557,7 +557,10 @@ static WERROR NetServerSetInfo_l_1005(st
return WERR_INVALID_PARAM;
}
- if (!lp_config_backend_is_registry()) {
+#ifdef REGISTRY_BACKEND
+ if (!lp_config_backend_is_registry())
+#endif
+ {
libnetapi_set_error_string(ctx,
"Configuration manipulation requested but not "
"supported by backend");
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1599,8 +1599,10 @@ extern void build_options(bool screen);
exit_daemon("Samba cannot init server id", EACCES);
}
+#ifdef REGISTRY_BACKEND
if (!W_ERROR_IS_OK(registry_init_full()))
exit_daemon("Samba cannot init registry", EACCES);
+#endif
/* Open the share_info.tdb here, so we don't have to open
after the fork on every single connection. This is a small

View File

@ -1,146 +0,0 @@
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -2206,6 +2206,10 @@ static bool api_RNetShareAdd(struct smbd
struct srvsvc_NetShareInfo2 info2;
struct dcerpc_binding_handle *b;
+#ifndef SRVSVC_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
@@ -3582,10 +3586,7 @@ static bool api_RNetServerGetInfo(struct
NTSTATUS status;
WERROR werr;
TALLOC_CTX *mem_ctx = talloc_tos();
- struct rpc_pipe_client *cli = NULL;
- union srvsvc_NetSrvInfo info;
int errcode;
- struct dcerpc_binding_handle *b;
if (!str1 || !str2 || !p) {
return False;
@@ -3648,42 +3649,9 @@ static bool api_RNetServerGetInfo(struct
p = *rdata;
p2 = p + struct_len;
- status = rpc_pipe_open_interface(mem_ctx, &ndr_table_srvsvc,
- conn->session_info,
- conn->sconn->remote_address,
- conn->sconn->msg_ctx,
- &cli);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0,("api_RNetServerGetInfo: could not connect to srvsvc: %s\n",
- nt_errstr(status)));
- errcode = W_ERROR_V(ntstatus_to_werror(status));
- goto out;
- }
-
- b = cli->binding_handle;
-
- status = dcerpc_srvsvc_NetSrvGetInfo(b, mem_ctx,
- NULL,
- 101,
- &info,
- &werr);
- if (!NT_STATUS_IS_OK(status)) {
- errcode = W_ERROR_V(ntstatus_to_werror(status));
- goto out;
- }
- if (!W_ERROR_IS_OK(werr)) {
- errcode = W_ERROR_V(werr);
- goto out;
- }
-
- if (info.info101 == NULL) {
- errcode = W_ERROR_V(WERR_INVALID_PARAM);
- goto out;
- }
-
if (uLevel != 20) {
size_t len = 0;
- status = srvstr_push(NULL, 0, p, info.info101->server_name, 16,
+ status = srvstr_push(NULL, 0, p, lp_netbios_name(), 16,
STR_ASCII|STR_UPPER|STR_TERMINATE, &len);
if (!NT_STATUS_IS_OK(status)) {
errcode = W_ERROR_V(ntstatus_to_werror(status));
@@ -3692,27 +3660,10 @@ static bool api_RNetServerGetInfo(struct
}
p += 16;
if (uLevel > 0) {
- SCVAL(p,0,info.info101->version_major);
- SCVAL(p,1,info.info101->version_minor);
- SIVAL(p,2,info.info101->server_type);
-
- if (mdrcnt == struct_len) {
- SIVAL(p,6,0);
- } else {
- SIVAL(p,6,PTR_DIFF(p2,*rdata));
- if (mdrcnt - struct_len <= 0) {
- return false;
- }
- push_ascii(p2,
- info.info101->comment,
- MIN(mdrcnt - struct_len,
- MAX_SERVER_STRING_LENGTH),
- STR_TERMINATE);
- p2 = skip_string(*rdata,*rdata_len,p2);
- if (!p2) {
- return False;
- }
- }
+ SCVAL(p,0,SAMBA_MAJOR_NBT_ANNOUNCE_VERSION);
+ SCVAL(p,1,SAMBA_MINOR_NBT_ANNOUNCE_VERSION);
+ SIVAL(p,2,lp_default_server_announce());
+ SIVAL(p,6,0);
}
if (uLevel > 1) {
@@ -5405,6 +5356,10 @@ static bool api_RNetSessionEnum(struct s
uint32_t totalentries, resume_handle = 0;
uint32_t count = 0;
+#ifndef SRVSVC_SUPPORT
+ return False;
+#endif
+
if (!str1 || !str2 || !p) {
return False;
}
--- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
@@ -1724,6 +1724,10 @@ WERROR _srvsvc_NetShareSetInfo(struct pi
TALLOC_CTX *ctx = p->mem_ctx;
union srvsvc_NetShareInfo *info = r->in.info;
+#ifndef FULL_SRVSVC
+ return WERR_ACCESS_DENIED;
+#endif
+
DEBUG(5,("_srvsvc_NetShareSetInfo: %d\n", __LINE__));
if (!r->in.share_name) {
@@ -1968,6 +1972,10 @@ WERROR _srvsvc_NetShareAdd(struct pipes_
SMB_STRUCT_STAT st;
TALLOC_CTX *ctx = p->mem_ctx;
+#ifndef FULL_SRVSVC
+ return WERR_ACCESS_DENIED;
+#endif
+
DEBUG(5,("_srvsvc_NetShareAdd: %d\n", __LINE__));
if (r->out.parm_error) {
@@ -2159,6 +2167,10 @@ WERROR _srvsvc_NetShareDel(struct pipes_
bool is_disk_op;
TALLOC_CTX *ctx = p->mem_ctx;
+#ifndef FULL_SRVSVC
+ return WERR_ACCESS_DENIED;
+#endif
+
DEBUG(5,("_srvsvc_NetShareDel: %d\n", __LINE__));
if (!r->in.share_name) {

View File

@ -1,11 +0,0 @@
--- a/lib/util/fault.h
+++ b/lib/util/fault.h
@@ -34,7 +34,7 @@
#define SMB_ASSERT(b) \
do { \
if (!(b)) { \
- DEBUG(0,("PANIC: assert failed at %s(%d): %s\n", \
+ DEBUG(3,("PANIC: assert failed at %s(%d): %s\n", \
__FILE__, __LINE__, #b)); \
smb_panic("assert failed: " #b); \
} \

View File

@ -1,22 +0,0 @@
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -51,7 +51,7 @@ bool dbghdr( int level, const char *loca
* Redefine DEBUGLEVEL because so we don't have to change every source file
* that *unnecessarily* references it.
*/
-#define DEBUGLEVEL DEBUGLEVEL_CLASS[DBGC_ALL]
+#define DEBUGLEVEL 0
/*
* Define all new debug classes here. A class is represented by an entry in
--- a/source3/nmbd/asyncdns.c
+++ b/source3/nmbd/asyncdns.c
@@ -86,7 +86,7 @@ static void asyncdns_process(void)
struct query_record r;
unstring qname;
- DEBUGLEVEL = -1;
+ DEBUGLEVEL_CLASS[DBGC_ALL] = -1;
while (1) {
NTSTATUS status;

View File

@ -1,20 +0,0 @@
--- a/source3/auth/auth.c
+++ b/source3/auth/auth.c
@@ -476,7 +476,7 @@ NTSTATUS make_auth_context_subsystem(TAL
case ROLE_DOMAIN_MEMBER:
DEBUG(5,("Making default auth method list for server role = 'domain member'\n"));
auth_method_list = str_list_make_v3(
- talloc_tos(), "guest sam winbind:ntdomain",
+ talloc_tos(), "guest sam",
NULL);
break;
case ROLE_DOMAIN_BDC:
@@ -484,7 +484,7 @@ NTSTATUS make_auth_context_subsystem(TAL
DEBUG(5,("Making default auth method list for DC\n"));
auth_method_list = str_list_make_v3(
talloc_tos(),
- "guest sam winbind:trustdomain",
+ "guest sam",
NULL);
break;
case ROLE_STANDALONE:

View File

@ -1,76 +0,0 @@
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -876,7 +876,15 @@ static int rebindproc_connect_with_state
Could we get a referral to a machine that we don't want to give our
username and password to? */
- rc = ldap_simple_bind_s(ldap_struct, ldap_state->bind_dn, ldap_state->bind_secret);
+ if (ldap_state->bind_secret)
+ rc = ldap_simple_bind_s(ldap_struct, ldap_state->bind_dn, ldap_state->bind_secret);
+ else {
+ struct berval *servercredp=NULL;
+
+ rc = ldap_sasl_bind_s(ldap_struct, NULL, "EXTERNAL", NULL, NULL, NULL, &servercredp);
+ if (rc == LDAP_SASL_BIND_IN_PROGRESS)
+ rc = ldap_sasl_bind_s(ldap_struct, NULL, "EXTERNAL", servercredp, NULL, NULL, &servercredp);
+ }
/* only set the last rebind timestamp when we did rebind after a
* non-read LDAP operation. That way we avoid the replication sleep
@@ -983,7 +991,15 @@ static int smbldap_connect_system(struct
rc = ldap_state->bind_callback(ldap_struct, ldap_state, ldap_state->bind_callback_data);
unbecome_root();
} else {
- rc = ldap_simple_bind_s(ldap_struct, ldap_state->bind_dn, ldap_state->bind_secret);
+ if (ldap_state->bind_secret)
+ rc = ldap_simple_bind_s(ldap_struct, ldap_state->bind_dn, ldap_state->bind_secret);
+ else {
+ struct berval *servercredp=NULL;
+
+ rc = ldap_sasl_bind_s(ldap_struct, NULL, "EXTERNAL", NULL, NULL, NULL, &servercredp);
+ if (rc == LDAP_SASL_BIND_IN_PROGRESS)
+ rc = ldap_sasl_bind_s(ldap_struct, NULL, "EXTERNAL", servercredp, NULL, NULL, &servercredp);
+ }
}
if (rc != LDAP_SUCCESS) {
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -6430,16 +6430,21 @@ static NTSTATUS pdb_init_ldapsam_common(
}
if (!fetch_ldap_pw(&bind_dn, &bind_secret)) {
- DEBUG(0, ("pdb_init_ldapsam_common: Failed to retrieve LDAP password from secrets.tdb\n"));
- return NT_STATUS_NO_MEMORY;
+ DEBUG(1, ("pdb_init_ldapsam_common: Failed to retrieve password from secrets.tdb. Switching to SASL\n"));
}
nt_status = smbldap_init(*pdb_method, pdb_get_tevent_context(),
location, false, bind_dn, bind_secret,
&ldap_state->smbldap_state);
- memset(bind_secret, '\0', strlen(bind_secret));
- SAFE_FREE(bind_secret);
- SAFE_FREE(bind_dn);
+
+ if (bind_secret) {
+ memset(bind_secret, '\0', strlen(bind_secret));
+ SAFE_FREE(bind_secret);
+ }
+
+ if (bind_dn)
+ SAFE_FREE(bind_dn);
+
if ( !NT_STATUS_IS_OK(nt_status) ) {
return nt_status;
}
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -333,7 +333,7 @@ bool fetch_ldap_pw(char **dn, char** pw)
data=(char *)secrets_fetch(old_style_key, &size);
if ((data == NULL) || (size < sizeof(old_style_pw))) {
- DEBUG(0,("fetch_ldap_pw: neither ldap secret retrieved!\n"));
+ DEBUG(1,("fetch_ldap_pw: neither ldap secret retrieved!\n"));
SAFE_FREE(old_style_key);
SAFE_FREE(*dn);
SAFE_FREE(data);

View File

@ -1,77 +0,0 @@
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4487,3 +4487,17 @@ unsigned int * get_flags(void)
return flags_list;
}
+
+bool lp_ldap_suffix_initial()
+{
+ if (Globals.ldap_suffix == NULL)
+ return true;
+ if (strlen(Globals.ldap_suffix) == 0)
+ return true;
+ return false;
+}
+
+void lp_set_ldap_suffix(const char *suffix)
+{
+ lpcfg_string_set(Globals.ctx, &Globals.ldap_suffix, suffix);
+}
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1028,6 +1028,8 @@ char* lp_perfcount_module(TALLOC_CTX *ct
void widelinks_warning(int snum);
const char *lp_ncalrpc_dir(void);
void _lp_set_server_role(int server_role);
+bool lp_ldap_suffix_initial();
+void lp_set_ldap_suffix(const char *suffix);
/* The following definitions come from param/loadparm_ctx.c */
--- a/source3/passdb/pdb_ldap_util.c
+++ b/source3/passdb/pdb_ldap_util.c
@@ -247,6 +247,34 @@ static NTSTATUS add_new_domain_info(stru
}
/**********************************************************************
+ Autodetermine LDAP suffix
+ **********************************************************************/
+void find_ldap_suffix(struct smbldap_state *ldap_state)
+{
+ const char *namingCtx[] = { "namingContexts", NULL };
+ LDAPMessage *entry = NULL, *result = NULL;
+ int rc;
+
+ if (!lp_ldap_suffix_initial())
+ return;
+
+ rc = smbldap_search(ldap_state, "", LDAP_SCOPE_BASE, "(objectClass=*)", namingCtx, 0, &result);
+ if (rc != LDAP_SUCCESS)
+ return;
+
+ entry = ldap_first_entry(ldap_state->ldap_struct, result);
+ if (entry) {
+ char **values = NULL;
+ values = ldap_get_values(ldap_state->ldap_struct, entry, namingCtx[0]);
+ if (values) {
+ lp_set_ldap_suffix(values[0]);
+ ldap_value_free(values);
+ }
+ }
+ ldap_msgfree(result);
+}
+
+/**********************************************************************
Search for the domain info entry
*********************************************************************/
@@ -261,6 +289,8 @@ NTSTATUS smbldap_search_domain_info(stru
int count;
char *escape_domain_name;
+ find_ldap_suffix(ldap_state);
+
escape_domain_name = escape_ldap_string(talloc_tos(), domain_name);
if (!escape_domain_name) {
DEBUG(0, ("Out of memory!\n"));

View File

@ -1,60 +0,0 @@
--- a/source4/torture/local/nss_tests.c
+++ b/source4/torture/local/nss_tests.c
@@ -346,28 +346,6 @@ static bool test_enum_r_passwd(struct to
torture_comment(tctx, "Testing setpwent\n");
setpwent();
- while (1) {
- torture_comment(tctx, "Testing getpwent_r\n");
-
-#ifdef SOLARIS_GETPWENT_R
- ret = getpwent_r(&pwd, buffer, sizeof(buffer));
-#else /* SOLARIS_GETPWENT_R */
- ret = getpwent_r(&pwd, buffer, sizeof(buffer), &pwdp);
-#endif /* SOLARIS_GETPWENT_R */
- if (ret != 0) {
- if (ret != ENOENT) {
- torture_comment(tctx, "got %d return code\n", ret);
- }
- break;
- }
- print_passwd(&pwd);
- if (pwd_array_p && num_pwd_p) {
- pwd_array = talloc_realloc(tctx, pwd_array, struct passwd, num_pwd+1);
- torture_assert(tctx, pwd_array, "out of memory");
- copy_passwd(tctx, &pwd, &pwd_array[num_pwd]);
- num_pwd++;
- }
- }
torture_comment(tctx, "Testing endpwent\n");
endpwent();
@@ -544,28 +522,6 @@ static bool test_enum_r_group(struct tor
torture_comment(tctx, "Testing setgrent\n");
setgrent();
- while (1) {
- torture_comment(tctx, "Testing getgrent_r\n");
-
-#ifdef SOLARIS_GETGRENT_R
- ret = getgrent_r(&grp, buffer, sizeof(buffer));
-#else /* SOLARIS_GETGRENT_R */
- ret = getgrent_r(&grp, buffer, sizeof(buffer), &grpp);
-#endif /* SOLARIS_GETGRENT_R */
- if (ret != 0) {
- if (ret != ENOENT) {
- torture_comment(tctx, "got %d return code\n", ret);
- }
- break;
- }
- print_group(&grp);
- if (grp_array_p && num_grp_p) {
- grp_array = talloc_realloc(tctx, grp_array, struct group, num_grp+1);
- torture_assert(tctx, grp_array, "out of memory");
- copy_group(tctx, &grp, &grp_array[num_grp]);
- num_grp++;
- }
- }
torture_comment(tctx, "Testing endgrent\n");
endgrent();

View File

@ -1,15 +0,0 @@
--- a/nsswitch/wins.c
+++ b/nsswitch/wins.c
@@ -39,5 +39,12 @@ static pthread_mutex_t wins_nss_mutex =
#define INADDRSZ 4
#endif
+#if !defined(NETDB_INTERNAL)
+# define NETDB_INTERNAL -1 /* See errno. */
+#endif
+#if !defined(NETDB_SUCCESS)
+# define NETDB_SUCCESS 0 /* No problem. */
+#endif
+
NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname, struct hostent *he,
char *buffer, size_t buflen, int *h_errnop);

View File

@ -1,46 +0,0 @@
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -221,7 +221,7 @@ struct messaging_context *messaging_init
return NULL;
}
- priv_path = private_path("msg.sock");
+ priv_path = lock_path("msg.sock");
if (priv_path == NULL) {
TALLOC_FREE(ctx);
return NULL;
@@ -393,6 +393,7 @@ struct server_id messaging_server_id(const struct messaging_context *msg_ctx)
NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
{
int ret;
+ char *lck_path;
TALLOC_FREE(msg_ctx->msg_dgm_ref);
@@ -400,9 +401,14 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
.pid = getpid(), .vnn = msg_ctx->id.vnn
};
+ lck_path = lock_path("msg.lock");
+ if (lck_path == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
msg_ctx->msg_dgm_ref = messaging_dgm_ref(
msg_ctx, msg_ctx->event_ctx, &msg_ctx->id.unique_id,
- private_path("msg.sock"), lock_path("msg.lock"),
+ lock_path("msg.sock"), lck_path,
messaging_recv_cb, msg_ctx, &ret);
if (msg_ctx->msg_dgm_ref == NULL) {
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -323,7 +323,7 @@ struct imessaging_context *imessaging_in
goto fail;
}
- msg->sock_dir = lpcfg_private_path(msg, lp_ctx, "msg.sock");
+ msg->sock_dir = lpcfg_lock_path(msg, lp_ctx, "msg.sock");
if (msg->sock_dir == NULL) {
goto fail;
}