pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc Update net/samba to 2.2.8nb4. Changes from 2.2.8nb3 a...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/eb13338c6b96
branches:  trunk
changeset: 461364:eb13338c6b96
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sun Sep 14 22:25:25 2003 +0000

description:
Update net/samba to 2.2.8nb4.  Changes from 2.2.8nb3 are installing
adduser and deluser scripts into ${PKG_SYSCONFDIR} that are capable of
dealing with usernames containing a "$".  These scripts basically
accept the same options as useradd/userdel.  They're meant to be used
in "add user script" and "delete user script" to deal with samba
machine accounts.

diffstat:

 doc/CHANGES                |    3 +-
 net/samba/Makefile         |   27 +++++++-
 net/samba/PLIST            |    4 +-
 net/samba/files/adduser.sh |  160 +++++++++++++++++++++++++++++++++++++++++++++
 net/samba/files/deluser.sh |   68 +++++++++++++++++++
 5 files changed, 258 insertions(+), 4 deletions(-)

diffs (truncated from 329 to 300 lines):

diff -r c9231958902e -r eb13338c6b96 doc/CHANGES
--- a/doc/CHANGES       Sun Sep 14 22:15:21 2003 +0000
+++ b/doc/CHANGES       Sun Sep 14 22:25:25 2003 +0000
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES,v 1.3377 2003/09/14 21:29:57 bouyer Exp $
+$NetBSD: CHANGES,v 1.3378 2003/09/14 22:25:29 jlam Exp $
 
 Changes to the packages collection and infrastructure in 2003:
 
@@ -3692,3 +3692,4 @@
        Added p5-Set-IntSpan-1.07 [gson 2003-09-14]
        Updated horde to 2.2.4 [bouyer 2003-09-14]
        Updated imp to 3.2.2 [bouyer 2003-09-14]
+       Updated samba to 2.2.8nb4 [jlam 2003-09-14]
diff -r c9231958902e -r eb13338c6b96 net/samba/Makefile
--- a/net/samba/Makefile        Sun Sep 14 22:15:21 2003 +0000
+++ b/net/samba/Makefile        Sun Sep 14 22:25:25 2003 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.102 2003/09/05 19:13:41 kim Exp $
+# $NetBSD: Makefile,v 1.103 2003/09/14 22:25:25 jlam Exp $
 
 .include "Makefile.common"
-PKGREVISION=           3
+PKGREVISION=           4
 
 MAINTAINER=            tech-pkg%NetBSD.org@localhost
 HOMEPAGE=              http://www.samba.org/
@@ -56,10 +56,27 @@
 
 CONF_FILES=            ${EXAMPLESDIR}/smb.conf.default ${SAMBA_ETCDIR}/smb.conf
 SUPPORT_FILES_PERMS=   ${SMBPASSWD_FILE}
+SUPPORT_FILES_PERMS+=  ${EXAMPLESDIR}/adduser.sh ${SAMBA_ETCDIR}/adduser \
+                       ${ROOT_USER} ${ROOT_GROUP} 0555
+SUPPORT_FILES_PERMS+=  ${EXAMPLESDIR}/deluser.sh ${SAMBA_ETCDIR}/deluser \
+                       ${ROOT_USER} ${ROOT_GROUP} 0555
 RCD_SCRIPTS=           samba nmbd smbd
 OWN_DIRS=              ${SAMBA_ETCDIR} ${SAMBA_LOCKDIR}
 OWN_DIRS_PERMS=                ${SAMBA_PRIVATE} ${ROOT_USER} ${ROOT_GROUP} 0500
 
+.if !defined(MKTEMP)
+MKTEMP!=       ${TYPE} mktemp | \
+               ${AWK} '/not found/ { print "mktemp"; exit } { print $$3 }'
+MAKEFLAGS+=    MKTEMP="${MKTEMP}"
+.endif
+.if !defined(PWD_MKDB)
+PWD_MKDB!=     ${TYPE} pwd_mkdb | \
+               ${AWK} '/not found/ { print "pwd_mkdb"; exit } { print $$3 }'
+MAKEFLAGS+=    PWD_MKDB="${PWD_MKDB}"
+.endif
+FILES_SUBST+=  MKTEMP=${MKTEMP:Q}
+FILES_SUBST+=  PWD_MKDB=${PWD_MKDB:Q}
+
 # Remove irrelevant files for this package.
 post-extract:
        ${FIND} ${WRKDIR}/${DISTNAME} -name ".cvsignore" -print |       \
@@ -72,6 +89,10 @@
        ${RM} -r ${WRKDIR}/${DISTNAME}/examples/libsmbclient
        ${RM} -r ${WRKDIR}/${DISTNAME}/examples/svr4-startup
 
+post-build:
+       @${SED} ${FILES_SUBST_SED} ${FILESDIR}/adduser.sh > ${WRKDIR}/adduser.sh
+       @${SED} ${FILES_SUBST_SED} ${FILESDIR}/deluser.sh > ${WRKDIR}/deluser.sh
+
 post-install:
        # Install Samba documentation.
        ${INSTALL_DATA_DIR} ${DOCDIR}
@@ -82,6 +103,8 @@
 
        # Install Samba examples.
        ${INSTALL_DATA_DIR} ${EXAMPLESDIR}
+       ${INSTALL_SCRIPT} ${WRKDIR}/adduser.sh ${EXAMPLESDIR}/adduser.sh
+       ${INSTALL_SCRIPT} ${WRKDIR}/deluser.sh ${EXAMPLESDIR}/deluser.sh
        ${CP} -R ${WRKDIR}/${DISTNAME}/examples/* ${EXAMPLESDIR}
        ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${EXAMPLESDIR}
        ${CHMOD} -R ugo-w ${EXAMPLESDIR}
diff -r c9231958902e -r eb13338c6b96 net/samba/PLIST
--- a/net/samba/PLIST   Sun Sep 14 22:15:21 2003 +0000
+++ b/net/samba/PLIST   Sun Sep 14 22:25:25 2003 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.11 2003/06/04 06:12:21 jlam Exp $
+@comment $NetBSD: PLIST,v 1.12 2003/09/14 22:25:25 jlam Exp $
 bin/findsmb
 bin/make_printerdef
 bin/make_smbcodepage
@@ -143,6 +143,8 @@
 share/examples/samba/LDAP/smbldap-tools/smbldap_conf.pm
 share/examples/samba/LDAP/smbldap-tools/smbldap_tools.pm
 share/examples/samba/README
+share/examples/samba/adduser.sh
+share/examples/samba/deluser.sh
 share/examples/samba/misc/convert_smbpasswd
 share/examples/samba/misc/extra_smbstatus
 share/examples/samba/misc/modify_samba_config.pl
diff -r c9231958902e -r eb13338c6b96 net/samba/files/adduser.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/samba/files/adduser.sh        Sun Sep 14 22:25:25 2003 +0000
@@ -0,0 +1,160 @@
+#!/bin/sh
+#
+# $NetBSD: adduser.sh,v 1.1 2003/09/14 22:25:26 jlam Exp $
+#
+# This is an adduser script for NetBSD systems whose useradd(8) doesn't
+# accept "$" in the username.
+
+awkprog="@AWK@"
+catprog="@CAT@"
+mktempprog="@MKTEMP@"
+pwdmkdbprog="@PWD_MKDB@"
+rmprog="@RM@"
+
+progname=adduser
+
+usage() {
+       echo "Usage: $progname [-c comment] [-d homedir] [-n] [-r low..high]"
+       echo "          [-s shell] -g gid name"
+       exit 1
+}
+
+isnum() {
+       case "$1" in
+       0[0-9]*|*[!0-9]*)
+               return 1
+               ;;
+       esac
+       return 0
+}
+
+doit=""
+gid=""
+minuid=1000
+maxuid=60000
+comment=""
+homedir=""
+shell=/sbin/nologin
+
+while getopts c:d:g:nr:s: flag; do
+       case $flag in
+       c)      comment="${OPTARG}" ;;
+       d)      homedir="${OPTARG}" ;;
+       g)      gid="${OPTARG}" ;;
+       n)      doit=":" ;;
+       r)      minuid=${OPTARG%%..*}; maxuid=${OPTARG##*..} ;;
+       s)      shell="${OPTARG}" ;;
+       esac
+done
+shift `expr $OPTIND - 1`
+
+if [ $# -lt 1 ]; then
+       usage
+fi
+
+name="$1"
+if [ -z "$gid" ]; then
+       echo "$progname: \`-g gid' is a required option" 1>&2
+       exit 1
+fi
+if ! isnum "$gid"; then
+       echo "$progname: \`$gid' is not a valid gid" 1>&2
+       exit 1
+fi
+if ! isnum "$minuid"; then
+       echo "$progname: \`$minuid' is not a valid minimum uid" 1>&2
+       exit 1
+fi
+if ! isnum "$maxuid"; then
+       echo "$progname: \`$maxuid' is not a valid maximum uid" 1>&2
+       exit 1
+fi
+if [ $minuid -gt $maxuid ]; then
+       echo "$progname: \`$minuid..$maxuid' is not a valid range" 1>&2
+       exit 1
+fi
+case "$comment" in
+*:*)
+       echo "$progname: \`$comment' is not a valid comment" 1>&2
+       exit 1
+       ;;
+esac
+case "$homedir" in
+*:*)
+       echo "$progname: \`$homedir' is not a valid home directory" 1>&2
+       exit 1
+       ;;
+%*)
+       # This is an unsubstituted variable (probably %H in smbd).
+       # Silently change this to a proper default.
+       #
+       homedir="/nonexistent"
+       ;;
+esac
+case "$shell" in
+*:*)
+       echo "$progname: \`$shell' is not a valid shell" 1>&2
+       exit 1
+       ;;
+esac
+case "$name" in
+*:*)
+       echo "$progname: \`$name' is not a valid username" 1>&2
+       exit 1
+       ;;
+esac
+
+ptmp=`$mktempprog -q /etc/ptmp`
+case "$ptmp" in
+/etc/ptmp)
+       ;;
+*)
+       echo "$progname: can't create /etc/ptmp" 1>&2
+       exit 1
+       ;;
+esac
+
+if [ ! -f /etc/master.passwd ]; then
+       echo "$progname: /etc/master.passwd not found" 1>&2
+       $rmprog -f $ptmp
+       exit 1
+fi
+
+$catprog /etc/master.passwd >> $ptmp
+
+uid=`                                                                  \
+       $awkprog -v minuid=$minuid -v maxuid=maxuid '                   \
+               BEGIN { FS = ":" }                                      \
+               { seen_uids[$3] = 1 }                                   \
+               END {                                                   \
+                       uid = minuid;                                   \
+                       while (uid <= maxuid) {                         \
+                               if (uid in seen_uids) {                 \
+                                       uid++;                          \
+                                       continue;                       \
+                               }                                       \
+                               print uid;                              \
+                               exit;                                   \
+                       }                                               \
+                       print -1;                                       \
+               }' $ptmp                                                \
+`
+if [ $uid -lt 0 ]; then
+       echo "$progname: no uid can be allocated in $minuid..$maxuid" 1>&2
+       $rmprog -f $ptmp
+       exit 1
+fi
+
+case "${name}" in
+*$)    : ${comment:=${name%%[$]*} samba machine account} ;;
+*)     : ${comment:=${name} samba user} ;;
+esac
+entry="${name}:*:${uid}:${gid}::0:0:${comment}:${homedir}:${shell}"
+
+echo "$entry" >> $ptmp
+
+$doit $pwdmkdbprog -p -u "${name}" $ptmp
+rc=$?
+
+$rmprog -f $ptmp
+exit $rc
diff -r c9231958902e -r eb13338c6b96 net/samba/files/deluser.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/samba/files/deluser.sh        Sun Sep 14 22:25:25 2003 +0000
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+# $NetBSD: deluser.sh,v 1.1 2003/09/14 22:25:26 jlam Exp $
+#
+# This is a deluser script for NetBSD systems whose userdel(8) doesn't
+# accept "$" in the username.
+
+awkprog="@AWK@"
+mktempprog="@MKTEMP@"
+pwdmkdbprog="@PWD_MKDB@"
+rmprog="@RM@"
+
+progname=deluser
+
+usage() {
+       echo "Usage: $progname [-n] name"
+       exit 1
+}
+
+doit=""
+
+while getopts n flag; do
+       case $flag in
+       n)      doit=":" ;;
+       esac
+done
+shift `expr $OPTIND - 1`
+
+if [ $# -lt 1 ]; then
+       usage
+fi
+
+name="$1"
+
+case "$name" in
+*:*)
+       echo "$progname: \`$name' is not a valid user name" 1>&2
+       exit 1
+esac



Home | Main Index | Thread Index | Old Index