PERFORCE change 99219 for review
Michael Bushkov
bushman at FreeBSD.org
Wed Jun 14 11:50:09 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=99219
Change 99219 by bushman at bushman_nss_ldap_cached on 2006/06/14 11:47:06
All "hosts" source functionality is now split into the nss-modules (nss_files, nss_dns and nss_nis). Now these modules should be cleaned to avoid code duplication.
Affected files ...
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/defaults/rc.conf#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/devd.conf#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/hosts.allow#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/netstart#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/Makefile#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/auditd#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/bridge#1 branch
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/cached#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/devd#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/jail#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/netif#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/pf#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/gen/getgrent.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/gen/glob.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/i386/gen/_ctx_start.S#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/sys/truncate.2#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libnssutil/hosts_name6.h#2 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/dns_hosts_addrinfo.c#2 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/dns_hosts_namadr.c#2 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/dns_hosts_name6.c#2 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/dns_hosts_name6.h#2 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/nss_dns.c#2 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_files/nss_files.c#2 edit
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_nis/Makefile#1 add
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_nis/nis_hosts_addrinfo.c#1 add
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_nis/nis_hosts_addrinfo.h#1 add
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_nis/nis_hosts_namadr.c#1 add
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_nis/nis_hosts_namadr.h#1 add
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_nis/nis_hosts_name6.c#1 add
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_nis/nis_hosts_name6.h#1 add
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_nis/nss_nis.c#1 add
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/adduser/adduser.8#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/bluetooth/hccontrol/hccontrol.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/config/config.y#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/config/main.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/config/mkmakefile.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/config/mkoptions.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/cron/cron/do_command.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/cron/cron/popen.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/mailwrapper/Makefile#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/mailwrapper/mailwrapper.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/mountd/mountd.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ntp/doc/ntp.conf.5#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/portsnap/portsnap/portsnap.sh#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/sysinstall/installUpgrade.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ypserv/Makefile.yp#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ypserv/yp_access.c#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/ypserv/ypinit.8#2 integrate
Differences ...
==== //depot/projects/soc2006/nss_ldap_cached/src/etc/defaults/rc.conf#2 (text+ko) ====
@@ -15,7 +15,7 @@
# For a more detailed explanation of all the rc.conf variables, please
# refer to the rc.conf(5) manual page.
#
-# $FreeBSD: src/etc/defaults/rc.conf,v 1.285 2006/05/24 00:06:14 kris Exp $
+# $FreeBSD: src/etc/defaults/rc.conf,v 1.288 2006/06/07 17:14:27 brueffer Exp $
##############################################################
### Important initial Boot-time options ####################
@@ -74,7 +74,7 @@
#geli_da1_autodetach="NO"
#geli_mirror_home_flags="-k /etc/geli/home.keys"
-geli_swap_flags="-a aes -l 256 -s 4096 -d" # Options for GELI-encrypted
+geli_swap_flags="-e aes -l 256 -s 4096 -d" # Options for GELI-encrypted
# swap partitions.
root_rw_mount="YES" # Set to NO to inhibit remounting root read-write.
@@ -159,6 +159,9 @@
#ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0.
#ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry.
#
+#autobridge_interfaces="bridge0" # List of bridges to check
+#autobridge_bridge0="tap* vlan0" # Interface glob to automatically add to the bridge
+#
# If you have any sppp(4) interfaces above, you might also want to set
# the following parameters. Refer to spppcontrol(8) for their meaning.
sppp_interfaces="" # List of sppp interfaces.
@@ -546,6 +549,9 @@
#jail_example_ip="192.168.0.10" # Jail's IP number
#jail_example_interface="" # Interface to create the IP alias on
#jail_example_exec_start="/bin/sh /etc/rc" # command to execute in jail for starting
+#jail_example_exec_afterstart0="/bin/sh command" # command to execute after the one for
+ # starting the jail. More than one can be
+ # specified using a trailing number
#jail_example_exec_stop="/bin/sh /etc/rc.shutdown" # command to execute in jail for stopping
#jail_example_devfs_enable="NO" # mount devfs in the jail
#jail_example_fdescfs_enable="NO" # mount fdescfs in the jail
==== //depot/projects/soc2006/nss_ldap_cached/src/etc/devd.conf#2 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/devd.conf,v 1.32 2006/03/16 17:42:27 emax Exp $
+# $FreeBSD: src/etc/devd.conf,v 1.33 2006/06/01 00:41:07 thompsa Exp $
#
# Refer to devd.conf(5) and devd(8) man pages for the details on how to
# run and configure devd.
@@ -28,17 +28,19 @@
# override these general rules.
#
-# For ethernet like devices start configuring the interface. Due to
-# a historical accident, this script is called pccard_ether.
+# Configure the interface on attach. Due to a historical accident, this
+# script is called pccard_ether.
#
-attach 0 {
- media-type "ethernet";
- action "/etc/pccard_ether $device-name start";
+notify 0 {
+ match "system" "IFNET";
+ match "type" "ATTACH";
+ action "/etc/pccard_ether $subsystem start";
};
-detach 0 {
- media-type "ethernet";
- action "/etc/pccard_ether $device-name stop";
+notify 0 {
+ match "system" "IFNET";
+ match "type" "DETACH";
+ action "/etc/pccard_ether $subsystem stop";
};
#
==== //depot/projects/soc2006/nss_ldap_cached/src/etc/hosts.allow#2 (text+ko) ====
@@ -1,6 +1,6 @@
#
# hosts.allow access control file for "tcp wrapped" applications.
-# $FreeBSD: src/etc/hosts.allow,v 1.21 2006/03/17 18:54:21 ru Exp $
+# $FreeBSD: src/etc/hosts.allow,v 1.22 2006/06/01 14:14:58 csjp Exp $
#
# NOTE: The hosts.deny file is deprecated.
# Place both 'allow' and 'deny' rules in the hosts.allow file.
@@ -66,6 +66,7 @@
rpcbind : ALL : deny
# NIS master server. Only local nets should have access
+# (Since this is an RPC service, rpcbind needs to be considered)
ypserv : localhost : allow
ypserv : .unsafe.my.net.example.com : deny
ypserv : .my.net.example.com : allow
==== //depot/projects/soc2006/nss_ldap_cached/src/etc/netstart#2 (text+ko) ====
@@ -24,7 +24,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $FreeBSD: src/etc/netstart,v 1.66 2005/10/29 05:08:00 yar Exp $
+# $FreeBSD: src/etc/netstart,v 1.67 2006/05/30 02:10:01 brooks Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
#
@@ -37,7 +37,6 @@
. /etc/rc.subr
load_rc_config 'XXX'
-/etc/rc.d/pccard start
/etc/rc.d/devd start
/etc/rc.d/hostname start
/etc/rc.d/ipmon start
==== //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/Makefile#2 (text+ko) ====
@@ -1,12 +1,12 @@
# $NetBSD: Makefile,v 1.16 2001/01/14 15:37:22 minoura Exp $
-# $FreeBSD: src/etc/rc.d/Makefile,v 1.72 2006/05/18 15:29:27 flz Exp $
+# $FreeBSD: src/etc/rc.d/Makefile,v 1.73 2006/06/01 11:01:54 thompsa Exp $
.include <bsd.own.mk>
FILES= DAEMON LOGIN NETWORKING SERVERS \
abi accounting addswap adjkerntz amd \
apm apmd archdep atm1 atm2 atm3 auditd \
- bgfsck bluetooth bootparams bsnmpd \
+ bgfsck bluetooth bootparams bridge bsnmpd \
ccd cleanvar cleartmp cron \
devd devfs dhclient \
dmesg dumpon \
==== //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/auditd#2 (text+ko) ====
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $FreeBSD: src/etc/rc.d/auditd,v 1.1 2006/02/02 10:02:55 rwatson Exp $
+# $FreeBSD: src/etc/rc.d/auditd,v 1.2 2006/06/06 17:22:55 trhodes Exp $
#
# Start up for the Audit daemon.
#
@@ -8,6 +8,7 @@
# PROVIDE: auditd
# REQUIRE: syslogd
# BEFORE: DAEMON
+# KEYWORD: shutdown
. /etc/rc.subr
@@ -23,11 +24,7 @@
auditd_stop()
{
- if [ -f /var/run/auditd.pid ]; then
- /usr/sbin/audit -t
- else
- echo "The audit daemon is not running";
- fi
+ /usr/sbin/audit -t
}
load_rc_config $name
==== //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/cached#2 (text) ====
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $FreeBSD: src/etc/rc.d/cached,v 1.1 2006/04/28 12:03:34 ume Exp $
+# $FreeBSD: src/etc/rc.d/cached,v 1.3 2006/06/06 15:34:50 ume Exp $
#
# PROVIDE: cached
@@ -21,6 +21,8 @@
rcvar=`set_rcvar`
command=/usr/sbin/cached
+extra_commands="flush"
+flush_cmd="${command} -I all"
cached_enable=${cached_enable:-"NO"}
cached_pidfile=${cached_pidfile:-"/var/run/cached.pid"}
==== //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/devd#2 (text+ko) ====
@@ -1,11 +1,11 @@
#!/bin/sh
#
-# $FreeBSD: src/etc/rc.d/devd,v 1.8 2005/10/28 16:55:38 yar Exp $
+# $FreeBSD: src/etc/rc.d/devd,v 1.9 2006/06/01 00:41:07 thompsa Exp $
#
# PROVIDE: devd
-# REQUIRE: NETWORKING
-# BEFORE: mountcritremote
+# REQUIRE: netif
+# BEFORE: NETWORKING mountcritremote
# KEYWORD: nojail
. /etc/rc.subr
==== //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/jail#2 (text+ko) ====
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $FreeBSD: src/etc/rc.d/jail,v 1.32 2006/05/11 14:23:43 flz Exp $
+# $FreeBSD: src/etc/rc.d/jail,v 1.34 2006/05/30 16:20:48 matteo Exp $
#
# PROVIDE: jail
@@ -36,6 +36,14 @@
eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\"
eval _exec=\"\$jail_${_j}_exec\"
eval _exec_start=\"\${jail_${_j}_exec_start:-${jail_exec_start}}\"
+
+ i=1
+ while [ true ]; do
+ eval _exec_afterstart${i}=\"\${jail_${_j}_exec_afterstart${i}:-\${jail_exec_afterstart${i}}}\"
+ [ -z "$(eval echo \"\$_exec_afterstart${i}\")" ] && break
+ i=$((i + 1))
+ done
+
eval _exec_stop=\"\${jail_${_j}_exec_stop:-${jail_exec_stop}}\"
if [ -n "${_exec}" ]; then
# simple/backward-compatible execution
@@ -84,6 +92,19 @@
debug "$_j ruleset: $_ruleset"
debug "$_j fstab: $_fstab"
debug "$_j exec start: $_exec_start"
+
+ i=1
+ while [ true ]; do
+ eval out=\"\${_exec_afterstart${i}:-''}\"
+
+ if [ -z "$out" ]; then
+ break;
+ fi
+
+ debug "$_j exec after start #${i}: ${out}"
+ i=$((i + 1))
+ done
+
debug "$_j exec stop: $_exec_stop"
debug "$_j flags: $_flags"
@@ -221,19 +242,32 @@
_tmp_jail=${_tmp_dir}/jail.$$
eval jail ${_flags} -i ${_rootdir} ${_hostname} \
${_ip} ${_exec_start} > ${_tmp_jail} 2>&1
- if [ "$?" -eq 0 ] ; then
- echo -n " $_hostname"
- _jail_id=$(head -1 ${_tmp_jail})
- tail +2 ${_tmp_jail} >${_rootdir}/var/log/console.log
- echo ${_jail_id} > /var/run/jail_${_jail}.id
- else
- jail_umount_fs
- if [ -n "${jail_interface}" ]; then
- ifconfig ${jail_interface} -alias ${jail_ip}
+
+ if [ "$?" -eq 0 ] ; then
+ _jail_id=$(head -1 ${_tmp_jail})
+ i=1
+ while [ true ]; do
+ eval out=\"\${_exec_afterstart${i}:-''}\"
+
+ if [ -z "$out" ]; then
+ break;
fi
- echo " cannot start jail \"${_jail}\": "
- tail +2 ${_tmp_jail}
+
+ jexec "${_jail_id}" ${out}
+ i=$((i + 1))
+ done
+
+ echo -n " $_hostname"
+ tail +2 ${_tmp_jail} >${_rootdir}/var/log/console.log
+ echo ${_jail_id} > /var/run/jail_${_jail}.id
+ else
+ jail_umount_fs
+ if [ -n "${jail_interface}" ]; then
+ ifconfig ${jail_interface} -alias ${jail_ip}
fi
+ echo " cannot start jail \"${_jail}\": "
+ tail +2 ${_tmp_jail}
+ fi
rm -f ${_tmp_jail}
done
rmdir ${_tmp_dir}
==== //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/netif#2 (text+ko) ====
@@ -22,7 +22,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
-# $FreeBSD: src/etc/rc.d/netif,v 1.19 2006/02/13 20:08:31 imp Exp $
+# $FreeBSD: src/etc/rc.d/netif,v 1.20 2006/06/01 11:01:54 thompsa Exp $
#
# PROVIDE: netif
@@ -71,6 +71,9 @@
# Resync ipfilter
/etc/rc.d/ipfilter resync
fi
+ if [ -f /etc/rc.d/bridge -a -n "$_cmdifn" ] ; then
+ /etc/rc.d/bridge start $_cmdifn
+ fi
}
network_stop()
==== //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/pf#2 (text+ko) ====
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $FreeBSD: src/etc/rc.d/pf,v 1.12 2005/11/10 10:40:15 rse Exp $
+# $FreeBSD: src/etc/rc.d/pf,v 1.13 2006/06/05 03:47:14 obrien Exp $
#
# PROVIDE: pf
@@ -40,7 +40,7 @@
pf_start()
{
echo "Enabling pf."
- $pf_program -Fall > /dev/null 2>&1
+ $pf_program -F all > /dev/null 2>&1
$pf_program -f "$pf_rules" $pf_flags
if ! $pf_program -s info | grep -q "Enabled" ; then
$pf_program -e
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/gen/getgrent.c#2 (text+ko) ====
@@ -31,7 +31,7 @@
*
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/gen/getgrent.c,v 1.33 2006/04/28 12:03:35 ume Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/gen/getgrent.c,v 1.34 2006/06/01 15:45:06 maxim Exp $");
#include "namespace.h"
#include <sys/param.h>
@@ -721,6 +721,7 @@
gid_t gid;
char *buffer;
size_t bufsize, linesize;
+ off_t pos;
int rv, stayopen, *errnop;
name = NULL;
@@ -757,6 +758,7 @@
stayopen = st->stayopen;
}
rv = NS_NOTFOUND;
+ pos = ftello(st->fp);
while ((line = fgetln(st->fp, &linesize)) != NULL) {
if (line[linesize-1] == '\n')
linesize--;
@@ -768,10 +770,12 @@
* pointer for the member list terminator.
*/
if (bufsize <= linesize + _ALIGNBYTES + sizeof(char *)) {
+ fseeko(st->fp, pos, SEEK_SET);
*errnop = ERANGE;
rv = NS_RETURN;
break;
}
+ pos = ftello(st->fp);
memcpy(buffer, line, linesize);
buffer[linesize] = '\0';
rv = __gr_parse_entry(buffer, linesize, grp,
@@ -1183,6 +1187,7 @@
char *buffer, *p;
void *discard;
size_t bufsize, linesize;
+ off_t pos;
int rv, stayopen, *errnop;
#define set_lookup_type(x, y) do { \
@@ -1286,6 +1291,7 @@
break;
}
rv = NS_NOTFOUND;
+ pos = ftello(st->fp);
while ((line = fgetln(st->fp, &linesize)) != NULL) {
if (line[linesize-1] == '\n')
linesize--;
@@ -1316,10 +1322,12 @@
* pointer for the member list terminator.
*/
if (bufsize <= linesize + _ALIGNBYTES + sizeof(char *)) {
+ fseeko(st->fp, pos, SEEK_SET);
*errnop = ERANGE;
rv = NS_RETURN;
break;
}
+ pos = ftello(st->fp);
memcpy(buffer, line, linesize);
buffer[linesize] = '\0';
rv = __gr_parse_entry(buffer, linesize, grp,
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/gen/glob.c#2 (text+ko) ====
@@ -38,7 +38,7 @@
static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/gen/glob.c,v 1.24 2006/05/22 06:33:19 ache Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/gen/glob.c,v 1.25 2006/06/05 18:22:13 delphij Exp $");
/*
* glob(3) -- a superset of the one defined in POSIX 1003.2.
@@ -167,19 +167,16 @@
#endif
int
-glob(pattern, flags, errfunc, pglob)
- const char *pattern;
- int flags, (*errfunc)(const char *, int);
- glob_t *pglob;
+glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob)
{
- const u_char *patnext;
+ const char *patnext;
size_t limit;
Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot;
mbstate_t mbs;
wchar_t wc;
size_t clen;
- patnext = (u_char *) pattern;
+ patnext = pattern;
if (!(flags & GLOB_APPEND)) {
pglob->gl_pathc = 0;
pglob->gl_pathv = NULL;
@@ -244,10 +241,7 @@
* characters
*/
static int
-globexp1(pattern, pglob, limit)
- const Char *pattern;
- glob_t *pglob;
- size_t *limit;
+globexp1(const Char *pattern, glob_t *pglob, size_t *limit)
{
const Char* ptr = pattern;
int rv;
@@ -270,11 +264,7 @@
* If it fails then it tries to glob the rest of the pattern and returns.
*/
static int
-globexp2(ptr, pattern, pglob, rv, limit)
- const Char *ptr, *pattern;
- glob_t *pglob;
- int *rv;
- size_t *limit;
+globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit)
{
int i;
Char *lm, *ls;
@@ -378,11 +368,7 @@
* expand tilde from the passwd file.
*/
static const Char *
-globtilde(pattern, patbuf, patbuf_len, pglob)
- const Char *pattern;
- Char *patbuf;
- size_t patbuf_len;
- glob_t *pglob;
+globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
{
struct passwd *pwd;
char *h;
@@ -448,10 +434,7 @@
* if things went well, nonzero if errors occurred.
*/
static int
-glob0(pattern, pglob, limit)
- const Char *pattern;
- glob_t *pglob;
- size_t *limit;
+glob0(const Char *pattern, glob_t *pglob, size_t *limit)
{
const Char *qpatnext;
int c, err;
@@ -538,17 +521,13 @@
}
static int
-compare(p, q)
- const void *p, *q;
+compare(const void *p, const void *q)
{
return(strcmp(*(char **)p, *(char **)q));
}
static int
-glob1(pattern, pglob, limit)
- Char *pattern;
- glob_t *pglob;
- size_t *limit;
+glob1(Char *pattern, glob_t *pglob, size_t *limit)
{
Char pathbuf[MAXPATHLEN];
@@ -565,10 +544,8 @@
* meta characters.
*/
static int
-glob2(pathbuf, pathend, pathend_last, pattern, pglob, limit)
- Char *pathbuf, *pathend, *pathend_last, *pattern;
- glob_t *pglob;
- size_t *limit;
+glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern,
+ glob_t *pglob, size_t *limit)
{
struct stat sb;
Char *p, *q;
@@ -625,10 +602,9 @@
}
static int
-glob3(pathbuf, pathend, pathend_last, pattern, restpattern, pglob, limit)
- Char *pathbuf, *pathend, *pathend_last, *pattern, *restpattern;
- glob_t *pglob;
- size_t *limit;
+glob3(Char *pathbuf, Char *pathend, Char *pathend_last,
+ Char *pattern, Char *restpattern,
+ glob_t *pglob, size_t *limit)
{
struct dirent *dp;
DIR *dirp;
@@ -668,7 +644,7 @@
else
readdirfunc = readdir;
while ((dp = (*readdirfunc)(dirp))) {
- u_char *sc;
+ char *sc;
Char *dc;
wchar_t wc;
size_t clen;
@@ -679,7 +655,7 @@
continue;
memset(&mbs, 0, sizeof(mbs));
dc = pathend;
- sc = (u_char *) dp->d_name;
+ sc = dp->d_name;
while (dc < pathend_last) {
clen = mbrtowc(&wc, sc, MB_LEN_MAX, &mbs);
if (clen == (size_t)-1 || clen == (size_t)-2) {
@@ -724,10 +700,7 @@
* gl_pathv points to (gl_offs + gl_pathc + 1) items.
*/
static int
-globextend(path, pglob, limit)
- const Char *path;
- glob_t *pglob;
- size_t *limit;
+globextend(const Char *path, glob_t *pglob, size_t *limit)
{
char **pathv;
size_t i, newsize, len;
@@ -778,8 +751,7 @@
* pattern causes a recursion level.
*/
static int
-match(name, pat, patend)
- Char *name, *pat, *patend;
+match(Char *name, Char *pat, Char *patend)
{
int ok, negate_range;
Char c, k;
@@ -830,8 +802,7 @@
/* Free allocated data belonging to a glob_t structure. */
void
-globfree(pglob)
- glob_t *pglob;
+globfree(glob_t *pglob)
{
size_t i;
char **pp;
@@ -847,9 +818,7 @@
}
static DIR *
-g_opendir(str, pglob)
- Char *str;
- glob_t *pglob;
+g_opendir(Char *str, glob_t *pglob)
{
char buf[MAXPATHLEN];
@@ -867,10 +836,7 @@
}
static int
-g_lstat(fn, sb, pglob)
- Char *fn;
- struct stat *sb;
- glob_t *pglob;
+g_lstat(Char *fn, struct stat *sb, glob_t *pglob)
{
char buf[MAXPATHLEN];
@@ -884,10 +850,7 @@
}
static int
-g_stat(fn, sb, pglob)
- Char *fn;
- struct stat *sb;
- glob_t *pglob;
+g_stat(Char *fn, struct stat *sb, glob_t *pglob)
{
char buf[MAXPATHLEN];
@@ -901,10 +864,9 @@
}
static Char *
-g_strchr(str, ch)
- Char *str;
- wchar_t ch;
+g_strchr(Char *str, wchar_t ch)
{
+
do {
if (*str == ch)
return (str);
@@ -913,10 +875,7 @@
}
static int
-g_Ctoc(str, buf, len)
- const Char *str;
- char *buf;
- size_t len;
+g_Ctoc(const Char *str, char *buf, size_t len)
{
mbstate_t mbs;
size_t clen;
@@ -937,9 +896,7 @@
#ifdef DEBUG
static void
-qprintf(str, s)
- const char *str;
- Char *s;
+qprintf(const char *str, Char *s)
{
Char *p;
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/i386/gen/_ctx_start.S#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libc/i386/gen/_ctx_start.S,v 1.3 2004/07/02 14:19:44 davidxu Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/i386/gen/_ctx_start.S,v 1.4 2006/06/05 14:59:33 kib Exp $");
/*
* _ctx_start((void *func)(int arg1, ..., argn),
@@ -41,10 +41,11 @@
ENTRY(_ctx_start)
popl %eax /* get start function */
call *%eax /* call start function */
+ PIC_PROLOGUE
movl %esi, %esp /*
* setup stack for completion routine;
* ucp is now at top of stack
*/
- call _ctx_done /* should never return */
- call abort /* fubar */
+ call PIC_PLT(_ctx_done) /* should never return */
+ call PIC_PLT(abort) /* fubar */
ret
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/sys/truncate.2#2 (text+ko) ====
@@ -30,9 +30,9 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)truncate.2 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/sys/truncate.2,v 1.17 2005/01/20 09:17:05 ru Exp $
+.\" $FreeBSD: src/lib/libc/sys/truncate.2,v 1.18 2006/06/01 14:20:43 maxim Exp $
.\"
-.Dd June 4, 1993
+.Dd June 1, 2006
.Dt TRUNCATE 2
.Os
.Sh NAME
@@ -69,6 +69,10 @@
the file must be open for writing.
.Sh RETURN VALUES
.Rv -std
+If the file to be modified is not a directory or
+a regular file, the
+.Fn truncate
+call has no effect and returns the value 0.
.Sh ERRORS
The
.Fn truncate
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libnssutil/hosts_name6.h#2 (text+ko) ====
@@ -64,3 +64,10 @@
#define map_one map_addr_un.mau_one
#define map_inaddr map_addr_un.mau_inaddr
};
+
+struct hostent * _hpcopy(struct hostent *hp, int *errp);
+struct hostent * _hpmerge(struct hostent *hp1, struct hostent *hp2, int *errp);
+#ifdef INET6
+struct hostent * _hpmapv6(struct hostent *hp, int *errp);
+#endif
+struct hostent * _hpsort(struct hostent *hp, res_state statp);
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/dns_hosts_addrinfo.c#2 (text+ko) ====
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/dns_hosts_namadr.c#2 (text+ko) ====
@@ -97,7 +97,12 @@
if (hed == NULL)
return;
hed->stayopen = 0;
- _endhosthtent(hed);
+
+ if (hed->hostf) {
+ (void) fclose(hed->hostf);
+ hed->hostf = NULL;
+ }
+
free(hed);
}
==== //depot/projects/soc2006/nss_ldap_cached/src/lib/nss_dns/dns_hosts_name6.c#2 (text+ko) ====
@@ -1,0 +1,609 @@
+/* $KAME: name6.c,v 1.25 2000/06/26 16:44:40 itojun Exp $ */
+
+/*
+ * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/*
+ * ++Copyright++ 1985, 1988, 1993
+ * -
+ * Copyright (c) 1985, 1988, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * -
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * -
+ * --Copyright--
+ */
+
+/*
+ * Atsushi Onoe <onoe at sm.sony.co.jp>
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/queue.h>
+#include <netinet/in.h>
+#ifdef INET6
+#include <net/if.h>
+#include <net/if_var.h>
+#include <sys/sysctl.h>
+#include <sys/ioctl.h>
+#include <netinet6/in6_var.h> /* XXX */
+#endif
+
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <nsswitch.h>
+#include <unistd.h>
+#include "netdb_private.h"
+#include "res_config.h"
+#include "hosts_name6.h"
+
+#ifndef MAXALIASES
+#define MAXALIASES 10
+#endif
+#ifndef MAXADDRS
+#define MAXADDRS 20
+#endif
+
+#ifdef INET6
+#define ADDRLEN(af) ((af) == AF_INET6 ? sizeof(struct in6_addr) : \
+ sizeof(struct in_addr))
+#else
+#define ADDRLEN(af) sizeof(struct in_addr)
+#endif
+
+#define MAXPACKET (64*1024)
+
+typedef union {
+ HEADER hdr;
+ u_char buf[MAXPACKET];
+} querybuf;
+
+static struct hostent *getanswer(const querybuf *, int, const char *, int,
+ struct hostent *, int *);
+
+/*
+ * we don't need to take care about sorting, nor IPv4 mapped address here.
+ */
+static struct hostent *
+getanswer(const querybuf *answer, int anslen, const char *qname, int qtype,
+ struct hostent *template, int *errp)
+{
+ const HEADER *hp;
+ const u_char *cp;
+ int n;
+ const u_char *eom, *erdata;
+ char *bp, *ep, **ap, **hap;
+ int type, class, ancount, qdcount;
+ int haveanswer, had_error;
+ char tbuf[MAXDNAME];
+ const char *tname;
+ int (*name_ok)(const char *);
+ static char *h_addr_ptrs[MAXADDRS + 1];
+ static char *host_aliases[MAXALIASES];
+ static char hostbuf[8*1024];
+
+#define BOUNDED_INCR(x) \
+ do { \
+ cp += x; \
+ if (cp > eom) { \
+ *errp = NO_RECOVERY; \
+ return (NULL); \
+ } \
+ } while (0)
+
+#define BOUNDS_CHECK(ptr, count) \
+ do { \
+ if ((ptr) + (count) > eom) { \
+ *errp = NO_RECOVERY; \
+ return (NULL); \
+ } \
+ } while (0)
+
+/* XXX do {} while (0) cannot be put here */
+#define DNS_ASSERT(x) \
+ { \
+ if (!(x)) { \
+ cp += n; \
+ continue; \
+ } \
+ }
+
+/* XXX do {} while (0) cannot be put here */
+#define DNS_FATAL(x) \
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list