#
-# Copyright (C) 2008 OpenWrt.org
+# Copyright (C) 2008-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=samba3
PKG_VERSION:=3.0.24
-PKG_RELEASE:=3
-#PKG_MD5SUM:=b51b2975f21006f85f7297f3fb1acde1
+PKG_RELEASE:=4
+PKG_MD5SUM:=89273f67a6d8067cbbecefaa13747153
PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/samba/old-versions/
PKG_SOURCE:=samba-$(PKG_VERSION).tar.gz
CPPFLAGS="$(TARGET_CPPFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
$(MAKE) -C $(PKG_BUILD_DIR)/source \
- all bin/smbpasswd
+ all bin/smbpasswd
endef
define Package/samba3/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbpasswd $(1)/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbd $(1)/bin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/nmbd $(1)/bin/
endef
$(eval $(call BuildPackage,samba3))
local workgroup
local description
local homes
-
+
config_get name $1 name
config_get workgroup $1 workgroup
config_get description $1 description
config_get homes $1 homes
-
+
[ -z "$name" ] && name=openwrt
[ -z "$workgroup" ] && workgroup=openwrt
[ -z "$description" ] && description=openwrt
-
+
cp /etc/samba/smb.conf.template /tmp/smb.conf
sed -i "s/|NAME|/$name/g" /tmp/smb.conf
sed -i "s/|WORKGROUP|/$workgroup/g" /tmp/smb.conf
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 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" >> /tmp/smb.conf
[ -n "$users" ] && echo -e "\tvalid users = $users" >> /tmp/smb.conf
[ -n "$read_only" ] && echo -e "\tread only = $read_only" >> /tmp/smb.conf
start() {
config_load samba
config_foreach smb_header samba
- config_foreach smb_add_share sambashare
+ config_foreach smb_add_share sambashare
smbd -D
}
diff -urN samba-3.0.24.orig/source/lib/pidfile.c samba-3.0.24/source/lib/pidfile.c
--- samba-3.0.24.orig/source/lib/pidfile.c 2007-02-04 19:59:17.000000000 +0100
+++ samba-3.0.24/source/lib/pidfile.c 2007-07-17 13:19:05.000000000 +0200
-@@ -82,19 +82,20 @@
+@@ -82,19 +82,22 @@
{
int fd;
char buf[20];
+ char *short_configfile = strrchr( dyn_CONFIGFILE, '/');
slprintf( name, sizeof( name)-1, "%s-%s", program_name, short_configfile+1);
}
++#else
++ strncpy( name, program_name, sizeof( name)-1);
+#endif
slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_piddir(), name);
}
}
-diff -urN samba-3.0.24.orig/source/libsmb/clifile.c samba-3.0.24/source/libsmb/clifile.c
---- samba-3.0.24.orig/source/libsmb/clifile.c 2007-02-04 19:59:20.000000000 +0100
-+++ samba-3.0.24/source/libsmb/clifile.c 2007-07-17 13:19:05.000000000 +0200
+--- samba-3.0.24/source/libsmb/clifile.c.orig 2009-12-21 07:53:20.000000000 +0100
++++ samba-3.0.24/source/libsmb/clifile.c 2009-12-21 07:51:10.000000000 +0100
@@ -21,6 +21,8 @@
#include "includes.h"
/****************************************************************************
Hard/Symlink a file (UNIX extensions).
Creates new name (sym)linked to oldname.
-@@ -71,6 +73,9 @@
+@@ -71,6 +73,8 @@
return True;
}
+#endif /* AVM_SMALLER */
-+
+
/****************************************************************************
Map standard UNIX permissions onto wire representations.
****************************************************************************/
-@@ -165,6 +170,9 @@
+@@ -165,6 +169,8 @@
}
}
-+
+#ifndef AVM_SMALLER
+
/****************************************************************************
Do a POSIX getfacl (UNIX extensions).
****************************************************************************/
-@@ -1759,3 +1767,6 @@
+@@ -785,6 +791,8 @@
+ return SVAL(cli->inbuf,smb_vwv2);
+ }
+
++#endif /* AVM_SMALLER */
++
+ /****************************************************************************
+ Close a file.
+ ****************************************************************************/
+@@ -813,6 +821,8 @@
+
+
+
++#ifndef AVM_SMALLER
++
+ /****************************************************************************
+ send a lock with a specified locktype
+ this is used for testing LOCKING_ANDX_CANCEL_LOCK
+@@ -1760,3 +1770,6 @@
return cli_get_ea_list(cli, setup, param, 6, ctx, pnum_eas, pea_list);
}
+
+#endif /* AVM_SMALLER */
+
+
diff -urN samba-3.0.24.orig/source/libsmb/namequery.c samba-3.0.24/source/libsmb/namequery.c
--- samba-3.0.24.orig/source/libsmb/namequery.c 2007-02-04 19:59:20.000000000 +0100
+++ samba-3.0.24/source/libsmb/namequery.c 2007-07-17 13:19:05.000000000 +0200
+# Also depends on $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
+# Be sure to include them into your application
+
-+# AR7 POPT_LIB_OBJ = lib/popt_common.o
-+POPT_LIB_OBJ =
++POPT_LIB_OBJ = lib/popt_common.o
+
+UBIQX_OBJ = ubiqx/ubi_BinTree.o ubiqx/ubi_Cache.o ubiqx/ubi_SplayTree.o \
+ ubiqx/ubi_dLinkList.o ubiqx/ubi_sLinkList.o
+ libsmb/ntlmssp.o libsmb/ntlmssp_parse.o libsmb/ntlmssp_sign.o
+
+LIBSMB_OBJ = \
++ libsmb/clientgen.o \
++ libsmb/cliconnect.o \
++ libsmb/clirap.o \
++ libsmb/clistr.o \
++ libsmb/clitrans.o \
+ libsmb/clifile.o \
+ lib/util_seaccess.o \
+ libsmb/clikrb5.o \
+ nmbd/nmbd_subnetdb.o nmbd/nmbd_winsproxy.o nmbd/nmbd_winsserver.o \
+ nmbd/nmbd_workgroupdb.o nmbd/nmbd_synclists.o
+
-+NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(UBIQX_OBJ) \
-+ $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ)
++NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) \
++ $(KRBCLIENT_OBJ) $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) \
++ $(SECRETS_OBJ) $(POPT_LIB_OBJ)
+
+WREPL_OBJ1 =
+
+######################################################################
+# now the rules...
+######################################################################
-+all : SHOWFLAGS proto_exists bin/smbd bin/smbpasswd
++all : SHOWFLAGS proto_exists bin/smbd bin/smbpasswd bin/nmbd
+
+pam_smbpass : SHOWFLAGS bin/pam_smbpass.so
+
+ dir=bin $(MAKEDIR); fi
+ @: >> $@ || : > $@ # what a fancy emoticon!
+
-+bin/smbd: bin/libsmbd.a $(SMBD_OBJ_MAIN) bin/.dummy
++bin/smbd: bin/libsmbd.a $(SMBD_OBJ_MAIN) $(POPT_OBJS) $(POPT_LIB_OBJ) bin/.dummy
+ @echo Linking $@
-+ $(CC) $(FLAGS) -o $@ $(SMBD_OBJ_MAIN) $(LDFLAGS) \
++ $(CC) $(FLAGS) -o $@ $(SMBD_OBJ_MAIN) $(POPT_OBJS) $(POPT_LIB_OBJ) $(LDFLAGS) \
+ $(AUTH_LIBS) \
+ -Lbin -lsmbd \
+ -L$(TARGETFS)/lib \
AR=ar
LDSHFLAGS=-shared -Wl,-Bsymbolic
WINBIND_NSS_LDSHFLAGS=-shared -Wl,-Bsymbolic
-@@ -238,7 +238,9 @@
- lib/adt_tree.o lib/gencache.o $(TDB_OBJ) \
- lib/module.o lib/ldap_escape.o \
- lib/privileges.o lib/secdesc.o lib/secace.o lib/secacl.o \
-- lib/arc4.o lib/sharesec.o lib/events.o lib/util_nscd.o
-+ lib/arc4.o lib/sharesec.o lib/events.o lib/util_nscd.o \
-+ popt/poptparse.o popt/popthelp.o popt/poptconfig.o \
-+ lib/popt_common.o popt/popt.o
-
- LIB_NONSMBD_OBJ = $(LIB_OBJ) lib/dummysmbd.o lib/dummyroot.o
-
+
Index: samba-3.0.24/source/popt/popt.c
===================================================================
--- samba-3.0.24.orig/source/popt/popt.c 2008-08-07 11:15:00.000000000 +0200