remove samba3, all of its features should now be supported by samba36+cifs-utils
git-svn-id: svn://svn.openwrt.org/openwrt/packages@31585 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
68e7137e3f
commit
afa7bc906a
@ -1,24 +0,0 @@
|
||||
config SAMBA3_CONFIG_DEBUG
|
||||
bool "Enable Logging for samba3"
|
||||
depends PACKAGE_samba3
|
||||
default n
|
||||
help
|
||||
Enables debugging support (will make binaries *much* bigger)
|
||||
Also increases MAX_DEBUG_LEVEL to get more messages (also increases binary sizes!)
|
||||
|
||||
config SAMBA3_CONFIG_PRINTING
|
||||
bool "Enable shared printing support"
|
||||
depends PACKAGE_samba3
|
||||
select PACKAGE_cups
|
||||
default n
|
||||
help
|
||||
Enable shared printing support.
|
||||
Adds about 18kB for smbd, about 15kB for nmbd and about 18kB for smbpasswd
|
||||
|
||||
config SAMBA3_CONFIG_SMALLER
|
||||
bool "Make samba3 even smaller"
|
||||
depends PACKAGE_samba3
|
||||
default y
|
||||
help
|
||||
Removes support for ???
|
||||
Saves about 18kB for smbd, about 16kB for nmbd and about 17kB for smbpasswd
|
@ -1,141 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2008-2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=samba3
|
||||
PKG_VERSION:=3.0.37
|
||||
PKG_RELEASE:=5
|
||||
|
||||
PKG_MD5SUM:=11ed2bfef4090bd5736b194b43f67289
|
||||
|
||||
PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/samba/old-versions/
|
||||
PKG_SOURCE:=samba-$(PKG_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/samba-$(PKG_VERSION)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/samba3/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Filesystem
|
||||
URL:=http://www.samba.org/
|
||||
endef
|
||||
|
||||
define Package/samba3
|
||||
$(call Package/samba3/Default)
|
||||
TITLE:=SMB server for file and printer sharing
|
||||
DEPENDS:=+libpthread +libpopt $(ICONV_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/samba3-nmbd
|
||||
$(call Package/samba3/Default)
|
||||
TITLE:=NetBIOS name server
|
||||
DEPENDS:=samba3
|
||||
endef
|
||||
|
||||
define Package/samba3-mountcifs
|
||||
$(call Package/samba3/Default)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Mount utility for samba shares
|
||||
endef
|
||||
|
||||
define Package/samba3/description
|
||||
SMB server for file and printer sharing
|
||||
Also contains a SMB password utility (smbpasswd)
|
||||
|
||||
Made small with patches taken from AVM GPL releases and freetz
|
||||
endef
|
||||
|
||||
define Package/samba3-nmbd/description
|
||||
NetBIOS name server
|
||||
|
||||
Made small with patches taken from AVM GPL releases and freetz
|
||||
endef
|
||||
|
||||
define Package/samba3-mountcifs/description
|
||||
An user space helper utility for mounting remote CIFS shares.
|
||||
endef
|
||||
|
||||
define Package/samba3/conffiles
|
||||
/etc/config/samba
|
||||
/etc/samba/smb.conf.template
|
||||
endef
|
||||
|
||||
define Package/samba3/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS+=$(if $(CONFIG_SAMBA3_CONFIG_DEBUG),-DSAMBA_DEBUG,-DMAX_DEBUG_LEVEL=2)
|
||||
TARGET_CFLAGS+=$(if $(CONFIG_SAMBA3_CONFIG_SMALLER),-DAVM_SMALLER)
|
||||
TARGET_CFLAGS+=$(if $(CONFIG_SAMBA3_CONFIG_PRINTING),,-DAVM_NO_PRINTING)
|
||||
CONFIGURE_PATH:=source
|
||||
CONFIGURE_ARGS+= \
|
||||
$(if $(CONFIG_SAMBA3_CONFIG_DEBUG),--enable-debug) \
|
||||
$(if $(CONFIG_SAMBA3_CONFIG_PRINTING),,--enable-cups=no --enable-iprint=no) \
|
||||
--without-krb5 \
|
||||
--without-ads \
|
||||
--without-ldap \
|
||||
--enable-largefile \
|
||||
--with-configdir=/etc/samba \
|
||||
--with-libiconv=$(ICONV_PREFIX) \
|
||||
--with-privatedir=/etc/samba
|
||||
|
||||
# Make sure we tell the configure script that we support negative enum values and want to use setresuid
|
||||
CONFIGURE_VARS+= \
|
||||
SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes \
|
||||
samba_cv_USE_SETEUID=no \
|
||||
samba_cv_have_setresuid=yes \
|
||||
samba_cv_USE_SETRESUID=yes \
|
||||
samba_cv_HAVE_C99_VSNPRINTF=yes \
|
||||
samba_cv_have_longlong=yes \
|
||||
ac_cv_type_long_long=yes \
|
||||
|
||||
MAKE_PATH=source
|
||||
MAKE_FLAGS += \
|
||||
$(if $(CONFIG_SAMBA3_CONFIG_PRINTING),,OWRT_NO_PRINTING=1) \
|
||||
$(if $(CONFIG_SAMBA3_CONFIG_SMALLER),OWRT_SMALLER=1)
|
||||
|
||||
define Build/Compile
|
||||
# Ugly fix for parallel building (without this some generated files will be missing upon clean build)
|
||||
$(call Build/Compile/Default, proto_exists)
|
||||
$(call Build/Compile/Default, \
|
||||
$(if $(CONFIG_PACKAGE_samba3),bin/smbd bin/smbpasswd) \
|
||||
$(if $(CONFIG_PACKAGE_samba3-nmbd),bin/nmbd) \
|
||||
$(if $(CONFIG_PACKAGE_samba3-mountcifs),bin/mount.cifs bin/umount.cifs) \
|
||||
)
|
||||
endef
|
||||
|
||||
define Package/samba3/install
|
||||
$(INSTALL_DIR) $(1)/etc/{samba,init.d,config}
|
||||
$(INSTALL_BIN) ./files/samba.init $(1)/etc/init.d/samba
|
||||
$(INSTALL_DATA) ./files/samba.config $(1)/etc/config/samba
|
||||
$(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/samba/
|
||||
touch $(1)/etc/samba/smbpasswd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbpasswd $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbd $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/samba3-nmbd/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/samba-nmbd.init $(1)/etc/init.d/samba-nmbd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/nmbd $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/samba3-mountcifs/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/mount.cifs $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/umount.cifs $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,samba3))
|
||||
$(eval $(call BuildPackage,samba3-nmbd))
|
||||
$(eval $(call BuildPackage,samba3-mountcifs))
|
@ -1,12 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2011 OpenWrt.org
|
||||
|
||||
START=61
|
||||
|
||||
start() {
|
||||
service_start /usr/sbin/nmbd -D
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /usr/sbin/nmbd
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
# Base server settings
|
||||
config samba
|
||||
## Override if desired, defaults to hostname
|
||||
#option 'name' 'OpenWrt'
|
||||
#option 'workgroup' 'OpenWrt'
|
||||
#option 'description' 'Samba on OpenWrt'
|
||||
|
||||
## Expose user home directories, defaults to off
|
||||
option 'homes' '1'
|
||||
|
||||
## Override character set, default is UTF-8
|
||||
option 'charset' 'ISO-8859-1'
|
||||
|
||||
## Override listen interfaces & addresses,
|
||||
## defaults to loopback and lan
|
||||
#list 'interface' 'loopback'
|
||||
#list 'interface' 'lan'
|
||||
#list 'interface' '10.0.0.0/255.255.0.0'
|
||||
#list 'interface' 'eth0'
|
||||
|
||||
# Declare a share on /tmp
|
||||
config sambashare
|
||||
option 'name' 'tmp'
|
||||
option 'path' '/tmp'
|
||||
option 'read_only' 'no'
|
||||
option 'guest_ok' 'no'
|
||||
option 'create_mask' '0700'
|
||||
option 'dir_mask' '0700'
|
||||
#option 'users' 'abc'
|
@ -1,102 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2008-2011 OpenWrt.org
|
||||
|
||||
START=60
|
||||
|
||||
smb_header() {
|
||||
local interface
|
||||
config_get interface $1 interface "loopback lan"
|
||||
|
||||
# resolve interfaces
|
||||
local interfaces=$(
|
||||
include /lib/network
|
||||
scan_interfaces
|
||||
|
||||
local net
|
||||
for net in $interface; do
|
||||
local ifname
|
||||
config_get ifname "$net" ifname
|
||||
[ -n "$ifname" ] && {
|
||||
local ipaddr netmask
|
||||
config_get ipaddr "$net" ipaddr
|
||||
config_get netmask "$net" netmask
|
||||
[ -n "$ipaddr" ] && echo -n "$ipaddr/${netmask:-255.255.255.255} "
|
||||
|
||||
local ip6addr
|
||||
config_get ip6addr "$net" ip6addr
|
||||
[ -n "$ip6addr" ] && echo -n "$ip6addr "
|
||||
}
|
||||
|
||||
echo -n "${ifname:-$net} "
|
||||
done
|
||||
)
|
||||
|
||||
local name workgroup description charset
|
||||
local hostname="$(uci_get system.@system[0].hostname)"
|
||||
|
||||
config_get name $1 name "${hostname:-OpenWrt}"
|
||||
config_get workgroup $1 workgroup "${hostname:-OpenWrt}"
|
||||
config_get description $1 description "Samba on ${hostname:-OpenWrt}"
|
||||
config_get charset $1 charset "UTF-8"
|
||||
|
||||
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
|
||||
|
||||
local homes
|
||||
config_get_bool homes $1 homes 0
|
||||
[ $homes -gt 0 ] && {
|
||||
cat <<EOT >> /var/etc/smb.conf
|
||||
|
||||
[homes]
|
||||
comment = Home Directories
|
||||
browsable = no
|
||||
read only = no
|
||||
create mode = 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 read_only
|
||||
local guest_ok
|
||||
local create_mask
|
||||
local dir_mask
|
||||
|
||||
config_get name $1 name
|
||||
config_get path $1 path
|
||||
config_get users $1 users
|
||||
config_get read_only $1 read_only
|
||||
config_get guest_ok $1 guest_ok
|
||||
config_get create_mask $1 create_mask
|
||||
config_get dir_mask $1 dir_mask
|
||||
|
||||
[ -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 "$read_only" ] && echo -e "\tread only = $read_only" >> /var/etc/smb.conf
|
||||
[ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /var/etc/smb.conf
|
||||
[ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /var/etc/smb.conf
|
||||
[ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /var/etc/smb.conf
|
||||
}
|
||||
|
||||
start() {
|
||||
config_load samba
|
||||
config_foreach smb_header samba
|
||||
config_foreach smb_add_share sambashare
|
||||
service_start /usr/sbin/smbd -D
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /usr/sbin/smbd
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
[global]
|
||||
netbios name = |NAME|
|
||||
workgroup = |WORKGROUP|
|
||||
server string = |DESCRIPTION|
|
||||
syslog = 10
|
||||
encrypt passwords = true
|
||||
passdb backend = smbpasswd
|
||||
obey pam restrictions = yes
|
||||
socket options = TCP_NODELAY
|
||||
unix charset = |CHARSET|
|
||||
preferred master = yes
|
||||
os level = 20
|
||||
security = share
|
||||
guest account = nobody
|
||||
invalid users = root
|
||||
smb passwd file = /etc/samba/smbpasswd
|
||||
interfaces = |INTERFACES|
|
File diff suppressed because it is too large
Load Diff
@ -1,44 +0,0 @@
|
||||
--- a/source/popt/popt.c
|
||||
+++ b/source/popt/popt.c
|
||||
@@ -10,13 +10,14 @@
|
||||
|
||||
#include "system.h"
|
||||
|
||||
-#if HAVE_FLOAT_H
|
||||
+//#if HAVE_FLOAT_H
|
||||
#include <float.h>
|
||||
-#endif
|
||||
+//#endif
|
||||
#include <math.h>
|
||||
|
||||
#include "findme.h"
|
||||
#include "poptint.h"
|
||||
+#include "../include/config.h"
|
||||
|
||||
#ifdef MYDEBUG
|
||||
/*@unchecked@*/
|
||||
@@ -388,7 +389,7 @@ static int execCommand(poptContext con)
|
||||
sprintf(s, "%s/%s", con->execPath, item->argv[0]);
|
||||
argv[argc] = s;
|
||||
} else {
|
||||
- argv[argc] = findProgramPath(item->argv[0]);
|
||||
+ argv[argc] = ""/*findProgramPath(item->argv[0])*/;
|
||||
}
|
||||
if (argv[argc++] == NULL) return POPT_ERROR_NOARG;
|
||||
|
||||
@@ -1246,4 +1247,3 @@ int poptStrippedArgv(poptContext con, in
|
||||
|
||||
return numargs;
|
||||
}
|
||||
-/*@=boundswrite@*/
|
||||
--- a/source/modules/vfs_default.c
|
||||
+++ b/source/modules/vfs_default.c
|
||||
@@ -977,7 +977,7 @@ static int vfswrap_linux_setlease(vfs_ha
|
||||
|
||||
START_PROFILE(syscall_linux_setlease);
|
||||
|
||||
-#ifdef LINUX
|
||||
+#if defined(LINUX) && defined(HAVE_KERNEL_OPLOCKS_LINUX)
|
||||
/* first set the signal handler */
|
||||
if(linux_set_lease_sighandler(fd) == -1)
|
||||
return -1;
|
@ -1,35 +0,0 @@
|
||||
--- a/source/Makefile.in
|
||||
+++ b/source/Makefile.in
|
||||
@@ -92,7 +92,7 @@ INSTALLPERMS = 0755
|
||||
# or in smb.conf (see smb.conf(5))
|
||||
LOGFILEBASE = @logfilebase@
|
||||
CONFIGFILE = $(CONFIGDIR)/smb.conf
|
||||
-LMHOSTSFILE = $(CONFIGDIR)/lmhosts
|
||||
+LMHOSTSFILE = /etc/lmhosts
|
||||
|
||||
# This is where smbpasswd et al go
|
||||
PRIVATEDIR = @privatedir@
|
||||
--- a/source/configure
|
||||
+++ b/source/configure
|
||||
@@ -1536,8 +1536,8 @@ Optional Packages:
|
||||
--with-fhs Use FHS-compliant paths (default=no)
|
||||
--with-privatedir=DIR Where to put smbpasswd ($ac_default_prefix/private)
|
||||
--with-rootsbindir=DIR Which directory to use for root sbin ($ac_default_prefix/sbin)
|
||||
- --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/locks)
|
||||
- --with-piddir=DIR Where to put pid files ($ac_default_prefix/var/locks)
|
||||
+ --with-lockdir=DIR Where to put lock files ($ac_default_prefix/var/lock)
|
||||
+ --with-piddir=DIR Where to put pid files ($ac_default_prefix/var/run)
|
||||
--with-swatdir=DIR Where to put SWAT files ($ac_default_prefix/swat)
|
||||
--with-configdir=DIR Where to put configuration files ($libdir)
|
||||
--with-logfilebase=DIR Where to put log files ($VARDIR)
|
||||
@@ -2295,8 +2295,8 @@ fi
|
||||
|
||||
|
||||
rootsbindir="\${SBINDIR}"
|
||||
-lockdir="\${VARDIR}/locks"
|
||||
-piddir="\${VARDIR}/locks"
|
||||
+lockdir="\${VARDIR}/lock"
|
||||
+piddir="\${VARDIR}/run"
|
||||
test "${mandir}" || mandir="\${prefix}/man"
|
||||
logfilebase="\${VARDIR}"
|
||||
privatedir="\${prefix}/private"
|
@ -1,212 +0,0 @@
|
||||
--- a/source/Makefile.in
|
||||
+++ b/source/Makefile.in
|
||||
@@ -538,10 +538,7 @@ TESTPARM_OBJ = utils/testparm.o \
|
||||
|
||||
PASSWD_UTIL_OBJ = utils/passwd_util.o
|
||||
|
||||
-SMBPASSWD_OBJ = utils/smbpasswd.o $(PASSWD_UTIL_OBJ) $(PASSCHANGE_OBJ) \
|
||||
- $(PARAM_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) $(PASSDB_OBJ) \
|
||||
- $(GROUPDB_OBJ) $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) \
|
||||
- $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ)
|
||||
+SMBPASSWD_OBJ = utils/owrt_smbpasswd.o lib/md4.o
|
||||
|
||||
PDBEDIT_OBJ = utils/pdbedit.o $(PASSWD_UTIL_OBJ) $(PARAM_OBJ) $(PASSDB_OBJ) \
|
||||
$(LIBSAMBA_OBJ) $(LIB_NONSMBD_OBJ) $(GROUPDB_OBJ) \
|
||||
--- /dev/null
|
||||
+++ b/source/utils/owrt_smbpasswd.c
|
||||
@@ -0,0 +1,195 @@
|
||||
+/*
|
||||
+ * Copyright (C) John Crispin <blogic@openwrt.org>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify it
|
||||
+ * under the terms of the GNU General Public License as published by the
|
||||
+ * Free Software Foundation; either version 2 of the License, or (at your
|
||||
+ * option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
+ * more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License along with
|
||||
+ * this program; if not, write to the Free Software Foundation, Inc., 675
|
||||
+ * Mass Ave, Cambridge, MA 02139, USA. */
|
||||
+
|
||||
+#include "includes.h"
|
||||
+#include <endian.h>
|
||||
+
|
||||
+void E_md4hash(const char *passwd, uchar p16[16])
|
||||
+{
|
||||
+ int len;
|
||||
+ smb_ucs2_t wpwd[129];
|
||||
+ int i;
|
||||
+
|
||||
+ len = strlen(passwd);
|
||||
+ for (i = 0; i < len; i++) {
|
||||
+#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
+ wpwd[i] = (unsigned char)passwd[i];
|
||||
+#else
|
||||
+ wpwd[i] = (unsigned char)passwd[i] << 8;
|
||||
+#endif
|
||||
+ }
|
||||
+ wpwd[i] = 0;
|
||||
+
|
||||
+ len = len * sizeof(int16);
|
||||
+ mdfour(p16, (unsigned char *)wpwd, len);
|
||||
+ ZERO_STRUCT(wpwd);
|
||||
+}
|
||||
+
|
||||
+/* returns -1 if user is not present in /etc/passwd*/
|
||||
+int find_uid_for_user(char *user)
|
||||
+{
|
||||
+ char t[256];
|
||||
+ FILE *fp = fopen("/etc/passwd", "r");
|
||||
+ int ret = -1;
|
||||
+
|
||||
+ if(!fp)
|
||||
+ {
|
||||
+ printf("failed to open /etc/passwd");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ while(!feof(fp))
|
||||
+ {
|
||||
+ if(fgets(t, 255, fp))
|
||||
+ {
|
||||
+ char *p1, *p2;
|
||||
+ p1 = strchr(t, ':');
|
||||
+ if(p1 && (p1 - t == strlen(user)) && (strncmp(t, user, strlen(user))) == 0)
|
||||
+ {
|
||||
+ p1 = strchr(t, ':');
|
||||
+ if(!p1)
|
||||
+ goto out;
|
||||
+ p2 = strchr(++p1, ':');
|
||||
+ if(!p2)
|
||||
+ goto out;
|
||||
+ p1 = strchr(++p2, ':');
|
||||
+ if(!p1)
|
||||
+ goto out;
|
||||
+ *p1 = '\0';
|
||||
+ ret = atoi(p2);
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ printf("No valid user found in /etc/passwd\n");
|
||||
+
|
||||
+out:
|
||||
+ if(fp)
|
||||
+ fclose(fp);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+void insert_user_in_smbpasswd(char *user, char *line)
|
||||
+{
|
||||
+ char t[256];
|
||||
+ FILE *fp = fopen("/etc/samba/smbpasswd", "r+");
|
||||
+
|
||||
+ if(!fp)
|
||||
+ {
|
||||
+ printf("failed to open /etc/samba/smbpasswd");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ while(!feof(fp))
|
||||
+ {
|
||||
+ if(fgets(t, 255, fp))
|
||||
+ {
|
||||
+ char *p;
|
||||
+ p = strchr(t, ':');
|
||||
+ if(p && (p - t == strlen(user)) && (strncmp(t, user, strlen(user))) == 0)
|
||||
+ {
|
||||
+ fseek(fp, -strlen(line), SEEK_CUR);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ fprintf(fp, line);
|
||||
+
|
||||
+out:
|
||||
+ if(fp)
|
||||
+ fclose(fp);
|
||||
+}
|
||||
+
|
||||
+void delete_user_from_smbpasswd(char *user)
|
||||
+{
|
||||
+ char t[256];
|
||||
+ FILE *fp = fopen("/etc/samba/smbpasswd", "r+");
|
||||
+
|
||||
+ if(!fp)
|
||||
+ {
|
||||
+ printf("failed to open /etc/samba/smbpasswd");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ while(!feof(fp))
|
||||
+ {
|
||||
+ if(fgets(t, 255, fp))
|
||||
+ {
|
||||
+ char *p;
|
||||
+ p = strchr(t, ':');
|
||||
+ if(p && (p - t == strlen(user)) && (strncmp(t, user, strlen(user))) == 0)
|
||||
+ {
|
||||
+ fpos_t r_pos, w_pos;
|
||||
+ char t2[256];
|
||||
+ fgetpos(fp, &r_pos);
|
||||
+ w_pos = r_pos;
|
||||
+ w_pos.__pos -= strlen(t);
|
||||
+ while(fgets(t2, 256, fp))
|
||||
+ {
|
||||
+ fsetpos(fp, &w_pos);
|
||||
+ fputs(t2, fp);
|
||||
+ r_pos.__pos += strlen(t2);
|
||||
+ w_pos.__pos += strlen(t2);
|
||||
+ fsetpos(fp, &r_pos);
|
||||
+ }
|
||||
+ ftruncate(fileno(fp), w_pos.__pos);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+out:
|
||||
+ if(fp)
|
||||
+ fclose(fp);
|
||||
+}
|
||||
+
|
||||
+int main(int argc, char **argv)
|
||||
+{
|
||||
+ unsigned uid;
|
||||
+ uchar new_nt_p16[NT_HASH_LEN];
|
||||
+ int g;
|
||||
+ int smbpasswd_present;
|
||||
+ char smbpasswd_line[256];
|
||||
+ char *s;
|
||||
+
|
||||
+ if(argc != 3)
|
||||
+ {
|
||||
+ printf("usage for openwrt_smbpasswd - \n\t%s USERNAME PASSWD\n\t%s -del USERNAME\n", argv[0], argv[0]);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ if(strcmp(argv[1], "-del") == 0)
|
||||
+ {
|
||||
+ printf("deleting user %s\n", argv[2]);
|
||||
+ delete_user_from_smbpasswd(argv[2]);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ uid = find_uid_for_user(argv[1]);
|
||||
+ if(uid == -1)
|
||||
+ exit(2);
|
||||
+
|
||||
+ E_md4hash(argv[2], new_nt_p16);
|
||||
+ s = smbpasswd_line;
|
||||
+ s += snprintf(s, 256 - (s - smbpasswd_line), "%s:%u:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:", argv[1], uid);
|
||||
+ for(g = 0; g < 16; g++)
|
||||
+ s += snprintf(s, 256 - (s - smbpasswd_line), "%02X", new_nt_p16[g]);
|
||||
+ snprintf(s, 256 - (s - smbpasswd_line), ":[U ]:LCT-00000001:\n");
|
||||
+
|
||||
+ insert_user_in_smbpasswd(argv[1], smbpasswd_line);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
@ -1,13 +0,0 @@
|
||||
--- a/source/lib/ms_fnmatch.c
|
||||
+++ b/source/lib/ms_fnmatch.c
|
||||
@@ -153,6 +153,10 @@ int ms_fnmatch(const char *pattern, cons
|
||||
int ret, count, i;
|
||||
struct max_n *max_n = NULL;
|
||||
|
||||
+ if (strcmp(pattern, "*") == 0) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
if (strcmp(string, "..") == 0) {
|
||||
string = ".";
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
--- a/source/lib/popt_common.c
|
||||
+++ b/source/lib/popt_common.c
|
||||
@@ -54,7 +54,7 @@ static void set_logfile(poptContext con,
|
||||
else
|
||||
pname++;
|
||||
|
||||
- pstr_sprintf(logfile, "%s/log.%s", arg, pname);
|
||||
+ pstr_sprintf(logfile, "%s/log/%s.log", arg, pname);
|
||||
lp_set_logfile(logfile);
|
||||
}
|
||||
|
@ -1,21 +0,0 @@
|
||||
|
||||
--- a/source/configure
|
||||
+++ b/source/configure
|
||||
@@ -22548,6 +22548,17 @@ rm -f conftest.err conftest.$ac_ext
|
||||
{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
|
||||
$as_echo "$ac_header_preproc" >&6; }
|
||||
|
||||
+# Force disable RPC
|
||||
+$as_echo "test=$ac_header" >&6
|
||||
+if test "$ac_header" = "rpc/rpc.h"; then
|
||||
+ if test "$ac_header_compiler" = "yes" -o "$ac_header_preproc" = "yes"; then
|
||||
+ $as_echo "RPC support force disabled by OpenWRT patch" >&5
|
||||
+ $as_echo "RPC support force disabled by OpenWRT patch" >&6
|
||||
+ fi
|
||||
+fi
|
||||
+ac_header_compiler=no
|
||||
+ac_header_preproc=no
|
||||
+
|
||||
# So? What about this header?
|
||||
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
|
||||
yes:no: )
|
@ -1,12 +0,0 @@
|
||||
Get rid of error due to cross compilation, as glibc version in OpenWRT is high enough
|
||||
--- a/source/configure
|
||||
+++ b/source/configure
|
||||
@@ -37222,7 +37222,7 @@ rm -f core conftest.err conftest.$ac_obj
|
||||
case "$host_os" in
|
||||
*linux*)
|
||||
# glibc <= 2.3.2 has a broken getgrouplist
|
||||
- if test "$cross_compiling" = yes; then
|
||||
+ if test "false" = yes; then
|
||||
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
|
@ -1,76 +0,0 @@
|
||||
--- a/source/Makefile.in
|
||||
+++ b/source/Makefile.in
|
||||
@@ -291,7 +291,7 @@ SECRETS_OBJ = passdb/secrets.o passdb/ma
|
||||
LIBNMB_OBJ = libsmb/unexpected.o libsmb/namecache.o libsmb/nmblib.o \
|
||||
libsmb/namequery.o libsmb/conncache.o libads/dns.o
|
||||
|
||||
-LIBSAMBA_OBJ = libsmb/nterr.o libsmb/dcerpc_err.o libsmb/smbdes.o \
|
||||
+LIBSAMBA_OBJ = libsmb/nterr.o $(if $(OWRT_SMALLER),,libsmb/dcerpc_err.o) libsmb/smbdes.o \
|
||||
libsmb/smbencrypt.o libsmb/ntlm_check.o \
|
||||
libsmb/ntlmssp.o libsmb/ntlmssp_parse.o libsmb/ntlmssp_sign.o
|
||||
|
||||
@@ -323,35 +323,35 @@ REGISTRY_OBJ = registry/reg_frontend.o r
|
||||
registry/reg_db.o registry/reg_eventlog.o registry/reg_shares.o \
|
||||
registry/reg_util.o registry/reg_dynamic.o registry/reg_perfcount.o
|
||||
|
||||
-RPC_LSA_OBJ = rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o
|
||||
+RPC_LSA_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o)
|
||||
|
||||
-RPC_NETLOG_OBJ = rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o
|
||||
+RPC_NETLOG_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o)
|
||||
|
||||
-RPC_SAMR_OBJ = rpc_server/srv_samr.o rpc_server/srv_samr_nt.o \
|
||||
- rpc_server/srv_samr_util.o
|
||||
+RPC_SAMR_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_samr.o rpc_server/srv_samr_nt.o \
|
||||
+ rpc_server/srv_samr_util.o)
|
||||
|
||||
REGFIO_OBJ = registry/regfio.o
|
||||
|
||||
-RPC_REG_OBJ = rpc_server/srv_reg.o rpc_server/srv_reg_nt.o $(REGFIO_OBJ)
|
||||
+RPC_REG_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_reg.o rpc_server/srv_reg_nt.o $(REGFIO_OBJ))
|
||||
|
||||
-RPC_LSA_DS_OBJ = rpc_server/srv_lsa_ds.o rpc_server/srv_lsa_ds_nt.o
|
||||
+RPC_LSA_DS_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_lsa_ds.o rpc_server/srv_lsa_ds_nt.o)
|
||||
|
||||
RPC_SVC_OBJ = rpc_server/srv_srvsvc.o rpc_server/srv_srvsvc_nt.o
|
||||
|
||||
RPC_WKS_OBJ = librpc/gen_ndr/srv_wkssvc.o rpc_server/srv_wkssvc_nt.o
|
||||
|
||||
-RPC_SVCCTL_OBJ = rpc_server/srv_svcctl.o rpc_server/srv_svcctl_nt.o \
|
||||
+RPC_SVCCTL_OBJ = $(if $(OWRT_SMALLER),, rpc_server/srv_svcctl.o) rpc_server/srv_svcctl_nt.o \
|
||||
services/svc_spoolss.o services/svc_rcinit.o services/services_db.o \
|
||||
services/svc_netlogon.o services/svc_winreg.o \
|
||||
services/svc_wins.o
|
||||
|
||||
-RPC_NTSVCS_OBJ = rpc_server/srv_ntsvcs.o rpc_server/srv_ntsvcs_nt.o
|
||||
+RPC_NTSVCS_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_ntsvcs.o rpc_server/srv_ntsvcs_nt.o)
|
||||
|
||||
-RPC_DFS_OBJ = rpc_server/srv_dfs.o rpc_server/srv_dfs_nt.o
|
||||
+RPC_DFS_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_dfs.o rpc_server/srv_dfs_nt.o)
|
||||
|
||||
-RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o
|
||||
+RPC_SPOOLSS_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o)
|
||||
|
||||
-RPC_EVENTLOG_OBJ = rpc_server/srv_eventlog.o rpc_server/srv_eventlog_nt.o rpc_server/srv_eventlog_lib.o
|
||||
+RPC_EVENTLOG_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_eventlog.o rpc_server/srv_eventlog_nt.o rpc_server/srv_eventlog_lib.o)
|
||||
|
||||
RPC_PIPE_OBJ = rpc_server/srv_pipe_hnd.o \
|
||||
rpc_server/srv_pipe.o rpc_server/srv_lsa_hnd.o
|
||||
@@ -431,7 +431,7 @@ PLAINTEXT_AUTH_OBJ = auth/pampass.o auth
|
||||
|
||||
SLCACHE_OBJ = libsmb/samlogon_cache.o
|
||||
|
||||
-DCUTIL_OBJ = libsmb/namequery_dc.o libsmb/trustdom_cache.o libsmb/trusts_util.o
|
||||
+DCUTIL_OBJ = libsmb/namequery_dc.o $(if $(OWRT_SMALLER),,libsmb/trustdom_cache.o libsmb/trusts_util.o)
|
||||
|
||||
AUTH_BUILTIN_OBJ = auth/auth_builtin.o
|
||||
AUTH_DOMAIN_OBJ = auth/auth_domain.o
|
||||
@@ -468,7 +468,7 @@ SMBD_OBJ_SRV = smbd/files.o smbd/chgpass
|
||||
smbd/change_trust_pw.o smbd/fake_file.o \
|
||||
smbd/ntquotas.o $(AFS_OBJ) smbd/msdfs.o \
|
||||
$(AFS_SETTOKEN_OBJ) smbd/aio.o smbd/statvfs.o \
|
||||
- smbd/dmapi.o $(MANGLE_OBJ) @VFS_STATIC@
|
||||
+ $(if $(OWRT_SMALLER),,smbd/dmapi.o) $(MANGLE_OBJ) @VFS_STATIC@
|
||||
|
||||
SMBD_OBJ_BASE = $(PARAM_OBJ) $(SMBD_OBJ_SRV) $(LIBSMB_OBJ) \
|
||||
$(RPC_SERVER_OBJ) $(RPC_PARSE_OBJ) $(SECRETS_OBJ) \
|
@ -1,47 +0,0 @@
|
||||
--- a/source/Makefile.in
|
||||
+++ b/source/Makefile.in
|
||||
@@ -319,7 +319,7 @@ LIBMSRPC_GEN_OBJ = librpc/gen_ndr/cli_wk
|
||||
|
||||
REGOBJS_OBJ = registry/reg_objects.o
|
||||
|
||||
-REGISTRY_OBJ = registry/reg_frontend.o registry/reg_cachehook.o registry/reg_printing.o \
|
||||
+REGISTRY_OBJ = registry/reg_frontend.o registry/reg_cachehook.o $(if $(OWRT_NO_PRINTING),,registry/reg_printing.o) \
|
||||
registry/reg_db.o registry/reg_eventlog.o registry/reg_shares.o \
|
||||
registry/reg_util.o registry/reg_dynamic.o registry/reg_perfcount.o
|
||||
|
||||
@@ -349,7 +349,7 @@ RPC_NTSVCS_OBJ = $(if $(OWRT_SMALLER),,r
|
||||
|
||||
RPC_DFS_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_dfs.o rpc_server/srv_dfs_nt.o)
|
||||
|
||||
-RPC_SPOOLSS_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o)
|
||||
+RPC_SPOOLSS_OBJ = $(if $(OWRT_NO_PRINTING),,rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o)
|
||||
|
||||
RPC_EVENTLOG_OBJ = $(if $(OWRT_SMALLER),,rpc_server/srv_eventlog.o rpc_server/srv_eventlog_nt.o rpc_server/srv_eventlog_lib.o)
|
||||
|
||||
@@ -463,7 +463,7 @@ SMBD_OBJ_SRV = smbd/files.o smbd/chgpass
|
||||
smbd/vfs.o smbd/statcache.o \
|
||||
smbd/posix_acls.o lib/sysacls.o $(SERVER_MUTEX_OBJ) \
|
||||
smbd/process.o smbd/service.o smbd/error.o \
|
||||
- printing/printfsp.o lib/sysquotas.o lib/sysquotas_linux.o \
|
||||
+ $(if $(OWRT_NO_PRINTING),,printing/printfsp.o) lib/sysquotas.o lib/sysquotas_linux.o \
|
||||
lib/sysquotas_xfs.o lib/sysquotas_4A.o \
|
||||
smbd/change_trust_pw.o smbd/fake_file.o \
|
||||
smbd/ntquotas.o $(AFS_OBJ) smbd/msdfs.o \
|
||||
@@ -480,13 +480,13 @@ SMBD_OBJ_BASE = $(PARAM_OBJ) $(SMBD_OBJ_
|
||||
$(REGISTRY_OBJ) $(POPT_LIB_OBJ) \
|
||||
$(BUILDOPT_OBJ) $(SMBLDAP_OBJ)
|
||||
|
||||
-PRINTING_OBJ = printing/pcap.o printing/print_svid.o printing/print_aix.o \
|
||||
+PRINTING_OBJ = $(if $(OWRT_NO_PRINTING),,printing/pcap.o printing/print_svid.o printing/print_aix.o \
|
||||
printing/print_cups.o printing/print_generic.o \
|
||||
printing/lpq_parse.o printing/load.o \
|
||||
- printing/print_iprint.o printing/print_test.o
|
||||
+ printing/print_iprint.o printing/print_test.o)
|
||||
|
||||
-PRINTBASE_OBJ = printing/notify.o printing/printing_db.o
|
||||
-PRINTBACKEND_OBJ = printing/printing.o printing/nt_printing.o $(PRINTBASE_OBJ)
|
||||
+PRINTBASE_OBJ = $(if $(OWRT_NO_PRINTING),,printing/notify.o printing/printing_db.o)
|
||||
+PRINTBACKEND_OBJ = $(if $(OWRT_NO_PRINTING),,printing/printing.o printing/nt_printing.o $(PRINTBASE_OBJ))
|
||||
|
||||
SMBD_OBJ = $(SMBD_OBJ_BASE) $(SMBD_OBJ_MAIN)
|
||||
NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \
|
@ -1,41 +0,0 @@
|
||||
--- a/source/librpc/gen_ndr/ndr_wkssvc.c
|
||||
+++ b/source/librpc/gen_ndr/ndr_wkssvc.c
|
||||
@@ -1385,10 +1385,10 @@ NTSTATUS ndr_pull_USER_INFO_0_CONTAINER(
|
||||
NDR_PULL_ALLOC_N(ndr, r->user0, ndr_get_array_size(ndr, &r->user0));
|
||||
_mem_save_user0_1 = NDR_PULL_GET_MEM_CTX(ndr);
|
||||
NDR_PULL_SET_MEM_CTX(ndr, r->user0, 0);
|
||||
- for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) {
|
||||
+ for (cntr_user0_1 = 0; cntr_user0_1 < ndr_get_array_size(ndr, &r->user0); cntr_user0_1++) {
|
||||
NDR_CHECK(ndr_pull_USER_INFO_0(ndr, NDR_SCALARS, &r->user0[cntr_user0_1]));
|
||||
}
|
||||
- for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) {
|
||||
+ for (cntr_user0_1 = 0; cntr_user0_1 < ndr_get_array_size(ndr, &r->user0); cntr_user0_1++) {
|
||||
NDR_CHECK(ndr_pull_USER_INFO_0(ndr, NDR_BUFFERS, &r->user0[cntr_user0_1]));
|
||||
}
|
||||
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user0_1, 0);
|
||||
@@ -1631,10 +1631,10 @@ NTSTATUS ndr_pull_USER_INFO_1_CONTAINER(
|
||||
NDR_PULL_ALLOC_N(ndr, r->user1, ndr_get_array_size(ndr, &r->user1));
|
||||
_mem_save_user1_1 = NDR_PULL_GET_MEM_CTX(ndr);
|
||||
NDR_PULL_SET_MEM_CTX(ndr, r->user1, 0);
|
||||
- for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) {
|
||||
+ for (cntr_user1_1 = 0; cntr_user1_1 < ndr_get_array_size(ndr, &r->user1); cntr_user1_1++) {
|
||||
NDR_CHECK(ndr_pull_USER_INFO_1(ndr, NDR_SCALARS, &r->user1[cntr_user1_1]));
|
||||
}
|
||||
- for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) {
|
||||
+ for (cntr_user1_1 = 0; cntr_user1_1 < ndr_get_array_size(ndr, &r->user1); cntr_user1_1++) {
|
||||
NDR_CHECK(ndr_pull_USER_INFO_1(ndr, NDR_BUFFERS, &r->user1[cntr_user1_1]));
|
||||
}
|
||||
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user1_1, 0);
|
||||
@@ -1953,10 +1953,10 @@ NTSTATUS ndr_pull_wkssvc_NetWkstaTranspo
|
||||
NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
|
||||
_mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
|
||||
NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
|
||||
- for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
|
||||
+ for (cntr_array_1 = 0; cntr_array_1 < ndr_get_array_size(ndr, &r->array); cntr_array_1++) {
|
||||
NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
|
||||
}
|
||||
- for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
|
||||
+ for (cntr_array_1 = 0; cntr_array_1 < ndr_get_array_size(ndr, &r->array); cntr_array_1++) {
|
||||
NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
|
||||
}
|
||||
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
|
Loading…
x
Reference in New Issue
Block a user