summaryrefslogtreecommitdiff
path: root/net/ja-samba
diff options
context:
space:
mode:
authortaca <taca@pkgsrc.org>2004-06-05 13:16:35 +0000
committertaca <taca@pkgsrc.org>2004-06-05 13:16:35 +0000
commitee9ace7941625459dbdb87523091b44327748f0f (patch)
tree1c12650a7f87d1226299d4959977516b3a70d9c5 /net/ja-samba
parent1bca7eb4eab3afb25d6897a3595d96627d3b5df4 (diff)
downloadpkgsrc-ee9ace7941625459dbdb87523091b44327748f0f.tar.gz
Update ja-samba package to 2.2.9.1.0 (samba-2.2.9-ja-1.0).
- Introduce adduser/deluser script from samba2 package. - Here is changes: Changelog of Samba2.2 Japanese Edition Samba Users Group Japan Here is the fix list of Samba2.2 Japanese Edition. The sign of each line means: *: Fix of Samba Japanese Edition only x: Fix of sending a patch to Samba Team c: Fix of being commited a patch by Samba Team o: Fix of adopting a patch created by Samba team samba-2.2.8a-ja-1.2alpha3 ~~~~~~~~~~~~~~~~~~~~~~~~~ o Fixed oplocks problem for Linux kernel 2.4 or later [sugj-tech:6096] samba-2.2.8a-ja-1.2alpha2 ~~~~~~~~~~~~~~~~~~~~~~~~~ Changes to the internationalized version * Support Kerberos V not only for FreeBSD [sugj-tech:6030] * Adjust some directory specifications for RPM [sugj-tech:6029] * Fixed unavailable winbind auth problem on FreeBSD [sugj-tech:6049] * Fixed smbwrapper.64.so problem for 64bit Solaris [sugj-tech:6048] Changes to the original version * Suppressed abortion in some commands when resolve order is specified [sugj-tech:6031] * Fixed unchangeable password problem when Samba is PDC for BSDish OS [sugj-tech:6073] samba-2.2.8a-ja-1.2alpha1 ~~~~~~~~~~~~~~~~~~~~~~~~~ Changes to the internationalized version * Fixed unavailable Japanese problem for username in username map [samba-jp:15437] Changes to the original version * Fixed build problem with Mac OS X [samba-jp:15461] * Fixed unaccessable problem in BSD/OS, Mac OS X [samba-jp:15472]
Diffstat (limited to 'net/ja-samba')
-rw-r--r--net/ja-samba/Makefile28
-rw-r--r--net/ja-samba/Makefile.common9
-rw-r--r--net/ja-samba/PLIST4
-rw-r--r--net/ja-samba/distinfo14
-rw-r--r--net/ja-samba/files/adduser.sh160
-rw-r--r--net/ja-samba/files/deluser.sh68
-rw-r--r--net/ja-samba/patches/patch-aa8
-rw-r--r--net/ja-samba/patches/patch-ab6
-rw-r--r--net/ja-samba/patches/patch-ac14
-rw-r--r--net/ja-samba/patches/patch-ap26
10 files changed, 295 insertions, 42 deletions
diff --git a/net/ja-samba/Makefile b/net/ja-samba/Makefile
index 8fef2210bdf..8a6e28b316b 100644
--- a/net/ja-samba/Makefile
+++ b/net/ja-samba/Makefile
@@ -1,9 +1,8 @@
-# $NetBSD: Makefile,v 1.25 2004/05/05 03:54:59 snj Exp $
+# $NetBSD: Makefile,v 1.26 2004/06/05 13:16:35 taca Exp $
.include "Makefile.common"
-PKGNAME= ja-samba-${SAMBA_BASE_VERS:S/a/.1/}.${SAMBA_JA_VERS}
-PKGREVISION= 3
+PKGNAME= ja-samba-${SAMBA_BASE_VERS}.${SAMBA_JA_VERS}
CATEGORIES= net
MAINTAINER= tech-pkg-ja@jp.NetBSD.org
@@ -66,10 +65,27 @@ EXAMPLESDIR= ${PREFIX}/share/examples/samba
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 2>&1 | \
+ ${AWK} '/not found/ { print "mktemp"; exit } { print $$3 }'
+MAKEFLAGS+= MKTEMP=${MKTEMP:Q}
+.endif
+.if !defined(PWD_MKDB)
+PWD_MKDB!= ${TYPE} pwd_mkdb 2>&1 | \
+ ${AWK} '/not found/ { print "pwd_mkdb"; exit } { print $$3 }'
+MAKEFLAGS+= PWD_MKDB=${PWD_MKDB:Q}
+.endif
+FILES_SUBST+= MKTEMP=${MKTEMP:Q}
+FILES_SUBST+= PWD_MKDB=${PWD_MKDB:Q}
+
REPLACE_PERL= script/findsmb.in
# Remove irrelevant files for this package.
@@ -85,6 +101,10 @@ post-extract:
${RM} -r ${WRKDIR}/${DISTNAME}/examples/smbchartool
${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}
@@ -95,6 +115,8 @@ post-install:
# 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 --git a/net/ja-samba/Makefile.common b/net/ja-samba/Makefile.common
index 15018430e0a..ae7d7e969f5 100644
--- a/net/ja-samba/Makefile.common
+++ b/net/ja-samba/Makefile.common
@@ -1,12 +1,13 @@
-# $NetBSD: Makefile.common,v 1.4 2003/08/30 01:31:11 taca Exp $
+# $NetBSD: Makefile.common,v 1.5 2004/06/05 13:16:35 taca Exp $
DISTNAME= samba-${SAMBA_BASE_VERS}-ja-${SAMBA_JA_VERS}
-SAMBA_BASE_VERS= 2.2.8a
-SAMBA_JA_VERS= 1.1
+SAMBA_BASE_VERS= 2.2.9
+SAMBA_JA_VERS= 1.0
WRKSRC?= ${WRKDIR}/${DISTNAME}/source
CATEGORIES?= net
MASTER_SITES= ftp://ftp.samba.gr.jp/pub/samba-jp/samba-${SAMBA_BASE_VERS}-ja/ \
- ftp://ring.asahi-net.or.jp/pub/net/samba-jp/samba-${SAMBA_BASE_VERS}-ja/
+ ftp://ftp.ring.gr.jp/pub/net/samba-jp/samba-${SAMBA_BASE_VERS}-ja/ \
+ ftp://ftp.mex.ad.jp/pub/samba-jp/pub/net/samba-jp/samba-${SAMBA_BASE_VERS}-ja/
EXTRACT_SUFX= .tar.bz2
DISTINFO_FILE?= ${.CURDIR}/../../net/ja-samba/distinfo
diff --git a/net/ja-samba/PLIST b/net/ja-samba/PLIST
index 19f3487523e..ed19ba55225 100644
--- a/net/ja-samba/PLIST
+++ b/net/ja-samba/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.8 2004/04/23 22:07:56 reed Exp $
+@comment $NetBSD: PLIST,v 1.9 2004/06/05 13:16:35 taca Exp $
bin/findsmb
bin/make_printerdef
bin/make_smbcodepage
@@ -168,6 +168,8 @@ share/examples/samba/LDAP/smbldap-tools/smbldap-usershow.pl
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 --git a/net/ja-samba/distinfo b/net/ja-samba/distinfo
index 91b65228e06..814614913be 100644
--- a/net/ja-samba/distinfo
+++ b/net/ja-samba/distinfo
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.12 2003/08/30 01:31:12 taca Exp $
+$NetBSD: distinfo,v 1.13 2004/06/05 13:16:35 taca Exp $
-SHA1 (samba-2.2.8a-ja-1.1.tar.bz2) = 3069f47d00224f48a2d0a1604adce195a17d7f9d
-Size (samba-2.2.8a-ja-1.1.tar.bz2) = 7474236 bytes
-SHA1 (patch-aa) = aab982c0eee1dbd8c70de0c2e5e2cfe46d5b7e87
-SHA1 (patch-ab) = da27a47ee94d64793b4dd1baf3778f9fa30ba755
-SHA1 (patch-ac) = 068da71c70a29009d2b36d261b49fc2848dadc6d
+SHA1 (samba-2.2.9-ja-1.0.tar.bz2) = 982339aaecf4276db0f87e7491c0f4ff039d0d75
+Size (samba-2.2.9-ja-1.0.tar.bz2) = 7474160 bytes
+SHA1 (patch-aa) = 2f553bd640a819e9543d4678c779d5f98a164e3f
+SHA1 (patch-ab) = a2eef891b0a38955f22a9adeec09666d231a541f
+SHA1 (patch-ac) = c1de3af21a4b539236a906c4c072e6db283a2b28
SHA1 (patch-ad) = 358a9218bbe45cc5463a112ff6f2dec1b78da99e
SHA1 (patch-ai) = f29a725a65d8fff435bcef64c29acd4066101f83
SHA1 (patch-ak) = 0e3cbb4ac58a3445224779d72153e2bba5a4b6c2
@@ -12,5 +12,5 @@ SHA1 (patch-al) = e7caad8f6743537469866f9b47b0044ec95852ad
SHA1 (patch-am) = 92aa5e122529a30e05199cbe26620b3ac01adbc5
SHA1 (patch-an) = 55c7f9785c19d84b8ad74bbf0827162b156e2327
SHA1 (patch-ao) = cc0b3d73d0c7de4cd46e66b0d66b2c3bbaddeb41
-SHA1 (patch-ap) = 199e2f8e5f2a5ac5aace21e6ada1fd8887a19059
+SHA1 (patch-ap) = 80d0884d5a38c5efeb26c9657baea73564f0daa9
SHA1 (patch-aq) = 73017f99efd1b4e3d93d8f14e63f0c43e391236d
diff --git a/net/ja-samba/files/adduser.sh b/net/ja-samba/files/adduser.sh
new file mode 100644
index 00000000000..61706e23a96
--- /dev/null
+++ b/net/ja-samba/files/adduser.sh
@@ -0,0 +1,160 @@
+#!/bin/sh
+#
+# $NetBSD: adduser.sh,v 1.1 2004/06/05 13:16:35 taca 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 --git a/net/ja-samba/files/deluser.sh b/net/ja-samba/files/deluser.sh
new file mode 100644
index 00000000000..c4c6660b4ca
--- /dev/null
+++ b/net/ja-samba/files/deluser.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+# $NetBSD: deluser.sh,v 1.1 2004/06/05 13:16:35 taca 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
+
+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
+
+$awkprog -v name="${name}" ' \
+ BEGIN { FS = ":" } \
+ { \
+ if ($1 != name) \
+ print $0; \
+ }' /etc/master.passwd > $ptmp
+
+$doit $pwdmkdbprog -p $ptmp
+rc=$?
+
+$rmprog -f $ptmp
+exit $rc
diff --git a/net/ja-samba/patches/patch-aa b/net/ja-samba/patches/patch-aa
index 966d683d624..418c5bb9741 100644
--- a/net/ja-samba/patches/patch-aa
+++ b/net/ja-samba/patches/patch-aa
@@ -1,6 +1,6 @@
-$NetBSD: patch-aa,v 1.5 2003/08/30 01:31:13 taca Exp $
+$NetBSD: patch-aa,v 1.6 2004/06/05 13:16:35 taca Exp $
---- Makefile.in.orig 2003-08-22 17:45:57.000000000 +0900
+--- Makefile.in.orig 2004-01-22 20:24:22.000000000 +0900
+++ Makefile.in
@@ -117,6 +117,8 @@ LDSHFLAGSPO = @LDSHFLAGS@ @ARCHFLAGPO@
LDSHFLAGS32 = @LDSHFLAGS@ @ARCHFLAG32@
@@ -15,8 +15,8 @@ $NetBSD: patch-aa,v 1.5 2003/08/30 01:31:13 taca Exp $
bin/pam_smbpass.@SHLIBEXT@: $(PAM_SMBPASS_OBJ) bin/.dummy
@echo Linking shared library $@
-- $(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_OBJ) $(LDFLAGS) -lpam $(SHDYNEXP) $(SOLIBS) $(LDAPLIBS) -lc \
-+ $(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_OBJ) $(LDFLAGS) -lpam $(SHDYNEXP) $(SOLIBS) $(LDAPLIBS) $(PAM_NEEDS_LIBC) \
+- @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_OBJ) -lpam $(SHDYNEXP) $(SOLIBS) $(LDAPLIBS) -lc \
++ @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_OBJ) -lpam $(SHDYNEXP) $(SOLIBS) $(LDAPLIBS) $(PAM_NEEDS_LIBC) \
@SONAMEFLAG@`basename $@`
nsswitch/libnss_wins.@SHLIBEXT@: $(NSS_OBJ)
diff --git a/net/ja-samba/patches/patch-ab b/net/ja-samba/patches/patch-ab
index a74da301d49..5de4011ecaf 100644
--- a/net/ja-samba/patches/patch-ab
+++ b/net/ja-samba/patches/patch-ab
@@ -1,8 +1,8 @@
-$NetBSD: patch-ab,v 1.5 2003/08/30 01:31:13 taca Exp $
+$NetBSD: patch-ab,v 1.6 2004/06/05 13:16:35 taca Exp $
---- configure.in.orig 2003-08-22 17:45:59.000000000 +0900
+--- configure.in.orig 2004-01-22 20:20:32.000000000 +0900
+++ configure.in
-@@ -2328,6 +2328,10 @@ AC_ARG_WITH(pam,
+@@ -2352,6 +2352,10 @@ AC_ARG_WITH(pam,
# we can't build a pam module if we don't have pam.
AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM)])
diff --git a/net/ja-samba/patches/patch-ac b/net/ja-samba/patches/patch-ac
index e51d23a36c6..cbfc248d05f 100644
--- a/net/ja-samba/patches/patch-ac
+++ b/net/ja-samba/patches/patch-ac
@@ -1,8 +1,8 @@
-$NetBSD: patch-ac,v 1.5 2003/08/30 01:31:13 taca Exp $
+$NetBSD: patch-ac,v 1.6 2004/06/05 13:16:35 taca Exp $
---- configure.orig 2003-08-22 17:45:58.000000000 +0900
+--- configure.orig 2004-01-22 20:20:31.000000000 +0900
+++ configure
-@@ -21463,6 +21463,49 @@ echo "${ECHO_T}no" >&6
+@@ -21449,6 +21449,49 @@ echo "${ECHO_T}no" >&6
fi;
@@ -52,11 +52,11 @@ $NetBSD: patch-ac,v 1.5 2003/08/30 01:31:13 taca Exp $
#################################################
# check for a NISPLUS password database
echo "$as_me:$LINENO: checking whether to use NISPLUS SAM database" >&5
-@@ -26993,6 +27036,7 @@ s,@TERMLDFLAGS@,$TERMLDFLAGS,;t t
- s,@ROFF@,$ROFF,;t t
+@@ -26986,6 +27029,7 @@ s,@ROFF@,$ROFF,;t t
s,@DYNEXP@,$DYNEXP,;t t
s,@SHDYNEXP@,$SHDYNEXP,;t t
-+s%@PAM_NEEDS_LIBC@%$PAM_NEEDS_LIBC%g
+ s,@KRBLIBS@,$KRBLIBS,;t t
++s,@PAM_NEEDS_LIBC@,$PAM_NEEDS_LIBC,g
s,@LDAPLIBS@,$LDAPLIBS,;t t
+ s,@SSLLIBS@,$SSLLIBS,;t t
s,@QUOTAOBJS@,$QUOTAOBJS,;t t
- s,@WINBIND_TARGETS@,$WINBIND_TARGETS,;t t
diff --git a/net/ja-samba/patches/patch-ap b/net/ja-samba/patches/patch-ap
index 68fa575ce25..ca6dd135403 100644
--- a/net/ja-samba/patches/patch-ap
+++ b/net/ja-samba/patches/patch-ap
@@ -1,42 +1,40 @@
-$NetBSD: patch-ap,v 1.2 2003/03/31 16:33:22 taca Exp $
+$NetBSD: patch-ap,v 1.3 2004/06/05 13:16:35 taca Exp $
Expand & in the gecos field to a capitalized login name.
---- lib/system.c.orig 2003-02-05 15:14:52.000000000 +0900
+--- lib/system.c.orig 2003-07-17 20:23:53.000000000 +0900
+++ lib/system.c
-@@ -776,6 +776,11 @@ static int num_lookups; /* Counter so we
+@@ -776,12 +776,47 @@ static int num_lookups; /* Counter so we
static void copy_pwent(struct saved_pw *dst, struct passwd *pass)
{
+#ifdef BSD
-+ char *bp, *gecos, *p, buf[PSTRING_LEN];
++# define BUFLEN 1024
++ char *bp, *gecos, *p, buf[BUFLEN];
+ int buflen;
+#endif
+
memcpy((char *)&dst->pass, pass, sizeof(struct passwd));
unix_to_dos(dst->pw_name, pass->pw_name);
-@@ -785,6 +790,35 @@ static void copy_pwent(struct saved_pw *
- dst->pass.pw_passwd = dst->pw_passwd;
+ dst->pass.pw_name = dst->pw_name;
- unix_to_dos(dst->pw_gecos, pass->pw_gecos);
+#ifdef BSD
-+ gecos = dst->pw_gecos;
++ gecos = pass->pw_gecos;
+ if (*gecos == '*')
+ gecos++;
+ bp = buf;
+
+ /* copy gecos, interpolating & to be full name */
+ for (p = gecos; *p != '\0'; p++) {
-+ if (bp >= &buf[PSTRING_LEN - 1]) {
++ if (bp >= &buf[BUFLEN - 1]) {
+ /* buffer overflow */
+ gecos = pass->pw_name;
+ goto gecos_done;
+ }
+ if (*p == '&') {
+ /* interpolate full name */
-+ snprintf(bp, PSTRING_LEN - (bp - buf), "%s",
-+ pass->pw_name);
++ snprintf(bp, BUFLEN - (bp - buf), "%s", pass->pw_name);
+ *bp = toupper(*bp);
+ bp += strlen(bp);
+ }
@@ -48,7 +46,9 @@ Expand & in the gecos field to a capitalized login name.
+
+ gecos_done:
+ fstrcpy(dst->pw_gecos, gecos);
++#else
+ fstrcpy(dst->pw_passwd, pass->pw_passwd);
+#endif
- dst->pass.pw_gecos = dst->pw_gecos;
+ dst->pass.pw_passwd = dst->pw_passwd;
- unix_to_dos(dst->pw_dir, pass->pw_dir);
+ unix_to_dos(dst->pw_gecos, pass->pw_gecos);