1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-20 04:02:27 +00:00

o Security Update to 2.2.10-ja-1.0.

o rcNG-ify obtained from net/samba3.

PR:		ports/70034
Submitted by:	NAKAJI Hiroyuki <nakaji@jp.freebsd.org> (maintainer)
This commit is contained in:
Norikatsu Shigemura 2004-08-05 16:45:52 +00:00
parent f7fe02c69e
commit 828d4f6cc8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=115470
6 changed files with 149 additions and 33 deletions

View File

@ -21,7 +21,7 @@ COMMENT= A free SMB and CIFS client and server for UNIX
CONFLICTS= samba-2.2.* samba-3.0.* sharity-light-1.*
SAMBA_VERSION= 2.2.9
SAMBA_VERSION= 2.2.10
SAMBA_JA_VERSION= 1.0
USE_BZIP2= yes
@ -60,9 +60,14 @@ BUILD_VFS= ""
VARDIR= /var
SAMBA_SPOOL= ${VARDIR}/spool/samba
SAMBA_LOGDIR= ${VARDIR}/log
SAMBA_RUNDIR= ${VARDIR}/run
SAMBA_LOCKDIR= ${VARDIR}/db/samba
SAMBA_PRIVATE= ${PREFIX}/private
SAMBA_CONFDIR= ${PREFIX}/etc
SAMBA_SWATDIR= ${PREFIX}/share/swat
SAMBA_VFSDIR= ${PREFIX}/lib/samba
SAMBA_CONFIG= ${SAMBA_CONFDIR}/smb.conf
SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \
TOUCH="${TOUCH}" \
MKDIR="${MKDIR}" \
@ -70,21 +75,23 @@ SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \
SAMBA_OPTIONS="${SAMBA_OPTIONS}" \
REALCURDIR="${.CURDIR}"
# sample files
STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/samba.sh.sample
STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/samba.sh
SAMPLE_CONFIG= ${SAMBA_CONFDIR}/smb.conf.default
.include <bsd.port.pre.mk>
USE_RC_SUBR= yes
CONFIGURE_ARGS= --with-i18n-swat \
--libdir=${SAMBA_CONFDIR} \
--localstatedir=${VARDIR} --with-swatdir=${PREFIX}/share/swat \
--with-lockdir=${VARDIR}/db/samba \
--localstatedir=${VARDIR} --with-swatdir=${SAMBA_SWATDIR} \
--with-lockdir=${SAMBA_LOCKDIR} \
--with-logfilebase=${SAMBA_LOGDIR} \
--with-privatedir=${SAMBA_PRIVATE} \
--with-piddir=${VARDIR}/run \
--with-pam --with-pam_smbpass \
--with-included-popt
.include <bsd.port.pre.mk>
.if defined(WITH_SYSLOG)
CONFIGURE_ARGS+= --with-syslog
.endif
@ -116,6 +123,9 @@ LDAPSAM= ""
.if defined(WITH_WINBIND)
CONFIGURE_ARGS+= --with-winbind
WINBIND= ""
WINBIND_FILTER= ${SED} -e 's|%%WINBIND%%||g'
.else
WINBIND_FILTER= ${GREP} -v '^%%WINBIND%%'
.endif
.if defined(WITH_WINBIND_AUTH_CHALLENGE)
@ -179,6 +189,16 @@ PLIST_SUB= AUDIT=${AUDIT} \
WINBIND=${WINBIND} \
SMBSH=${SMBSH}
RC_SCRIPTS_SUB= PREFIX=${PREFIX} \
CUPS=${CUPS} \
RC_SUBR=${RC_SUBR} \
SAMBA_CONFDIR=${SAMBA_CONFDIR} \
SAMBA_CONFIG=${SAMBA_CONFIG} \
SAMBA_LOGDIR=${SAMBA_LOGDIR} \
SAMBA_RUNDIR=${SAMBA_RUNDIR} \
SAMBA_LOCKDIR=${SAMBA_LOCKDIR} \
SAMBA_SPOOL=${SAMBA_SPOOL}
post-patch:
${FIND} ${WRKSRC}/.. -name '*.orig' -delete
@ -187,8 +207,8 @@ pre-build:
(cd ${WRKSRC} && make proto)
post-build:
${SED} 's:/usr/local:${PREFIX}:g' ${FILESDIR}/samba.sh.sample \
> ${WRKDIR}/samba.sh.sample
${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/samba.sh.sample | ${WINBIND_FILTER} > ${WRKDIR}/samba.sh.sample
.if defined(WITH_RECYCLE) || defined(WITH_AUDIT)
cd ${WRKSRC}/../examples/VFS; \
./configure;${MAKE}; \

View File

@ -1,2 +1,2 @@
MD5 (samba-2.2.9-ja-1.0.tar.bz2) = 7648a1afc62ffb8e1f507f731f3f8de3
SIZE (samba-2.2.9-ja-1.0.tar.bz2) = 7474160
MD5 (samba-2.2.10-ja-1.0.tar.bz2) = 73d85b6ff8c6d3a925ff70f264eaeded
SIZE (samba-2.2.10-ja-1.0.tar.bz2) = 7473659

View File

@ -1,30 +1,123 @@
#!/bin/sh
#
# $FreeBSD$
#
smbspool=/var/spool/samba
pidfiledir=/var/run
smbd=/usr/local/sbin/smbd
nmbd=/usr/local/sbin/nmbd
# PROVIDE: nmbd smbd
%%WINBIND%%# PROVIDE: winbindd
# REQUIRE: NETWORKING SERVERS named %%CUPS%%
# BEFORE: DAEMON
# KEYWORD: FreeBSD shutdown
# start
if [ "x$1" = "x" -o "x$1" = "xstart" ]; then
if [ -f $smbd ]; then
if [ -d $smbspool ]; then
rm -f $smbspool/*
fi
echo -n ' Samba'
$nmbd -D
$smbd -D
fi
#
# Add the following lines to /etc/rc.conf to enable samba:
#
#samba_enable="YES"
#
# or, for fine grain control
#
#nmbd_enable="YES"
#smbd_enable="YES"
%%WINBIND%%#winbindd_enable="YES"
#
# stop
elif [ "x$1" = "xstop" ]; then
kill `cat $pidfiledir/smbd.pid`
kill `cat $pidfiledir/nmbd.pid`
. %%RC_SUBR%%
# restart
elif [ "x$1" = "xrestart" ]; then
$0 stop
$0 start
name=samba
rcvar=`set_rcvar`
load_rc_config $name
# Set defaults
samba_config=${samba_config:-"%%SAMBA_CONFIG%%"}
# Config file is required
if [ ! -r ${samba_config} ]; then
warn "${samba_config} is not readable."
case $1 in
force*) : ;;
*) exit 1 ;;
esac
fi
if test -n ${samba_enable:-""} && checkyesno samba_enable; then
nmbd_enable=${nmbd_enable:-"YES"}
smbd_enable=${smbd_enable:-"YES"}
%%WINBIND%% winbindd_enable=${winbindd_enable:-"YES"}
%%WINBIND%% # Check, that winbind is actally configured
%%WINBIND%% if [ ! "`egrep -i '(idmap.*uid|winbind.*uid)' ${samba_config} 2>/dev/null | egrep -v [\#\;]`" ]; then
%%WINBIND%% #warn "Winbind support is not configured"
%%WINBIND%% winbindd_enable="NO"
%%WINBIND%% fi
fi
# Hack until run_rc_command() get rid of exit()
samba_stop() {
pid=$(check_pidfile ${pidfile} ${command})
if [ -z ${pid} ]; then
echo "${name} not running? (check ${pidfile})."
return 1
fi
echo "Stopping ${command}."
kill -${sig_stop:-TERM} ${pid}
[ $? -ne 0 ] && [ -z "$rc_force" ] && return 1
wait_for_pids ${pid}
}
nmbd_precmd() {
# XXX: Never delete winbindd_idmap, winbindd_cache and group_mapping
if [ -d "%%SAMBA_LOCKDIR%%" ]; then
echo "Starting SAMBA: removing stale tdbs :"
for file in connections.tdb locking.tdb messages.tdb \
sessionid.tdb unexpected.tdb brlock.tdb \
namelist.debug
do
rm -vf "%%SAMBA_LOCKDIR%%/$file"
done
fi
}
# nmbd
name=nmbd
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/${name}"
required_dirs="%%SAMBA_LOCKDIR%%"
pidfile=%%SAMBA_RUNDIR%%/${name}.pid
start_precmd="nmbd_precmd"
stop_cmd="samba_stop"
# Defaults
nmbd_enable=${nmbd_enable:-"NO"}
nmbd_flags=${nmbd_flags:-"-D"}
command_args="-s ${samba_config}"
load_rc_config $name
run_rc_command "$1"
# smbd
name=smbd
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/${name}"
pidfile=%%SAMBA_RUNDIR%%/${name}.pid
start_precmd=":"
stop_cmd="samba_stop"
# Defaults
smbd_enable=${smbd_enable:-"NO"}
smbd_flags=${smbd_flags:-"-D"}
command_args="-s ${samba_config}"
load_rc_config $name
run_rc_command "$1"
%%WINBIND%%
%%WINBIND%%# winbindd
%%WINBIND%%name=winbindd
%%WINBIND%%rcvar=`set_rcvar`
%%WINBIND%%command="%%PREFIX%%/sbin/${name}"
%%WINBIND%%required_dirs="%%SAMBA_LOCKDIR%%"
%%WINBIND%%pidfile=%%SAMBA_RUNDIR%%/${name}.pid
%%WINBIND%%start_precmd=":"
%%WINBIND%%stop_cmd="samba_stop"
%%WINBIND%%# Defaults
%%WINBIND%%winbindd_enable=${winbindd_enable:-"NO"}
%%WINBIND%%winbindd_flags=${winbindd_flags:-""}
%%WINBIND%%command_args="-s ${samba_config}"
%%WINBIND%%
%%WINBIND%%load_rc_config $name
%%WINBIND%%run_rc_command "$1"

View File

@ -82,7 +82,8 @@ etc/codepages/unicode_map.ISO8859-9
etc/codepages/unicode_map.KOI8-R
etc/codepages/unicode_map.KOI8-U
@dirrm etc/codepages
etc/rc.d/samba.sh.sample
@unexec %D/etc/rc.d/samba.sh forcestop 2>/dev/null || true
etc/rc.d/samba.sh
etc/smb.conf.default
%%AUDIT%%lib/samba/audit.so
%%RECYCLE%%lib/samba/recycle.so

View File

@ -63,3 +63,4 @@ ripmime<1.3.2.3|http://www.osvdb.org/8287 http://secunia.com/advisories/12201|ri
squid<2.5.5_11|http://www.osvdb.org/6791|Squid NTLM authentication helper overflow|f72ccf7c-e607-11d8-9b0a-000347a4fa7d
acroread<5.09|http://www.osvdb.org/7429 http://freshmeat.net/projects/acrobatreader/?branch_id=92&release_id=164883|Acrobat Reader handling of malformed uuencoded pdf files|ab166a60-e60a-11d8-9b0a-000347a4fa7d
{linux-,}opera<7.54|http://www.opera.com/freebsd/changelogs/754/ http://www.greymagic.com/security/advisories/gm008-op/ http://secunia.com/advisories/12233 http://www.osvdb.org/8331|Opera "location" object write access vulnerability|0deed2ce-e6f5-11d8-9a79-000347dd607f
ja-samba>=2.2.0<2.2.10|http://www.osvdb.org/8191 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0686|Buffer overflow|7eded4b8-e6fe-11d8-b12f-0a001f31891a

View File

@ -63,3 +63,4 @@ ripmime<1.3.2.3|http://www.osvdb.org/8287 http://secunia.com/advisories/12201|ri
squid<2.5.5_11|http://www.osvdb.org/6791|Squid NTLM authentication helper overflow|f72ccf7c-e607-11d8-9b0a-000347a4fa7d
acroread<5.09|http://www.osvdb.org/7429 http://freshmeat.net/projects/acrobatreader/?branch_id=92&release_id=164883|Acrobat Reader handling of malformed uuencoded pdf files|ab166a60-e60a-11d8-9b0a-000347a4fa7d
{linux-,}opera<7.54|http://www.opera.com/freebsd/changelogs/754/ http://www.greymagic.com/security/advisories/gm008-op/ http://secunia.com/advisories/12233 http://www.osvdb.org/8331|Opera "location" object write access vulnerability|0deed2ce-e6f5-11d8-9a79-000347dd607f
ja-samba>=2.2.0<2.2.10|http://www.osvdb.org/8191 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0686|Buffer overflow|7eded4b8-e6fe-11d8-b12f-0a001f31891a